: http://linux.vbird.org/linux_basic/0420quota.php#lvm
5 u. U9 E+ r2 M http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk
( N" `* T. y$ ^. u) ?4 x8 p( O- C/ N R& M' f9 Z }7 H" }
[敶扳曉之LV摰寥]
2 y$ L4 s# P7 L6 F# Q+ M8 U$ Z, M, |, Z# O
9 |; d+ _* K' W& L# U! m6 G' i1) lvextend -l 178813 /dev/11HD_vg/11HD_lv
" u0 C5 y; z9 @6 n* A$ r
, t4 N' A4 `+ u' O" X% L* v( E+ B- ^+ I2 w. \
178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB& T! R7 x" y7 \5 x8 q2 Y1 ]% `2 K
6 s& R' d/ U4 V9 i7 l& h
( \$ K' f$ k9 s/ c* \9 \# P5 |2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv
/ e( }) n7 V# d
% Q& t3 \1 t% F# Z8 B8 {$ E8 X: M
. E8 f5 ]8 g6 ~2 W. @1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE
4 _8 a5 P1 A7 C# G
+ g s" H7 `/ K3 |# O
S& R5 A! z, R- [7 u0 K% `3)resize2fs /dev/11HD_vg/11HD_lv6 B* W" Q) b4 _0 `( Z4 r/ F
6 O! O) U% x7 h3 A2 j# s
! o. C0 ?% O5 s+ gP.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆0 }0 v3 n+ e- F3 P
雿輻 gdisk 脩,
% S8 w% m3 Q- ]4 C* F8 y* GHex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)
C- \& q5 B# Q" p% t4 p$ a# r. B6 F; T* c# P" [
! U2 j* h. P) W[蝘駁小v]+ G; W* I2 H/ M% m; h% I0 \" |- Y
pvscan or pvdisplay 瘥蝖祉憿舐內:
8 i4 e: m: S3 n" }6 Z# Y6 _Couldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM37 t3 ] J8 L+ u4 G F
PV Name unknown device
/ O. k: U1 d: A1 s* f. \0 @
8 d4 N* B) i" Y: A0 B' ]: D9 T; s# Y8 q望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:
5 W$ c* @6 D: w. Z, o; U" S8 ~vgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV
# P4 z- R7 D, J `pvscan or pvdisplay 撠曹憿舐內 "unknown device"6 c* x ]$ k: O- F2 Q8 @
+ k; t/ a5 S3 y. r z/ e& v" H$ }
7 N* c+ T' J; H2 C[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]
; O% c/ Y- J! f) x" n2 z#pvscan
- ~+ |4 o2 |/ F2 H( a3 U PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)& B! c; H& s& G! ?5 G2 u
PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]
/ j L2 E% G# J Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]. d. g( r* ^2 b) N
# z+ l! N# w1 A3 K; `. \3 G#vgscan! s; a) |( O# s
Reading all physical volumes. This may take a while...
* a3 u: K. z% F% o+ P! S* u7 ]; e3 b Found volume group "vg_centos6" using metadata type lvm2
& `6 D# m& g1 F Found volume group "vg_test" using metadata type lvm2
' T# z" a) b3 ] D1 J4 l1 s9 g6 E2 A) R, `
4 _7 X, }- j1 m/ g- t
#lvscan
% }9 l" e& w* @4 [8 z inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸
4 N; g, [; _9 j; E b7 _ inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸
/ G) _1 h3 [% I2 J7 m$ ~ ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit8 R7 Y2 O+ [3 {! O0 n
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
! {: h' [: s& W: U* v4 |: S( q8 M& x Z% u& |7 y5 t5 z6 h8 F* M' Q
/ b2 y( |4 e( z/ ]% H$ k
#lvdisplay /dev/vg_centos6/lv_root
: ^5 k; c+ G& B$ y+ v% [ --- Logical volume ---
3 Z4 Z5 v& W& O' a0 x LV Path /dev/vg_centos6/lv_root
) J3 d B' V, d LV Name lv_root
/ L4 J3 `! b( G3 b6 |: Z9 n VG Name vg_centos6
# s% p- t% |$ Z) U; b" k0 N, p' r LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe
. y/ L: ]# @/ `3 Q7 n) ? LV Write Access read/write
+ {* O& X. _5 ]/ y LV Creation host, time ,
S0 Y! S" L$ M" q" \ LV Status unavailable <==== 銝舐
4 j( E2 x6 G0 P: I7 R1 T # open 1' E) W% [3 \" g- z# {
LV Size 21.84 GiB6 a# ^% [$ x; ?+ i; n
Current LE 5591
1 \ J* z2 v0 m! Z4 C5 e2 I Segments 1
$ a& v5 }/ J$ V! e7 b Allocation inherit
4 m0 ]6 f% N$ P" O Read ahead sectors auto
$ I6 U1 B1 H! O1 q3 ?$ R1 f7 c; x - currently set to 256# a7 Z( I5 ` A0 M
Block device 253:2$ G& X$ q. k' g ~
# Z Y, m/ r3 ?8 z
5 s6 e. g" Y/ t/ m
暺券鋆:- p6 f# m2 m7 p) ~3 Y) D" x
vgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)
* `; K& @5 }6 S" }' }乩甈 LV:
- j" X! @/ [, n# m0 w#lvscan
/ ]) x: a7 d+ H: }* u% j! d ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭
/ Q" u. J$ x7 }" ~# k2 U/ p5 w ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭
$ p1 t9 A8 J* z6 f ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
1 u6 i* Z5 K8 [9 i" [4 F ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
& ]8 s# s) F# @0 Z: ?" l( L, x3 G( P' H5 h! M; y
: h& P w3 m7 z. H9 @, D; U9 X6 Y
mount LVM:
* l# {4 m( m# n) Zmkdir /mnt/lvmdisk
/ x; O$ p, G; {- C# K' Bmount /dev/vg_centos6/lv_root /mnt/lvmdisk N' N' A- [4 L/ {
憭批!' |; _; s. Y A# f/ w1 S! h x
! z" k: h; V) [4 b! P' U, ?, h
' A, O- ~6 h- g( k! i& g5 I |
|