: http://linux.vbird.org/linux_basic/0420quota.php#lvm" ?- q) P5 v2 u8 c# L
http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk) f9 [& c+ q9 z- H3 X. N: q8 ~
, k! d J" K3 Q7 m[敶扳曉之LV摰寥]5 v3 l; M4 ]9 l! Y0 S& p
/ `1 K. b! g7 F8 }0 R' F4 Z& w; k$ t5 V
1) lvextend -l 178813 /dev/11HD_vg/11HD_lv " p/ w1 U- W, {* |
5 U6 ?7 M1 l) [. ]# J; J' B
% \ M* H& M( u4 p' h178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB
. `* O5 ?# e. q$ K" S# e: }; y) t; G
N Z5 C( W2 R2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv9 d W2 ?* j; F, t7 P& ~
' r- q+ \" t; p5 x6 R- @4 L/ B1 n
2 U) M7 ^, ^4 V% n' U1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE: h: W n8 E. I0 a! }6 Y+ v- ?2 P
0 E! T& E, K; C& {! h3 z$ D; t: T2 J. v2 W5 N u3 k8 C
3)resize2fs /dev/11HD_vg/11HD_lv
: F8 D- B0 M* ~( a2 R% B" E* o0 T2 {, l/ r4 ?4 S& r- u
. K0 _' F) P& I) _5 @1 }. SP.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆
7 \9 L# j3 q& u雿輻 gdisk 脩, 1 Z1 |- k) I* N; ~
Hex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager). }) t* {0 s" S! s8 B
( |, q/ s& A; O, R5 N# U! K: y) A; i! R! k5 s! _) O
[蝘駁小v]4 c2 L) | F$ B- Q: k3 \
pvscan or pvdisplay 瘥蝖祉憿舐內:1 z$ C( ]0 _- J
Couldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3
0 M% v# b+ W* k! cPV Name unknown device
; |. m# I7 |3 k+ L# E
/ p3 Y6 b& R$ ]+ w% C. M望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:
, A8 D: L) h% ]& B% Jvgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV1 T7 {9 t( y5 c
pvscan or pvdisplay 撠曹憿舐內 "unknown device"" F6 Z# U0 T8 E0 R8 H
: j8 A3 f* w; g. e6 T# B
3 Q2 w2 j! ^& v S[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]% ?1 x$ p' y3 f* a* U! p
#pvscan5 V% m2 M# ^" ?, I: O
PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)# a& ~0 a/ p# W2 {" N- T
PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]
# w$ O; e8 d! P6 V% m Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]9 J; {- W- J% t4 U
8 x# B- b% N5 J4 z Y8 Q
#vgscan
" N- X# V/ e8 X2 P Reading all physical volumes. This may take a while...4 A. ?7 I$ p3 R0 L/ P
Found volume group "vg_centos6" using metadata type lvm20 b/ K# L h) A
Found volume group "vg_test" using metadata type lvm28 F: u# F/ I% t; {) r3 z0 c* W5 o
4 b! Z! g5 ]" n6 D- f: V
O! E4 F' A8 l6 I3 D& P#lvscan, |; b8 D" F9 M, D# r1 l6 K3 y
inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸" F3 B& N8 m9 X' z
inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸0 p8 [* ?* g+ R
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit8 }# b: U7 W V/ Y
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
& L7 ` A. X/ G% G/ p1 {: h
; ]6 Y4 x: O% W+ _) W) b) v3 `/ l) x9 E9 B$ D# N9 c3 `. U
#lvdisplay /dev/vg_centos6/lv_root
- S; C$ t; s9 E- D+ j --- Logical volume ---+ z6 m; U* n, G& C" }
LV Path /dev/vg_centos6/lv_root( d- B6 h2 |4 m9 S
LV Name lv_root' V* d; A2 `* e* i
VG Name vg_centos6
) K: q7 ?" A7 c' T A; ?) i7 S6 F LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe
3 X: G# T0 N3 H LV Write Access read/write# u( f* e; j- y( v
LV Creation host, time ,
. e8 t& \1 {, \0 W4 O' R4 [' H LV Status unavailable <==== 銝舐) `5 P& u3 N' [8 ~" x- G
# open 11 A6 h2 E/ c3 e! z
LV Size 21.84 GiB$ p" q& ` Z9 f3 U
Current LE 5591, q$ |( }- ]* Y8 v
Segments 1- y" ]+ t8 R5 Y
Allocation inherit# g |% @. i5 T+ L% ^
Read ahead sectors auto
1 a4 X) k; }0 S, Z0 P6 z' l9 L - currently set to 256
' @8 g& e- V5 y4 B* m( `6 Z Block device 253:2 Q2 i: i4 l. z
' L9 F9 T' c9 d$ [6 r( i7 K9 f( D( f* b, U3 V Q( ]# i7 H
暺券鋆:6 M6 z* Q, a' g: d1 v9 ]% n
vgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6), L$ z9 n* p; Y9 _# }
乩甈 LV:
) G: g1 m0 ~) s! D$ r#lvscan
2 }+ S5 ~6 ^8 W2 i: e/ g ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭) m+ h6 i/ k) O
ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭2 J8 H) N9 ]" s+ V& z% {8 \
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
+ }2 d$ Z6 {0 A; G- L- c8 g# {# ^* b; k1 R ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit" v; f8 s; f: M* J" Z; J
* V' I4 f [9 a: y0 E, l
) {, E6 g+ q4 Q; ?# S) I qmount LVM:
9 ]4 B% H3 X1 Ymkdir /mnt/lvmdisk
( h/ E/ ~9 S1 @9 V, Nmount /dev/vg_centos6/lv_root /mnt/lvmdisk
0 h# B' |$ O" H' q憭批!* ?1 ]$ q" U. l& L2 e: v" G
r" t$ O* P9 g" H
' x2 F: d1 o( P, \! }
|
|