: http://linux.vbird.org/linux_basic/0420quota.php#lvm
2 I; P; X. v. Q http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk
9 v0 l, P( F& j; c$ |- M! Q O) t5 y' M' w
[敶扳曉之LV摰寥]
5 g' H/ m) j! L- W5 w% E0 u
, \% {" y+ l: ^
& x+ I8 U, N% l& z0 y* k1) lvextend -l 178813 /dev/11HD_vg/11HD_lv
6 [* \- P" z. M) V* K1 f! |+ a
* s$ ~: ]: Q+ N! ^3 i
, E; X& C3 [: B, r' c178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB
/ \; d$ F9 z) R( d, K1 \! z( `/ f7 _* d2 E
1 u8 p7 s) Z5 T+ t2 r
2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv
/ T; j0 s# o" n* n* j }, b3 ~+ s
, h7 o5 M; j7 L: R. C2 T' Y0 ?/ d1 \, V5 r" d' E* n: j& @! R8 u# y1 T
1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE* W8 w! u* L. _+ @
& k. K9 P: |$ D5 I
/ O5 P r' U9 t! `+ u4 m$ {
3)resize2fs /dev/11HD_vg/11HD_lv
/ c6 _, }5 U8 [0 A8 _: C# K$ g$ a; J& M: X. h" V
/ [2 P4 V. J2 N7 P+ W; @
P.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆 g/ p* u2 r; ^' _
雿輻 gdisk 脩,
4 [3 a' ^( P; F1 U4 gHex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)! [/ K$ @" T" u. r
2 i. b2 Y, }6 }' j' Q0 m9 b& {
& {/ V% o7 f8 D2 E% r$ h8 C. |9 g8 }[蝘駁小v]
! I5 G0 A! `& l _pvscan or pvdisplay 瘥蝖祉憿舐內:
% A! B; ^# R* a3 V/ @- q" s2 p9 WCouldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3. ]6 H- {* y4 l" M) [4 p! J
PV Name unknown device a# ]8 T6 H* n; C: V
, Q8 Z8 P% D; S2 r8 E+ C
望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:
. s' `5 O, ^. g2 I" t Avgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV0 a& ?$ o! ~, a5 ^+ T$ B
pvscan or pvdisplay 撠曹憿舐內 "unknown device": p& p' ]+ w% m0 }4 _
& n$ E7 C7 H! f; `, P
6 i" f0 `3 n+ e5 A& X
[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition], d* S3 P: y$ t: g0 `6 A
#pvscan) R5 Z; \% x: l& a" w# k
PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)/ ?' d1 I, i, j/ M2 K& y
PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]3 T/ C% j- u2 ]
Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]/ L; _) g3 M$ O. E- |' J4 h
$ E" r8 _& x+ ]1 ^7 |+ O#vgscan
+ d, j# l1 G; ^ Reading all physical volumes. This may take a while...
: `: r8 E/ `' b9 E* M& Y Found volume group "vg_centos6" using metadata type lvm27 [: u* w8 I' N# Y
Found volume group "vg_test" using metadata type lvm2
, \7 Y" b" q; ?8 o% H/ o
( l: n$ y0 c% P1 ~# L, p% }7 f. n- C4 N/ Z! O$ v' m- v! M. r
#lvscan
5 N! l3 ^7 l5 r2 }: Z$ W8 L inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸
# O1 `5 _" r% Y7 S7 B' E+ _ inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸, ?# w5 M c6 Z7 v& }
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
7 W2 k5 C3 c0 \% H }; @ s4 a ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
" J" m6 q$ P4 `) \3 l3 M4 N9 t+ g0 L# Q# m5 b
8 g. D$ e2 ? a B#lvdisplay /dev/vg_centos6/lv_root: W. K h S9 T1 p
--- Logical volume ---( D0 C$ v, Z6 G0 h; m# z& s8 o+ r+ I
LV Path /dev/vg_centos6/lv_root
, m- ?1 l6 |3 ^! r0 I/ l LV Name lv_root
; q9 B! x% W* s+ C/ F' } VG Name vg_centos68 s) x$ Q% z, m7 V: W3 K [
LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe
% F6 F. ]# O, w4 Z5 } c LV Write Access read/write6 k, \4 G% {, F' K
LV Creation host, time ,: p% s! L# M/ w: j" U
LV Status unavailable <==== 銝舐: v8 R1 S0 L' H0 V: Y6 F) F1 W
# open 1
}7 Y$ D$ `- u7 d LV Size 21.84 GiB
/ r# m' y' I/ F- @ Current LE 55914 P& Y& F( i p" F, z3 P
Segments 1
7 J! {& U3 J. V0 G8 S. s Allocation inherit) r0 W9 T8 C& m# Y+ Q
Read ahead sectors auto* _3 @) S3 t' N3 B6 R5 {5 {
- currently set to 256
5 }) V7 ]: E# j- l Block device 253:2
+ V% y0 e' A- O" E/ |
0 r3 X- P- I1 N; ?5 u8 W) n
7 R1 n6 p- Y/ _" E暺券鋆:, N R) Y6 F& @+ M
vgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)
m& F) C u2 O3 f) ^; ?9 N乩甈 LV:
% y5 i _. y* D$ J! l+ l# @#lvscan
: U2 q/ J- \* d9 n- S: z ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭
; W) q ^/ z! } ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭( r( o5 y% `8 y( P% R& Y, ^ c5 v
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit2 J" b7 o9 R: E% |' f/ }
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit ~. }% s1 O1 X1 o
1 c: Z# V' v% b+ P& ^% d& j$ T
0 V5 B* ^! w- \4 Z H0 Wmount LVM:
6 z, `5 O* N. v3 R. Lmkdir /mnt/lvmdisk2 ~. I# y8 Y/ B$ [0 O
mount /dev/vg_centos6/lv_root /mnt/lvmdisk9 |+ B; t% g* C F9 W0 T; P
憭批!0 g5 U4 E- L6 x: T' E! g, X
( Z& v" Y1 A9 H' a
% z3 q9 `5 }) y, X# P |
|