: http://linux.vbird.org/linux_basic/0420quota.php#lvm$ I5 P$ I7 C k* ^
http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk4 t6 N0 d+ K4 S
) X! Z% e1 f, y[敶扳曉之LV摰寥] S& f. X7 C) C, }. r$ f+ ]( P! \/ A
3 h; M! S! G% ?* n' O4 J) u8 i7 u' i
/ |- u, Q0 q/ m% \3 k4 |
1) lvextend -l 178813 /dev/11HD_vg/11HD_lv 2 d. ]8 k% ~ B) f! \5 x
# l1 w! H4 u# o" X! ~1 Q' d9 h- @, R$ `
178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB" d8 Z+ Q3 d' x1 K' {9 S8 }* [1 X
6 |! `9 G7 [3 Y: m5 }
& m; z: j0 z: u7 F7 d; p3 W5 j& ?6 U6 e( M
2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv. r' h! V* R H! c8 m
' h) q7 b1 B" @+ p* M% S
+ `; ]$ t* ]2 F1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE% [+ r" o- s# Q
. C; s, p b% h* r
- Y) g. A& A! s9 Y
3)resize2fs /dev/11HD_vg/11HD_lv
2 R4 O) J* l% n* w/ `/ Y6 E3 k" ~0 M3 Q' F
+ D# c& A+ F, ~9 L" g
P.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆
, z; j% X3 d8 q/ s雿輻 gdisk 脩,
9 v$ B% H# v# y3 S% r! aHex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)8 ^! ^! q% q. w4 s( s$ B, z
7 x6 I7 I5 C7 y2 F t. T" W# v) n7 m: D
[蝘駁小v]
( \* e' C3 |# E1 p5 W( C" \* Fpvscan or pvdisplay 瘥蝖祉憿舐內:9 l; o+ H5 [0 _1 Z
Couldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3
" G* l4 @7 s8 h0 t" ePV Name unknown device
+ U# Q8 Z) T$ d
. \8 O5 V" S% _% B" `/ Y: Q望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:2 k% b9 Z% _# b/ k+ v7 L' t
vgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV9 ^% p, T1 x- V+ o) q6 e
pvscan or pvdisplay 撠曹憿舐內 "unknown device"9 a: ^4 M. _0 T9 R
+ p) ^! P4 M6 v+ H( a* \
( s' I5 b1 l6 b/ B[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]2 ~5 }$ v, A$ A0 r8 ?9 w
#pvscan- U- t6 L8 W: ]/ y5 p1 Q7 m# `, R
PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)
$ r# i- b" x& ?. r PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]
8 [" k1 m6 U3 z& h6 I2 c. n! L Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]
& k- s# d: ^. z+ w) d4 B& o
* ~2 V) l/ F# e! I9 D, Z#vgscan( u" G. D/ B* n) B
Reading all physical volumes. This may take a while...
/ f y9 i+ Z' C# A' S5 P Found volume group "vg_centos6" using metadata type lvm2
. r4 `0 _5 s w, A% Q Found volume group "vg_test" using metadata type lvm2
- S$ j- p& E5 X7 Z+ }9 M1 O9 P* S! k m
4 A' P. m2 ~& @) l6 {#lvscan5 `! r# e: L% n" B3 N. R/ M, Y' f
inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸# h* _% d* u8 |& H6 N7 i
inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸
, j# K6 y- b% R+ [: v2 c ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
6 l$ j2 K' f) L; K# K ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
0 y) C: U* J, ?# P1 g% L2 b5 {
* ^5 { b7 D. [
p8 ^) u+ W) m3 h; s! w#lvdisplay /dev/vg_centos6/lv_root7 F8 D ~5 o3 t5 d
--- Logical volume ---
/ V! w8 X/ U+ [0 [( ] LV Path /dev/vg_centos6/lv_root8 y& b) p3 ]7 N0 `
LV Name lv_root5 G% B: ?3 c1 e% ]- d
VG Name vg_centos6$ y# e; ]# n7 r0 L. T, H( w N3 T) u
LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe1 r% o" L# T" G9 H8 q8 @2 [
LV Write Access read/write
% h& Q" V l2 K3 z# e LV Creation host, time ,
* t6 M' j9 O8 Y. E3 K LV Status unavailable <==== 銝舐
9 X e' R" H- _ i b9 E. \" P# s # open 1( l. p/ A C% K% O+ c- L
LV Size 21.84 GiB: q( r8 C9 D# b; M) r1 V
Current LE 5591' M1 i( p1 H' T% B" [
Segments 1
! ~. i2 f2 [- S; r7 `" ~ Allocation inherit
9 ]" o# V* `- c4 X9 m9 x Read ahead sectors auto# l5 s2 r* U; \% q; N% W$ }
- currently set to 256+ |2 i1 d" K/ j' N6 w8 r' A, Z
Block device 253:2' Y* N1 O* u2 `+ x7 V4 M; P; E
! h( u, E. }3 U
( a. E3 X6 A; }
暺券鋆:
: V4 ]. u9 y) e+ h' w; q0 W. a& Rvgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)2 `8 L! X! m/ O7 D+ m# J5 N5 c
乩甈 LV:
' _; m# h8 `4 ^- w#lvscan- {; u7 ]- H3 A4 j( G+ d- I, ^
ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭
5 T% f% G+ X( |4 S- ]" E( \$ B ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭
- r% q% `, D6 h6 a% Y6 d, h ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit5 z8 }8 R% X/ K: l, x
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit0 h: @* h# b" g6 E5 n
) {0 I# h* D; I+ M
+ j+ ]3 f# S5 L" a ^0 k
mount LVM:* c8 E3 h: }, X' S9 ], t
mkdir /mnt/lvmdisk+ B% Y" }8 {0 Z4 z
mount /dev/vg_centos6/lv_root /mnt/lvmdisk4 z1 c2 e; w: W: H
憭批!
8 Q: L( B! V" H# |9 @5 n4 N; U m6 O$ D/ Y6 ]/ y
# a/ }( h' }7 L7 _9 w# G |
|