: http://linux.vbird.org/linux_basic/0420quota.php#lvm& M$ i8 R4 D/ q6 a% i
http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk |$ w' T; m: C6 O/ x) g& |
$ V# K) H9 `- }# I0 {7 u7 \, R[敶扳曉之LV摰寥]% Q# S( B- \9 W
. k% A# f1 d; x5 P, {1 W9 V& E
| E' u0 |% Z, T# e t5 o/ T1) lvextend -l 178813 /dev/11HD_vg/11HD_lv
" |) f+ |1 B* T6 a1 w* U# \
: d5 [" ^- r8 \2 V" y& f! \' I% [8 S3 r4 L7 B: A
178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB2 n. `5 Q# i: S* y- u3 p: N
, S* r* ^ q! H% V. m
- o P8 ^8 L" O" \2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv; h3 V( s* [" w: P" f ~
$ ?: s; W M3 U: Z% g6 p7 Z2 i( X3 S! A; d4 Q/ H( A
1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE; | T$ S# D7 o& J! q6 b
. I- ~7 w8 I* M S
, u; O8 h9 v5 }' Z3)resize2fs /dev/11HD_vg/11HD_lv6 l# w9 H! i6 P# n
* c7 P; G, e. v
" P& C6 w3 V" v9 n. Z# ^ wP.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆
! E( f5 _' u7 r9 {& D( P: x雿輻 gdisk 脩, 3 w \4 g. T" V, v3 o
Hex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)
# \" \1 {0 j( K; g3 A3 R0 b' M H: C4 M- b# r* ^
, r3 A; v$ b7 ?1 p) ^# p% d[蝘駁小v]( _ F! u: k3 y7 Y0 `
pvscan or pvdisplay 瘥蝖祉憿舐內:
' \6 e9 c) o. R3 U( ~: KCouldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3
$ n- I [- d3 p& H# x; Q* i6 yPV Name unknown device( l! i* w" K. I& h& B0 L
& s2 @2 f2 J p5 d: b
望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:
`4 n5 N( [6 Uvgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV
" M0 h: K/ V& X5 f0 g- Y: cpvscan or pvdisplay 撠曹憿舐內 "unknown device"0 U& d/ e4 ]+ ]
3 d" U" y& Y4 i$ C9 @7 s! F$ p, o: w
[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]
+ b4 |6 s ~- d8 G' S2 @9 [#pvscan4 g$ m" `8 I" P# m
PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)
# [ }" ?' c3 q PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]
# D, j) J' t8 t/ B% W Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]
% b5 A+ M6 o; g3 g y
- r! ]! W" q: v" X, B1 |& c: t2 U0 W#vgscan! o2 q" a; q: A) t. d( x2 T
Reading all physical volumes. This may take a while...- |- O, e/ l0 J4 m
Found volume group "vg_centos6" using metadata type lvm26 U2 \9 Q l) b* `( `7 n* P
Found volume group "vg_test" using metadata type lvm2! u7 e0 R! m9 R* ~% a* H9 w% k/ G
6 J; m* t4 K, |6 X- d- h4 S9 y! V
3 h4 g! `) T+ X) F! B% u6 Y; T#lvscan
+ d- _9 K& ^( V" Z; P }( } inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸+ p3 @$ @5 D/ q9 ]2 _% c
inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸
5 u7 k7 p, V2 C. g# [; U# ~ ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit% s8 O( V4 H2 h) L
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit ?2 L L" n/ t( b
' X) }* M" b# P
. T( G: Q5 b) L5 }" ]#lvdisplay /dev/vg_centos6/lv_root- U9 [: h, S/ \7 n( @
--- Logical volume ---
& r. D2 V! h4 @* o* A LV Path /dev/vg_centos6/lv_root. Y; i. l# Y0 n" H- K
LV Name lv_root
$ ^+ P! @( H m+ n% W& K' z E( B3 k VG Name vg_centos6
. N) w( L7 V( Q, ^# [ LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe
+ I$ n9 Z" \7 e Z W LV Write Access read/write8 y) X+ M/ x6 z" r
LV Creation host, time ,9 F2 v/ w0 i0 c
LV Status unavailable <==== 銝舐" ?' O, e, `- k0 ~0 ?' z
# open 1
. `9 U. z+ Z8 J$ v( F) \ LV Size 21.84 GiB
4 v2 o# q: C' ?* W9 L; _2 | Current LE 5591
% l% S% B' r% `1 j3 y5 G# [ Segments 1
5 p2 `% l' j+ @" K3 ?' }" v1 x V Allocation inherit o2 {0 w. H2 I- L: ~( V9 @
Read ahead sectors auto
) I( M9 @5 P7 N" D! a - currently set to 256
4 s& e; p( c: F1 N8 Q2 \ Block device 253:2
5 Q, }4 O2 m" A: J
0 P5 I2 E5 f5 J' L
3 G: y. n$ h' ]$ X暺券鋆:. ~& n5 O5 x% o1 X4 d
vgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6): b# {8 S5 O6 j, D( P
乩甈 LV:
1 I; ~2 b0 M6 S3 L/ s0 R. C#lvscan
; G- }$ P: q- o M- ^8 S ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭8 }9 t# {$ p6 `3 a f
ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭
* j4 A, C& m7 {) r( t }$ L ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
, L% o- B3 [. y5 ]3 x `$ B ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit' H4 u/ f" n2 }$ O7 q
8 ~+ G& M8 R! h5 B1 r2 r9 [
* u" b$ q8 A$ u7 F9 X. a) cmount LVM:0 g* w8 A$ s* y7 S9 d2 b X
mkdir /mnt/lvmdisk
: m+ l) s" d2 z3 d. ~5 ^mount /dev/vg_centos6/lv_root /mnt/lvmdisk2 b5 e& u2 s9 m1 h# J X2 k! g
憭批!* M( i; c/ |3 f r% v7 j. ~% `
4 D4 D- a! v. a
0 t: N6 q5 c* h+ G; Y( {8 W. k; i |
|