: http://linux.vbird.org/linux_basic/0420quota.php#lvm7 x% s+ U- O8 ?* D. _
http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk# V- G* Z+ E* Z
$ X; _% @/ c& |2 F[敶扳曉之LV摰寥]/ T* G4 X% b8 ]/ j
3 W5 t! F" m$ I, O0 u( M
% J1 J; D. A% `$ H1) lvextend -l 178813 /dev/11HD_vg/11HD_lv
- ]% p5 o- M$ {# M5 Y9 v3 c3 s. D9 k( Y
6 C; f/ Z6 Y) x3 w, ?# _178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB7 o! f+ O/ E3 ?$ S! u6 z
2 [8 K7 g6 d; x9 p. c4 E4 R
7 p7 o0 s1 c4 }5 S7 s* C2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv
9 @3 |, r; L. Q8 J5 o( |& @0 ~8 O: m8 G5 ~! e; N
' X5 h& W3 Q; y
1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE0 G5 Q: k8 q ~4 X8 v
. G! R0 F) e# F( E; O1 m/ i( _) [
# z/ a: l6 u# F5 l2 |3)resize2fs /dev/11HD_vg/11HD_lv
( X/ s" @4 H" R7 A0 Y2 u( N0 O, [- l6 M; @
# X: M9 S& m o: t5 E: YP.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆
) S- j& W% x) X# ^雿輻 gdisk 脩,
0 K! l4 W( b8 eHex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager). E* r7 o$ y$ x: E0 Q% X
) R' N: n" ^% N$ W6 v) q, o
* T5 p/ Y! K& J2 w) j5 d[蝘駁小v]
+ o# D; C- G2 \6 Ppvscan or pvdisplay 瘥蝖祉憿舐內:
. m8 i& O' c: _Couldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3# I' l; p- [, G( A( d" n+ l* A/ V
PV Name unknown device
7 ]" n0 B5 A; g! B- n# V j9 X5 s1 j- A; f+ C: D
望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:
0 G) l( I" O5 y6 bvgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV
0 u0 k6 E: Y8 T3 Z8 v) ipvscan or pvdisplay 撠曹憿舐內 "unknown device"$ o {% r& |5 F5 @8 U6 t j( L: M T# M
4 }2 W7 n) p3 h' G& P c4 }
! ~; w H6 I9 [& ? | W; u" h9 h) V[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]
/ o2 ?0 m# ?2 @/ H, A#pvscan
5 W" F/ N. w$ b* U PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)
! x7 {% w3 B7 x2 m+ V% R PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]
( d9 L4 \& M5 |: i- K4 r9 @ Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]( y# M2 u. z- ^& w" z* V" ?
& o) j) J' w, A7 ~
#vgscan. L1 h4 W1 I0 K! W& ]
Reading all physical volumes. This may take a while...2 B4 U, u6 M& R) m" E' a9 ~# ~
Found volume group "vg_centos6" using metadata type lvm20 c, L5 q5 l5 l
Found volume group "vg_test" using metadata type lvm2
3 z& D$ D; X6 ~; L4 y
4 W& x+ Q3 `& l: k1 T) B1 U( P" i
/ d: [) E* r% E: P0 l#lvscan
9 ^9 [9 P; B0 a* @1 d( t1 w* B inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸2 e1 S9 `. g' I! J5 d0 z
inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸
% j) a8 ^$ F- } ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
& l3 M% ^' `4 Y" v0 U) s+ C ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
; ], z" v; o! ?- G
7 L* o( T. t, a' K B
. R) D4 t7 Y4 ~! A#lvdisplay /dev/vg_centos6/lv_root
7 v8 f6 i9 Z* q: h/ r2 I --- Logical volume --- E" Y3 p; U4 A8 N. ~9 ^
LV Path /dev/vg_centos6/lv_root
2 I, [0 M+ v- g3 z5 J% ] LV Name lv_root5 Y6 f& z. o1 Q; v; h; M$ h
VG Name vg_centos6
: f# J6 R* S( Z$ k: D: L+ s7 g LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe# _; o- m/ z; x$ q% U' x
LV Write Access read/write
& o- P& q$ d" u" z LV Creation host, time ,
. ?3 b; b; j6 v$ D( V LV Status unavailable <==== 銝舐
- |5 w+ s& @) \5 \1 b6 X8 `5 y+ z # open 1
, t9 N' Y0 z6 V: e5 b LV Size 21.84 GiB
- P4 w& p4 v! i G) t O, l7 B& R2 G Current LE 5591# n9 B' ^ Y( m
Segments 1
1 g2 s( x- L( c0 X' T# X- U! F Allocation inherit
7 _2 d) q( T, T& e t0 W& n! h* ]# q Read ahead sectors auto# N8 f( w' N2 a+ W& a, {- Z" u
- currently set to 256- h5 M* _, E' W
Block device 253:2+ z1 \0 ~0 ]! J+ i6 L; Y+ s
2 N5 H+ H' ]2 |: R' t& \) }6 ], V2 o1 ]1 H) A
暺券鋆:0 i, w7 S7 E) J5 L+ E( v
vgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)
( N7 N: B4 ~( h乩甈 LV:
- }3 ]9 p; a2 `3 S#lvscan6 h3 n( x5 R4 ^9 D' B7 i* ~- n
ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭1 Y u6 s( ^- |9 g; p/ ?4 d
ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭. W# n1 h" ~: \! G/ O
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit* F/ r' C$ g( |+ P& t, o1 h
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit i. `& Z8 V( K! N. u9 K& s
" K+ ?! Q- B: K* _# D) ^/ j( J; O8 x8 S6 _: ~' ]8 C
mount LVM:+ ^& {, ?% \1 n& g0 l0 X
mkdir /mnt/lvmdisk
% s/ M7 K+ I( j8 Kmount /dev/vg_centos6/lv_root /mnt/lvmdisk# |: ` m) ?5 |" I9 |
憭批!
6 w$ Z. {0 |( i- L* B" b' E: H( t5 p, }: x- \3 [2 T; v
8 Z; @* q& A: y; z7 h. B1 t |
|