: http://linux.vbird.org/linux_basic/0420quota.php#lvm
5 q) W: k' W9 G7 T% m9 M: {+ x http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk) d: [, O% L x Y9 Z! {
& H$ P- N# ]# i6 I$ u; c
[敶扳曉之LV摰寥]
' @' ~. w0 V8 e6 U6 X6 j% Y: L) O: Q
8 C$ n( o3 v. q5 ]$ o6 z7 _9 d) ~8 M' U- ?
1) lvextend -l 178813 /dev/11HD_vg/11HD_lv
% w! I6 |5 L. d1 ]! B: f
9 k% [3 N9 j' j5 B: V) e6 b& \0 j
178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB! n/ D& x& M: V4 n4 t
+ ]6 ]1 b! E4 F3 D$ V. j7 |( d
2 S$ m9 f. B, w" U4 l2 \$ [
2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv: r9 [7 L) M9 \4 @1 f. L/ o
* I# L% ]0 m T1 i4 E: O% W
( P) N+ d! {1 O; b* o1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE8 s: T) W4 Y7 J F* \( l# j. t' Q+ [
( y/ B) ~0 R9 ^5 t" [
# ~' p4 L" ^$ ?. W7 r
3)resize2fs /dev/11HD_vg/11HD_lv
5 ^$ g, `: t* x9 i+ o; Q4 c0 r$ c4 Q5 a! V2 m% H' ]
, @# d' R; N, R( ^P.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆
4 N, i0 J, y' _8 p: l) o雿輻 gdisk 脩,
# E+ \6 r7 q3 E YHex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)
. t# Y& C, T0 a2 J$ V) @0 q, }& G
4 ]4 ^& ^' d5 N) N, F) ^
[蝘駁小v]; P( L/ o( U2 c: b9 o' U
pvscan or pvdisplay 瘥蝖祉憿舐內:( \& w$ K! A# k
Couldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM31 _* x% h$ h2 E% q9 k0 `4 T
PV Name unknown device
F, u# E; \5 U: T+ B Z: v9 k W: f# p$ n: `
望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:% i1 {& \# K4 L+ g
vgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV
: b. a/ N. b2 ppvscan or pvdisplay 撠曹憿舐內 "unknown device"
4 w, ~, D& U0 K6 G0 G" z1 a: X8 l0 O/ U( X5 M3 [
* _2 o; m0 ~7 _! R9 D K2 L' z2 a[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]
$ _& \, ?1 k5 P6 N( h#pvscan% E7 q" d T0 R1 W0 o% C! F
PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)& X! Y, L. J' s. }4 D* h/ m
PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]
% Z/ V# ]1 S3 k V Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]' c: I* ^* f0 `+ i2 Y% s
0 h$ V& o5 O+ e; z#vgscan! U# q6 _1 i! g& b' S Y7 A, v3 z
Reading all physical volumes. This may take a while...* \/ m# I0 {; i( _" D
Found volume group "vg_centos6" using metadata type lvm2/ M) e, R' }3 T+ b n
Found volume group "vg_test" using metadata type lvm2& W {" o T0 G. l+ F* W
, V# T6 m* t% X& p' O7 Z1 y
& y1 O3 L* l' L: @3 ]$ B; F- V4 S- Q#lvscan# ^( n! P/ P. s. T- Q4 r
inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸0 ^( Y$ B2 o7 d. E
inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸
9 N* ~+ Y1 U" g4 Y ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit2 r( z4 y6 P' C- X6 ^, X# E
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
3 x: n9 x0 n8 n, W9 H! U# p0 i5 ]$ M J# P3 J
9 V4 i3 [' z9 T$ u# V/ R1 I" h( Y#lvdisplay /dev/vg_centos6/lv_root
. Y# o" y& G# |; n# A4 L# f --- Logical volume ---
; Z& L5 y7 U& n LV Path /dev/vg_centos6/lv_root7 e* @5 V4 b J9 q" t6 F7 h
LV Name lv_root
8 M9 ?2 [- g7 M: N" B7 e" V VG Name vg_centos6
u: L; S& _1 a LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe
- q3 [' ]; B8 F3 |2 B+ s LV Write Access read/write$ A& J3 `# n, O5 g, o8 i- M( t; X8 n8 I
LV Creation host, time ,! N2 F p3 d* `; s/ l. A& ?$ c% b! V
LV Status unavailable <==== 銝舐
) k1 P, u4 u. ` H7 F # open 1( U, Q5 h f* w; J3 J
LV Size 21.84 GiB& g% P; Z7 l1 k' g' Z
Current LE 5591" Z, a. b' W- U+ ^+ K
Segments 1
e. ?7 s% F+ E, n Allocation inherit
. ?0 ~: D+ w6 P8 e4 B# h Read ahead sectors auto
& F9 G- G$ ]4 o, B5 B* q - currently set to 256
7 t, H' L1 j# E: h$ M3 e Block device 253:29 H `! a% D5 q# M: K* l; v
4 A6 ~9 b9 J3 U$ N# I9 F/ e
- E# E% u7 I- K* r暺券鋆:4 N' h; I8 ^+ y" e' \" w) Z$ O
vgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)4 u1 Y8 H* a% K+ a* T: V$ X8 p
乩甈 LV:$ j, i! Y! T. J7 T8 \
#lvscan
( w+ Z9 K6 B- f2 F ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭
4 z D5 z$ y" O6 x& w; @ ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭6 T/ @8 _; e, \ J/ [( p* s
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit- ^# k1 v# q& u- `; h" E9 e( G
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
6 }8 k& u0 {/ n: z9 Y' W: S4 z% q1 {# C+ O! N
! N3 h) {- r# I
mount LVM:
; U% Q. n2 n; P7 D/ \" o' ymkdir /mnt/lvmdisk
7 ]- _; `6 c# h [0 [mount /dev/vg_centos6/lv_root /mnt/lvmdisk# O0 V O. S- e4 C/ z
憭批!
# v/ g, ^3 }( o. x' d, h6 f
6 D3 s' p" E* T! H2 m
7 l# d- n9 V) Z+ E8 k |
|