: http://linux.vbird.org/linux_basic/0420quota.php#lvm8 `4 H7 Y5 m6 ]! l5 O: @
http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk3 m6 N; v5 K z7 J
9 j, r h8 _' Z8 l- Y[敶扳曉之LV摰寥]) ^& e+ Y% z0 _" P# v+ i
! M" v/ F8 Q+ k$ [
. ?; h9 N V% x" [) q+ Z" Q/ p
1) lvextend -l 178813 /dev/11HD_vg/11HD_lv
+ g. x& V0 O- J, V& A/ z. f4 x7 c- Y: ] a( T
7 X7 \# X& d" H) t1 [9 M178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB q }3 Q8 S+ t2 {
& }6 w$ _2 r% X) J9 _
( c* m* A7 |1 J9 ]5 S8 [3 i2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv
# k- s ^* e5 u* k- p2 N. P6 ^! }3 i' R6 s- I4 n5 C# a l L
8 _2 d8 B( T! V* k4 }$ J
1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE
" K* F$ a; ^) A1 V* S! y* j+ {9 p3 g# D) V
7 Y/ X2 r0 e p& d$ S$ ~
3)resize2fs /dev/11HD_vg/11HD_lv
8 ~4 l( Y; _" d+ {- q
8 I5 ~+ o! S+ b. |" l& z$ G( ^# f3 ^. K" D3 m+ S
P.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆
: {! c% A$ x, J2 D3 H, X5 k雿輻 gdisk 脩, ' F% u h; }: Y' F2 N2 W
Hex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager): g1 z' m7 ~! \3 u9 O
0 [" C# t' x7 g8 E" X% w! a; {- ^( x% M
2 `( S# l- z8 N! g% C1 D% o- Z[蝘駁小v]3 b. f1 S1 {9 m: A1 p# p9 S
pvscan or pvdisplay 瘥蝖祉憿舐內:4 N" R3 X+ y+ X4 _4 S
Couldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3
5 t" ?8 N4 A5 a5 V6 vPV Name unknown device
/ r. u! V3 D4 _8 R" [# j
- B. o+ L0 m: `0 P; U8 D; U% r望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:5 R3 l; P D0 }4 Y S
vgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV) a4 Z& H) Y0 N6 K
pvscan or pvdisplay 撠曹憿舐內 "unknown device"
, z! I# j+ P, z/ T4 F2 X% w4 B7 T$ W# G8 `, D* R
) j, Y7 P$ y1 b5 U7 `8 Y9 E( q
[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]$ ^) X4 M# [) I. b# j
#pvscan
& Z1 Z7 [6 N: X- g PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)9 j; Q9 f7 \ u5 I% R
PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]
& y3 n! |- ~2 J. N2 Y6 z0 ? Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]! o6 A3 q1 q- S& U( D5 X" }
7 V n; m+ Z u#vgscan
8 ?* u& E& R3 a Reading all physical volumes. This may take a while...
. l8 a: U- }$ n Found volume group "vg_centos6" using metadata type lvm2
, H7 D! M+ I* f$ S8 J9 b Found volume group "vg_test" using metadata type lvm2: g# D# m& c# k/ Z7 {& Y- k' i+ P
9 k( I3 w& R: E4 U! M7 r
& E$ e& K; _$ A7 r* \% w( B#lvscan
1 g+ k. {: D' f3 V inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸/ s( I/ Z; G2 N& I& l7 i% C
inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸
0 Q' m8 i3 _- V0 W ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
( l3 N+ O: S- Z; ?1 H& u ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit n$ c/ z" s1 [
% i+ F3 P- y W. B% m
' [, e9 M3 F t#lvdisplay /dev/vg_centos6/lv_root
1 q& y9 b; J# n7 ]. d; C) { --- Logical volume ---: Z) L- Z4 o1 y S
LV Path /dev/vg_centos6/lv_root
: \6 H) x6 Z1 s0 U# y2 s8 m LV Name lv_root& ], q, e, {& {4 h# o7 h, M( h; g
VG Name vg_centos6# Y P( V L1 j [9 |
LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe
( V. w2 _, R, Q9 F& v# q" s3 P LV Write Access read/write
8 f4 g2 m* b& X9 O8 \ LV Creation host, time ,
9 G' W, H+ t3 h0 }" _0 B LV Status unavailable <==== 銝舐1 Z& O9 w# N- Y
# open 1" e W4 B3 Z# p7 S6 {, _
LV Size 21.84 GiB$ o5 G3 F6 N" K8 K- c. P
Current LE 5591: {9 B" n+ ]" p
Segments 1
, h: W. L8 T+ O* M k" P Allocation inherit
* w9 i3 L7 S' F0 z2 ` Read ahead sectors auto
. {9 F4 t4 \# F# y0 P- ]' L - currently set to 256
A/ i& i, e# @4 M- K: v Block device 253:2
9 h0 g! ?' @1 U' V$ V! X, T6 m( J3 h+ H
t) g' @ C2 A8 `) d暺券鋆:
( v- A+ @4 j2 Zvgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)/ x; i; S8 ?/ D/ ]2 C# A5 ~* E8 K% l
乩甈 LV:
1 T% d$ W9 A- }#lvscan+ C' }+ X; }# ]# _& k! ~
ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭
% E8 L7 ~/ y8 K V7 g @ ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭; j& F) w: ^$ J( V) a0 {+ v
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
9 [! H+ I+ |) d8 H0 M/ Z$ t ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit N+ q9 a8 r6 g8 M/ E
; X* T9 S6 ]3 @
6 G- {$ W& S# k) S; D
mount LVM:) R, q+ d5 X6 z$ |$ Y
mkdir /mnt/lvmdisk$ _; u% b+ Z0 ^2 F2 Q$ _! b
mount /dev/vg_centos6/lv_root /mnt/lvmdisk' n/ r* M& ], m' G+ }
憭批!/ |1 v: K+ H! j
! ]3 H4 Z& t) P) W: o: k7 C3 g6 H: m1 T
|
|