: http://linux.vbird.org/linux_basic/0420quota.php#lvm4 S& C5 {& f2 K T
http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk
" t8 c( n. M5 x% f& W
; Q, |) F% ]( r; M& O[敶扳曉之LV摰寥], s5 i, Z: ~% R) i4 Z' ?+ e- {
& J3 L2 e7 O, Z, E
/ U' O& a# G$ U* C
1) lvextend -l 178813 /dev/11HD_vg/11HD_lv + v- A! T! R9 y2 `; \& S
& Y" j+ T; t6 f1 U' m
% q+ @3 w& P) T4 _4 k178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB
2 w9 ?# u; G. Y! |& W. d1 [& U$ o5 R+ |. \+ X X
) g& z- K+ w1 R" N' S. ^& w$ [2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv( ?- Z' A( \2 K8 Z
0 r; _. h6 h! W8 y4 [- G
& t1 ~3 w8 ^' m$ Y/ q( Q9 J8 g
1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE, [9 k# l% d5 m
7 k2 S$ o6 X! l
' ]* l5 r6 e; ]6 r- T9 D3)resize2fs /dev/11HD_vg/11HD_lv
; l" x1 v2 C# a$ ^) X' G& N, R
3 _. A8 N( t# U7 @$ {7 G1 r) O
2 X: S: r# O" WP.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆
; a( @* a6 n1 u6 i4 w雿輻 gdisk 脩, * }! D& O5 H1 s! c0 F' ?
Hex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)
$ P' b, R7 m- R l3 W3 ?2 | l' Y: r% L
3 C- Q: w# ~% i% i8 C& O! L[蝘駁小v]# c% A- i+ Q X9 y& e1 | _: l* q/ {
pvscan or pvdisplay 瘥蝖祉憿舐內:
6 E7 L4 H8 q/ {* i' ACouldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM34 Y$ v: W$ I: [. C1 _$ g
PV Name unknown device( r- w5 _8 }4 Y. W1 [) r
4 ]; a& S3 i% U+ x$ |: ?- P/ A
望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:. S' R v, V; Z5 E( j
vgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV( A' Q0 t) ]% ]* s2 H7 R( @
pvscan or pvdisplay 撠曹憿舐內 "unknown device"' N+ S% d5 X7 ~9 S5 c: t
# _4 t+ f% m4 a. L
2 F( _& s7 o+ Q$ Q! g2 O[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]
2 R- v+ U9 k4 z( A#pvscan, S; d3 \9 B- j& L
PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉). z7 Q6 k- L# Q! Y
PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]
6 `0 u$ u A" W& ^* e4 c0 j Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]8 [5 C* x X; I( ~! z
0 x/ N9 `$ b) q& }#vgscan
# w1 F( Q% Y |2 Z* ^) J* ~ Reading all physical volumes. This may take a while...( Z' b$ L$ Y/ r" ^
Found volume group "vg_centos6" using metadata type lvm2
+ H, B6 _2 l6 z! [1 Y& ~) j7 \ Found volume group "vg_test" using metadata type lvm2
5 Z; b5 _5 a" |3 h1 d/ y
- a2 y. y0 p, i$ [0 t& ^
+ F, k! K4 @2 x4 z# W#lvscan
& H: A) q+ j G2 U4 I: D% @; J inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸9 r) F5 c! _; U9 ]; D/ f5 l
inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸' _+ G2 H N: w: [7 n
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
1 z. u4 \1 `, }: {7 A& m ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit) \8 \2 n$ {6 K) M2 a r
' a" s7 d# {1 C0 j! s& U) o
' |( Z _/ Y3 i& w
#lvdisplay /dev/vg_centos6/lv_root+ g3 }) b) N, P f2 ?! q* `
--- Logical volume ---0 ]! d: A) a# X4 ]! B% u
LV Path /dev/vg_centos6/lv_root
" n0 `/ H- ^/ i2 p y, R4 i LV Name lv_root, [2 ]2 |* H8 [( a: J6 K/ u
VG Name vg_centos6
2 a; |8 p1 ^& Y$ r' `! K LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe7 m7 z! B- P9 ^4 o# O, G
LV Write Access read/write2 w" N n+ T) z$ ^
LV Creation host, time ,; h. U5 N1 u9 p( i' O/ C. Q
LV Status unavailable <==== 銝舐" }4 T( X, v0 s) a8 U! J8 d
# open 1
* i0 g' C$ p! q) i/ K LV Size 21.84 GiB
9 k$ P( O- f2 B0 b5 h8 l* F' c3 v$ c( n Current LE 5591
" i' A) U, F: r. A* x. C+ x Segments 1
) N' e1 y+ [) t) b Allocation inherit7 m" c4 Z! y7 e* s' v1 y
Read ahead sectors auto9 B3 x. a- o7 i3 A" `" y+ j8 n
- currently set to 256( J( H7 S/ ^5 Z# Y
Block device 253:2) `% }) f3 z5 E( P
% \" i3 R6 D7 S2 U7 x
2 v2 |' O0 e, [* w& i5 M! }暺券鋆:7 ~8 Y( M- C% g/ i' P# N; U
vgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)9 ]2 w0 p" Q" A1 ~3 f/ q1 c4 j
乩甈 LV:- R& e, G+ w7 t$ O$ K, Q7 y5 e
#lvscan& f9 m9 Z8 v( k) V2 W
ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭
; I# x: `9 g- y9 @2 L7 h; o8 b( f ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭2 e6 T4 F3 c! S# ~6 F/ k3 t6 a
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit% ]0 K5 a- x8 N4 \4 J3 `0 z" Y2 O
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
" u/ \/ }& j& J. n) a" }+ X3 F+ g' N! Z: X: \
5 W) T7 Z7 P# T1 E$ g: Y
mount LVM:# |" y8 r* t% m$ R2 d4 t) [& l! A# Q
mkdir /mnt/lvmdisk. E" ^5 Q: b3 c( E E$ }1 \- p
mount /dev/vg_centos6/lv_root /mnt/lvmdisk# R& d0 G. A; J7 c8 h
憭批!- b0 G1 I j7 p- d" w
1 M6 O. T1 T2 ~$ O# G* L: x* N7 R, k( c% J
|
|