: http://linux.vbird.org/linux_basic/0420quota.php#lvm! S$ K( O7 ^9 G$ C: |
http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk/ ?- M) f) r$ Y5 F$ e
8 T) Q. Q1 H- N4 {4 w6 I% U% w
[敶扳曉之LV摰寥]5 }- [4 B* K2 M) q; ?0 e
" X! ~$ r8 @+ S% o) j
' \" c; x E, S0 E' h+ j4 a! F! R7 h
1) lvextend -l 178813 /dev/11HD_vg/11HD_lv
# v5 H1 |3 D K# R* o1 k; R% \) u Z$ h( P) A, N$ ^
' d) M% o! L7 W) q
178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB
4 e8 Q. \; ~" }8 p3 H, E' s- P# B3 h7 c# p
; E$ n6 [; a- N- d- J/ l% h# x
2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv1 _5 N) V5 q5 l+ r% I0 f: t0 F
; m( g5 w6 a: I& s% j4 x
* `( O0 J: @/ F) H3 s" d& V; P7 O1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE
, o7 D' b2 q. r: Y0 }, ^: H9 O" m0 j3 X' I+ h8 v5 b
6 l5 M1 I5 c2 D3)resize2fs /dev/11HD_vg/11HD_lv/ V: S# K% ~+ K/ m
D7 p& O: H) [( T1 o) g; l
+ f! V3 z/ w( s" z1 [P.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆& L# ^; j7 Y+ c; x# Y* M0 v
雿輻 gdisk 脩, y4 q+ V5 j: n: H& Y6 m- S! h
Hex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager) E5 S: x3 I9 Y& D7 S1 y. J
# {, ~+ T5 D9 a6 U+ ?9 Z3 d5 ~% P
/ O. X2 x" u [* _
[蝘駁小v]& ~& g7 T, @) P D6 F# ?) U
pvscan or pvdisplay 瘥蝖祉憿舐內:
' S- C) R* o& J% x* BCouldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3
9 `2 S' d; r6 f! j/ h7 O- ]PV Name unknown device6 l/ V5 W2 B3 q6 b5 Y& }
+ I* t: \3 p- h' U6 z1 ~( W2 U
望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:
( D ^5 S; V! P( n+ |" |/ E. @% ^" F0 Xvgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV5 \! }/ z+ G7 H( v
pvscan or pvdisplay 撠曹憿舐內 "unknown device") v5 |' q; u) F4 Q( d
% p1 ~ _4 M( R& d$ A' t" q
) [$ @( q" p: |7 X5 ]; c. k[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition] J* A$ z y/ w" t( `
#pvscan
# l6 H$ M1 C; s7 S; l1 ]0 b PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)
& f+ b0 V0 V2 i, x9 @- d/ m9 ^ PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]
4 ^5 i& S' g: l6 q Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]
6 U! U; {! F* r. @
7 U, R4 w/ P& t5 h8 }% Z; I#vgscan( W1 \* N% L! r2 u1 O* |5 _% j6 V' o
Reading all physical volumes. This may take a while...
; L- Z3 M$ a) H5 n Found volume group "vg_centos6" using metadata type lvm2
# m* d+ o& F# Y/ y1 G! P2 u7 F: | Found volume group "vg_test" using metadata type lvm2, j% Y: n5 I& ?: |. ~
: B1 L2 O; c: }0 {8 W/ ?
$ G8 p$ i1 F& ^$ ~#lvscan6 O9 z7 \3 u# {" A
inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸
' E! p) C8 P* B1 L inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸# ^& S$ w2 J" F2 t5 j, O. m
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
0 N& D& A: o9 r5 R, J/ B ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
8 t. {) U& ?) [( N' I
% w3 y2 J% Z O+ D% @% ^: e* A1 j% k& u# A7 ]
#lvdisplay /dev/vg_centos6/lv_root( J# C/ M$ T7 l) Y N+ b
--- Logical volume ---# b# Z4 D0 Q: ^7 `8 A
LV Path /dev/vg_centos6/lv_root
9 ~8 U H0 s% U LV Name lv_root
' `/ N2 w! ~9 z, H, n- O8 R VG Name vg_centos68 `6 S& C' C" M, T' P
LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe1 \' C& I, n% n0 y: c
LV Write Access read/write
5 M" C5 v/ @2 _& V LV Creation host, time ,
. y4 p9 I9 Q/ ]2 ^' ~% J! ~ c" } LV Status unavailable <==== 銝舐" A& { l( H6 b) ^ E4 O
# open 1
6 y5 b# A3 O5 `+ J* h9 Z, i LV Size 21.84 GiB$ j/ M' O: S" d
Current LE 55910 H3 K8 x J% ]& t/ W5 w
Segments 1
9 c; d8 T. F8 D/ R1 { Allocation inherit* Q: K1 }% L# [, e
Read ahead sectors auto
4 r5 }( \; m* X, Q2 O - currently set to 256- C- X% @0 a% z
Block device 253:2$ G+ T3 I6 _$ s0 X3 Z& }* r' U
! G9 R1 d# L7 h
% `' M+ B8 ~! k9 y% H2 u' L
暺券鋆:% F- Y) i$ s$ o
vgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)
1 l+ r) |3 r; S% z7 b乩甈 LV:1 t" {! q1 c$ p+ f/ g
#lvscan O" F+ Q5 a+ R. R% m U+ f% O
ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭
+ Q W3 r% g m7 q V ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭
5 h. J# v) l: V, g5 M0 g% j0 ` ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
: {) @1 R3 ?" T3 K# V ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit2 U L: C6 a) ]
5 R, f7 L( {% T3 s, w5 K2 T& o
1 u+ G. u: X- W! L) h) t F7 Kmount LVM:
0 }* v/ E# r0 e2 |. u# X6 mmkdir /mnt/lvmdisk
0 f5 O- @$ M9 B0 b/ c9 Wmount /dev/vg_centos6/lv_root /mnt/lvmdisk
3 B1 }7 g3 U" }0 b5 t7 E& K憭批!6 r. c6 o3 s0 u4 F9 [# B( Z
" s0 u! m6 S$ {8 z2 s$ A
/ r& x* S. T1 }' V) J7 z |
|