: http://linux.vbird.org/linux_basic/0420quota.php#lvm1 a. O: X$ y$ S$ O4 F3 a' v+ c
http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk0 _8 j* ~% L+ z8 z9 L+ n& f; S
3 ^. X6 I) v2 R$ H7 _4 K1 o[敶扳曉之LV摰寥]6 R* o: F( q. Q, Q/ [" `3 O8 y$ s) s
) J3 G% p& b6 D: k
; D- N1 p) d2 K7 p1) lvextend -l 178813 /dev/11HD_vg/11HD_lv
# j" A: u+ I) a4 X9 u
# f& W4 t2 o2 a5 Q; H
( L$ {. C! A) t, I9 o* B178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB
- M! i! ~ b) A- J/ |1 S2 A7 H6 V
% c" f' [: `7 ?4 P: s3 j$ W/ w( W
( c- n* ?" a7 J+ g2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv
6 E2 t% `% L" d; ~9 Y Q5 i. w, X
2 `; T- v- } e) U$ \- Z3 F
1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE
& E: M {8 c! X6 D' S0 d. `" Y* z* z! D5 g# C2 B
2 \" E1 T* x/ R- g2 i3)resize2fs /dev/11HD_vg/11HD_lv8 {6 x6 P2 x* Q; o
1 v1 Z1 W$ p L) B& f" @" L8 B0 k) Y
# x9 }7 m6 A4 p& gP.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆. \2 ^& ]9 P/ @1 u1 V& m
雿輻 gdisk 脩,
9 c8 I3 h' H" f. L( Y+ e* OHex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)
0 C. m0 p+ ?; R+ m Y) i
: m$ U, e2 {) }% f3 V H1 t$ }; ?+ J/ Y8 T. Y; S t; [
[蝘駁小v] Z! e6 U' m9 K9 {7 G
pvscan or pvdisplay 瘥蝖祉憿舐內:
4 {( h- F6 { o! o4 g+ ^Couldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3
5 Q; _3 Y. ]4 xPV Name unknown device, _5 V9 c+ t; q
% V- d; W9 ^3 f( D* U& P
望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:
, R1 i" \- i7 ^/ J+ f: A4 vvgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV
9 f% @0 }7 n. j& k, X4 w6 t7 x% Gpvscan or pvdisplay 撠曹憿舐內 "unknown device"
: {8 {! C7 E& n% e% ]# [9 p: I& R
1 q2 B/ n) K7 k. r$ c! r* L3 G) o
0 {5 m5 \" j- s- t[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]
- E8 E4 Z \3 X' y#pvscan( H" s) i' y/ @8 J
PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)
9 M& R8 a6 [2 N6 w' H& Z- P PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]: Z+ @, p' H, S0 j) w
Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]3 S% m4 c9 v" N4 k- T+ w7 ^; E
" l1 y3 y' n$ m4 c% S& u0 _#vgscan! v) ]* v, E* a# W4 {
Reading all physical volumes. This may take a while...0 e, V% @/ B7 {7 \; v3 C2 u6 [
Found volume group "vg_centos6" using metadata type lvm2
) y; N2 ~2 x4 d: q8 @3 z Found volume group "vg_test" using metadata type lvm2- v5 g, s4 ~# G; o1 ?" O
! t. j8 W7 {/ a' X& o o
/ g' s" O9 r+ H0 L#lvscan, |% E& e, l( }1 w# a
inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸( K* N9 v0 e( C
inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸2 R8 u3 t* k: p4 l; ]9 J& ], u
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
' E& s' K4 \* f, l, o ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
- S& m! j4 I) Q2 f0 j: p( s/ l+ P' x9 P% d' `
3 f8 ^0 G4 R R% e" }( v" J; w% ?3 f1 e1 O( }#lvdisplay /dev/vg_centos6/lv_root
0 J& T! D" p: J0 X( @ --- Logical volume ---
* v7 Z: B7 V; _! s8 C( d0 [' y LV Path /dev/vg_centos6/lv_root
4 o, X' I( P. ]7 L1 t W: R: _3 w LV Name lv_root
+ c" K7 W9 l& W3 Z0 d VG Name vg_centos6
+ T; A ]( i% f- D8 _' V LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe
! A+ D2 R2 x. `; ~. G! K' l( r LV Write Access read/write
, z3 s( G9 f2 ?0 Z/ R. @ LV Creation host, time ,
+ F" Z e- o; Z+ {, ^% H LV Status unavailable <==== 銝舐4 ^4 m& d- U8 j9 g+ f3 _
# open 1
; l9 A h& ?4 M& Q# J7 z ?4 y LV Size 21.84 GiB
. |; Y3 @" H: e u* O i Current LE 5591
) v+ u1 b- J5 c$ ? Segments 1
/ Q) K- }+ \: x4 Z6 t Allocation inherit
( ^. U/ e/ b$ l+ I" r8 x! ]5 N2 | Read ahead sectors auto9 O" t% y( @, K! P
- currently set to 2568 V& z5 q- v. k4 ]
Block device 253:2
b% ^$ J- |+ y2 W8 c
6 E. Q) ^% L2 t- s6 G |2 r6 o
, G% \5 [) J' A2 ^/ I暺券鋆:
: I: j9 l( s6 e+ `' z! A, uvgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)0 I& K. f1 T3 Y b( |, Q
乩甈 LV:, b y! o) m) A' V6 B* G# K! e
#lvscan% {+ d B: w2 c8 g- Q
ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭7 W5 D _/ O5 p9 H _
ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭
: ~1 n3 T* m/ P1 v2 x v ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit! E1 b8 o1 j$ X7 k; X( x
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
9 ^2 A- x' ` `' L, g' {
$ T: e# M6 S/ S- c* K& w7 O+ B2 v/ {! ]( ]: J
mount LVM:
" G, s2 Q. Q; n8 ` @' X& W# ~. w2 y) Kmkdir /mnt/lvmdisk( `) V- C5 L) ?2 X# n- g4 a$ a
mount /dev/vg_centos6/lv_root /mnt/lvmdisk, ]6 s! U, M- u9 y
憭批!
- P- z, }8 l; t& @
, U# \7 P5 k/ }# L' V$ z t+ |! w; Y) L2 c% `( i
|
|