: http://linux.vbird.org/linux_basic/0420quota.php#lvm
8 ]7 W( g5 [) X5 w4 ]0 ~# ~ http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk8 d2 f% P6 r% f/ Y B
6 }1 S7 A7 K( k* j1 O
[敶扳曉之LV摰寥]
+ x# H7 |& W! \, M, u6 M0 W5 n! o" }
' J' v0 T. b1 Q1 ~% l
1) lvextend -l 178813 /dev/11HD_vg/11HD_lv # S! I# _! ^' I& j0 J4 l
+ C* ]% u# v4 E
- ^4 _& i& Y7 L/ r
178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB3 ?$ `: y+ e1 i: ]
0 M# n& ^5 Y% r+ Y" u |/ q. z
# {# D5 `8 P& O. I( Z" T2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv9 M- M6 Y2 _- w$ s: L- s f
$ r1 P: {( _1 R% u' I8 s$ k
) A2 T% I- O% o) U) N! l& a1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE
! O* k% \5 M; o2 g+ V/ l; ^* u7 z& M9 {
" h9 K+ J0 u6 I) e- ]. r3)resize2fs /dev/11HD_vg/11HD_lv
, f; F2 d, ?, x* a
) A+ v$ s2 R: O; |1 i$ B B
) A6 r5 R+ r( X% ^8 lP.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆+ q% [+ V& N& w) Z# C0 ~
雿輻 gdisk 脩,
( Y7 k- R! z. e' S5 ]7 oHex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)4 U0 E+ \+ v U
" M. } j: U, v6 h( p
8 E; _, k$ C1 b4 L0 i2 N[蝘駁小v]+ l3 `, X4 f# ~! V' X
pvscan or pvdisplay 瘥蝖祉憿舐內:
' P% t I# D$ qCouldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3
! W4 l: }' i9 G f9 P; Q$ p9 IPV Name unknown device
4 h+ K0 [/ [* n: t" q
' T4 B; X- f2 ?1 l4 z% q望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:2 p- b3 e- p4 `* `
vgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV
& z8 |# Y2 F9 {9 zpvscan or pvdisplay 撠曹憿舐內 "unknown device" e6 ~+ g$ }; r$ W1 S, a. L; n' m
0 {7 P5 _9 W$ q K" k; B: v+ x
. Y+ D6 m' j1 V[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]
6 f' R( d0 c- w#pvscan; j+ {/ P3 i: Z: F. h2 y. K
PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)1 [* ?: t5 U- _, [9 L6 x
PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]- E+ g) W& b, y/ g* M, U5 q
Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]
4 k9 s& A' p: A" I* H8 K6 {$ y z) W6 c: A+ Q0 J# j6 M% G
#vgscan( _ z4 R! _; t$ `" _' [8 [) J! R
Reading all physical volumes. This may take a while...
# j/ ?; J5 x: \: P% t Found volume group "vg_centos6" using metadata type lvm2* Z; j" T9 s7 a9 S
Found volume group "vg_test" using metadata type lvm2
: |5 r! Y) P% X' T7 r9 _0 ~& k0 |5 I$ c6 y
F+ B2 b1 M& m9 P#lvscan/ R% n+ i- p* q0 f* n; k
inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸 u i& l. @ o# h" ?- o6 l+ A' _" x
inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸5 `+ R8 Q& j& F& p/ Q: W
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
% }1 v0 E5 F( c' y m ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
! P( p. v/ Q+ w ], P4 N6 S9 {" g3 y4 h9 y
9 G$ I0 W. u) s! i* J3 e" y#lvdisplay /dev/vg_centos6/lv_root
- H$ m0 \* }/ w9 Y% N8 W --- Logical volume ---
9 ?5 f6 n/ C$ i* p: T/ f LV Path /dev/vg_centos6/lv_root1 E- d6 S# P h$ o* j2 B
LV Name lv_root
0 o3 u2 z3 n% `0 M) f6 ? VG Name vg_centos6) W9 F# C0 [3 ?. v$ w+ J
LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe7 z O: D0 W7 Y q( ^2 Y4 T
LV Write Access read/write# X1 Z# z0 w- ]6 H
LV Creation host, time ,/ J; Y4 I* W& e: t' x
LV Status unavailable <==== 銝舐" e1 A; M3 d, ?% d
# open 1+ Q/ [/ \. k6 H9 c, r& \9 B* `! t
LV Size 21.84 GiB
4 }+ H" Y% B3 a" g' t Current LE 5591
$ Q! v! b, q# @% d: c Segments 1
3 s) z+ }8 u# U3 M+ R3 }; i! P8 { Allocation inherit
1 @/ h8 }+ ~# i4 W, L Read ahead sectors auto
1 }, u' C4 R- M6 x - currently set to 256
9 ?7 R0 P6 r1 P1 [- q: D Block device 253:2$ K. K$ v+ r( S9 H% h5 h
5 w/ z* e2 t H
" Z. w! k5 u/ S3 ~9 G$ ]暺券鋆:
* |9 t6 ?# ?* u5 Cvgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)
+ y0 ]3 ^7 |' X% S! y) C8 F0 I乩甈 LV:
% X. ?. p' N' y: L0 e- e2 P#lvscan
, l6 y" @. d- U ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭
% e# ~5 C ?, `8 X- t ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭8 t9 G0 N8 Z7 _( a$ ]
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
, q- }7 L0 _( {7 w ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
3 d3 o9 S, F4 l+ K0 q9 m
5 S7 z/ o) i, G7 ~: ^ M8 q
$ N- T' D$ D/ n F" @. } w& mmount LVM: u* H, q1 V! C- M
mkdir /mnt/lvmdisk
3 Y1 ?' N3 W# M( h6 k. P# [mount /dev/vg_centos6/lv_root /mnt/lvmdisk
) }7 \+ v Z+ C3 [憭批!. _2 j1 V( y; X( q7 t
# }; Y% j/ S% F- O& e1 c
' J4 s7 V3 p( i' D: I |
|