: http://linux.vbird.org/linux_basic/0420quota.php#lvm
: ~# O x* M8 F http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk
5 C+ [! e* _2 A. o, P
% f8 w$ T, b' O& f[敶扳曉之LV摰寥]: F2 l! I2 L4 ~' H, @' `
; g) e- \2 I* S0 C1 \/ d( B
) w# k4 v/ z( [) i9 N3 A$ H1) lvextend -l 178813 /dev/11HD_vg/11HD_lv
3 i7 a8 H8 V7 X, d2 `& c2 [( Q+ m- k' s! I! @
$ [0 y, i/ n9 n, ]& g
178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB
- v+ |, x1 M, M. X3 @ r$ P
- N* W- p, Z. N' M5 A- E6 H2 T+ ^2 `3 B: B
2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv& `2 i$ i- j8 V
6 W% i/ q3 A3 J3 U0 `4 W; f7 E* P" V2 W' S, z" @
1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE# w1 ^* I {0 B0 f. F8 U
& s. b- ^2 O2 B! Y
+ m1 N% E; G: f9 w3)resize2fs /dev/11HD_vg/11HD_lv
! ?; ^: T ^! m% Q+ s# n) J! }" W) k" P. t5 d
. M. C( ~: M: Z, U+ n
P.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆
; F- v7 N% ]5 {雿輻 gdisk 脩, 3 {3 D3 S6 A1 ]: e; G
Hex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)/ Z: j) y0 }: f ~. L j
; H* A% T [" p
3 |2 J; e' b) B[蝘駁小v]/ ]8 O' I8 O' q- `( A) a# Y% l
pvscan or pvdisplay 瘥蝖祉憿舐內:* m. P! q# u e5 u- c/ L0 b
Couldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM32 y8 W* m: D6 r; W' ^- f1 p
PV Name unknown device
! R% @' v) _. Y7 C/ Z" |2 \
" G: m n! i" r$ o' m- u! U0 |望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:6 D( [7 q W( h' [' T3 Y
vgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV
+ X% H3 `9 }0 |1 O% c* |pvscan or pvdisplay 撠曹憿舐內 "unknown device"; C w0 R4 w) Z& ~7 }
+ g% |/ L: O0 k
( N& G4 v6 d' q7 L O[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]
$ ~* x3 h9 k5 m! i! n6 H1 O4 S9 I#pvscan
0 J( v% X Z0 D- Q( v6 a. ^; E PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)
. V5 y0 o/ H; J' e# j! T PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]5 R; }/ H7 l- H5 }* r
Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]# j, n' }. M- O) h+ r+ A8 U' S
/ T! |) e/ i U
#vgscan0 h7 _% Q' S3 Y" N% k
Reading all physical volumes. This may take a while...
) A2 F3 [, @. W6 N4 {# i$ C: |' f Found volume group "vg_centos6" using metadata type lvm2
7 }2 \' P. ~* Q0 i1 S6 R' Y% I2 x8 l Found volume group "vg_test" using metadata type lvm2. u8 Z% Z+ D$ ]7 e& g
0 Q& ^1 `( e8 i" E+ `
( G4 U4 L- p0 x y- r' ^9 I#lvscan
! w2 b& g- x, v inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸* {# L% w" W b& f0 F# D
inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸6 U; p; |4 M- K2 U( Z/ S& I4 V1 F
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit; Z ^6 |1 R, s" C, l9 i
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit1 _7 c: A( v, @5 Q9 ~8 Z/ ]
6 P. W* q0 ]2 Q3 t0 c3 H
9 h4 M8 L% j( H( x. G: G0 d% b
#lvdisplay /dev/vg_centos6/lv_root/ R; M1 v" [+ ?5 Y! m! x- ~6 p
--- Logical volume ---8 O' ^) G, N! R" |; ]) X
LV Path /dev/vg_centos6/lv_root
# h8 L5 ]: @6 E% \, Z! c LV Name lv_root
8 H9 }4 `$ z/ N4 R* g, `' x VG Name vg_centos6" M# k' T& I$ _" n; J% S
LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe
5 Q/ T2 i7 L5 M* g4 e LV Write Access read/write3 ?( M2 \8 i" E' j
LV Creation host, time ,
, U& f: V" F9 p0 B7 U; \ LV Status unavailable <==== 銝舐
2 l! D+ N6 Q8 N # open 1
' U, J# p0 C( X LV Size 21.84 GiB
% I% t8 u5 f2 p" O Current LE 55910 S. M! W3 H2 P- E/ C
Segments 18 a( B5 c- i. _ a8 ]$ u% B3 _
Allocation inherit
3 s: l* q6 P) d4 }8 e' { Read ahead sectors auto5 K* C1 `& {! ~& k1 D7 c& X* k% y
- currently set to 256
7 m6 H" V Z* M4 H- M# E% y8 W Block device 253:2
% Q3 F" K" { s+ [
6 i3 u9 G" Z( @& p. T5 j! ^' z* f* D; v3 d+ u. b
暺券鋆:" ]3 s7 z4 N( P* a8 G H9 u
vgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6). q; \) ]0 v; T* O
乩甈 LV:* K: ^' A0 w# N% ^
#lvscan' Y7 O1 B$ P% _3 s. E
ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭
0 u8 |( J/ k. q5 q8 ^+ j l( Q ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭
& f* O' i- V1 c$ o/ I ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
. S' G2 `1 V* r& m/ \ ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit+ B p0 A, _( \
9 x {/ E# N, `* \8 \( |4 L
- O P4 F9 W; |. V( ?9 N$ Omount LVM:9 m: b2 ]8 z$ T; a# t- f6 |/ g* S. i0 ?
mkdir /mnt/lvmdisk4 ~) }/ w* r1 ^7 U
mount /dev/vg_centos6/lv_root /mnt/lvmdisk7 K% b% N2 A# E" w9 {! e9 F. T
憭批!
) h' H# S4 S+ V1 N. Q
+ U; g5 x$ S- n3 R
7 J: Z9 m7 D! \& ^$ N, G |
|