: http://linux.vbird.org/linux_basic/0420quota.php#lvm
8 k( \1 ~4 C; D, n/ M http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk
1 J1 M+ T; _# S
9 k u) @9 D0 }+ Z% z[敶扳曉之LV摰寥]
' F- x# m5 q8 s3 b+ ? m
9 @+ X* `1 W9 @2 b% K+ E$ w$ J8 u' R5 t( {! W
1) lvextend -l 178813 /dev/11HD_vg/11HD_lv ( D) s# Y! J3 y& H1 u
/ A' n9 p# J( b5 I" @/ G
! K3 d }2 G4 h5 j6 c+ L178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB
# z$ E; j3 N! s3 x/ ^3 j) D0 q5 C, e" I, J
/ ~+ l. D' h% M
2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv
! z4 |1 _* `+ U( [9 O2 ?+ W6 L B7 {, l
. B! \$ K+ z5 N
1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE
D5 ] H/ y; T4 s9 G4 A# b" f# n: B
8 X# J( `* \/ Q3)resize2fs /dev/11HD_vg/11HD_lv0 Q3 g; m% |9 B% o7 F
: Q2 m; [' Q* v5 C; [1 J, x# f
8 x( U6 n' j1 z3 Q& u! J
P.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆. y" r5 B! }. b* G- g9 ^ ^; ~( C
雿輻 gdisk 脩,
/ F2 k6 K$ M, BHex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)/ d. I* |8 E3 f- J' V6 A; D* ~- C
7 p& N+ y/ c. Z* N: ~' S
2 n& Q" H" Z8 e. p r[蝘駁小v]" D* N ]# g; Z/ S) Q0 C4 ?* `% g
pvscan or pvdisplay 瘥蝖祉憿舐內:* K, X3 I; R2 @
Couldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3
! \6 _; `( A! pPV Name unknown device
" O# ~, u& l |; w% a. a; @
L1 X2 R( {6 @* V% x- L望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:+ K9 D- Y4 _6 c* e( z( M/ a
vgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV: v8 j. |( o) @& P6 C$ M
pvscan or pvdisplay 撠曹憿舐內 "unknown device"
4 Q. h3 `& l6 C7 y
5 o2 ]( l4 P* W
, s4 D$ J5 Y+ n3 {$ b7 a \[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]( b4 J+ T" @, V# U# t$ w
#pvscan
& O8 v- t# A& h; O* f- f' M i PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)
. J( |) g+ X- Q r& g4 K PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]+ D& z: n, ^# n9 T/ g# V3 c
Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]; {( y( A8 F- o- _3 F W
' v0 \1 ^ g& `5 T& z# M2 [+ L% g
#vgscan: G/ @* ]2 X3 c/ D$ {, s4 ^
Reading all physical volumes. This may take a while...
0 X9 a5 @, g/ S: o Found volume group "vg_centos6" using metadata type lvm2
& M8 c- H( ?1 E+ d Found volume group "vg_test" using metadata type lvm2
, x6 w+ _# ^( X4 N7 d1 ]! |2 Y# O$ x; }- O; {/ Z' [+ h
Z! p2 _- n4 d$ K _# f
#lvscan
' e0 h: `0 J: i6 i3 G; ] inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸
& }- k. ^2 `1 B inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸8 E; r+ K; B4 B3 o4 t9 w3 ~
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit x& O- A8 z' t( D/ O& T8 w
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
! S' k x4 u% d; T" _! m3 F+ c! S& S" |0 w- z4 }8 ^3 e( f+ D. m2 b1 ~
; M6 y9 u4 j/ E( ?- D8 U#lvdisplay /dev/vg_centos6/lv_root
# J" v7 n) w0 Q8 ?8 L* s --- Logical volume ---2 W$ E/ E3 p0 Q; I2 ^7 C
LV Path /dev/vg_centos6/lv_root
5 Z! v; n ?, {* f LV Name lv_root
2 ^. u. J9 N- K; T* {! e VG Name vg_centos6' e! u) d+ @8 y4 j! A
LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe5 h. N, i* `5 n, Z4 k |
LV Write Access read/write
% @) p, Q1 Q! b' V, e2 m LV Creation host, time ,
, Y4 {+ o9 V4 k6 b LV Status unavailable <==== 銝舐
1 t, j2 k5 A' j' w # open 1% y) F* R/ Q8 Z: ?. c0 @. V
LV Size 21.84 GiB7 ?3 U+ S. [4 d; u5 [
Current LE 55911 i' D$ K. m9 a/ B
Segments 1- y z) w- H3 J$ }4 l
Allocation inherit( o6 w6 Y- l3 b# F% Y1 _
Read ahead sectors auto/ j k7 i! O1 |9 q# l# T
- currently set to 256$ e% v6 m9 H7 i1 i# J$ z
Block device 253:2
0 X# c X! C6 f# n3 C% K, S; O" C& p+ d' h, x
3 r; e% v) I3 S& Y, l暺券鋆:( K3 N% T; B7 r8 O! m2 P0 ?- d, X
vgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)
; L5 w9 W: d. L0 g# l乩甈 LV:
" N0 B9 r" g. Z2 L. V#lvscan$ D. b$ N, W7 F: G3 G g# b4 V
ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭
! V" L) F% b( f& Q ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭
6 n! J' [3 X* r3 g$ b+ p" L ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit K2 i& p X) o0 L3 c; v
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
5 {) Z4 S- ^+ }7 m' d' [5 v. A% [$ c
. \4 H. p5 }" t$ k3 ^8 y) r5 Dmount LVM:: c8 c& e0 X6 F+ f! d( `
mkdir /mnt/lvmdisk* c4 B: G% l. W `/ I" n- n
mount /dev/vg_centos6/lv_root /mnt/lvmdisk
+ s" h+ M) u6 ^憭批!
" m2 X+ y" O. i9 j7 |! N( s m: L$ P6 m) @
# Q4 K) x/ o" C) d
|
|