: http://linux.vbird.org/linux_basic/0420quota.php#lvm. Z6 }0 G- h7 y2 B
http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk
' v; O& m) A% s7 q3 ?% T% m& A, \2 m4 u1 E- y8 h4 Z( c- X; H' L
[敶扳曉之LV摰寥]
# @% ]% J6 U; W' v, m5 t4 R1 |9 t% n, ^% p7 S! s4 \0 }. x
" ]/ F# u: H* D; _1 Q
1) lvextend -l 178813 /dev/11HD_vg/11HD_lv
. B* B; |% g H- X9 U- W8 y6 Z% i" _4 O
5 v" S8 e5 k6 C- w178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB
' {8 Z7 N4 ~! @8 l5 \6 ^& _3 M" d6 O1 ?, J
. b2 ^1 u+ i. z5 b9 k2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv( t/ ?! d, y. _- l2 z/ U
5 q8 b- p6 C z
/ [. |/ R. A% o, o* f* z1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE5 |% N$ i" {8 h! d% ?& \: u
: q7 o+ f9 R7 v" o, S5 C" n
; R S0 _8 K2 U; Q0 f3)resize2fs /dev/11HD_vg/11HD_lv
" J% U# q' y0 p" T0 Z( E! e3 F" e( u5 ?: q6 h
3 `8 N5 ?. O) sP.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆: d q- e& Z/ z2 t- ]5 b: C( B
雿輻 gdisk 脩,
' B3 y2 M7 t8 p3 lHex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)
+ W6 ~* B* C1 V1 Z$ A) X, U, i; W7 T+ I6 x8 a+ s* d h9 I- ^
{& c8 _& j7 {8 z, L* ]1 k7 E0 G[蝘駁小v]8 z. o. {) G) k2 Q: x
pvscan or pvdisplay 瘥蝖祉憿舐內:
+ `. v% b+ b" B; P! n! n3 tCouldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3
; U& o& v" @ g2 v' WPV Name unknown device
$ Q% M! e! P& M# L* }; s4 ^2 N$ w) u# ^9 R' z$ ?
望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:* |! P- x P4 Z( @! c0 I/ V
vgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV
5 \9 v" s7 n% x- }/ e3 ]pvscan or pvdisplay 撠曹憿舐內 "unknown device"5 K2 N1 R: z7 T# \: k1 m' ^
4 m' q3 D" H; d6 }* S% x
" G- Z% L' d) e$ c; v& G) |' D
[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]7 M7 U! N+ c/ |) I8 I" t
#pvscan: [1 O5 r6 D" [+ |
PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)
* Z( \8 u# i" U/ e: g' X PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]( [' s5 c& u# v5 A3 ^
Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]0 Y" o9 [ r& G) c' _! K
% n" ^8 u. G! E7 c0 l: O# d#vgscan
& ?0 y7 g* a; n8 ?- ~ Reading all physical volumes. This may take a while...3 k/ v" U& W& d& z1 W
Found volume group "vg_centos6" using metadata type lvm2( e! F- _* Q, @- \! l( b
Found volume group "vg_test" using metadata type lvm2- e# g- s( k6 b) B# b" i: Q- W
2 J* j& v5 d) _- f0 O0 i) q1 V' P; \$ Q/ R2 }& F7 A
#lvscan+ G9 ?* Z: |& C) z+ S8 E& s# r
inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸
! E# v, u, _" f" u- x2 R inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸
" p7 W; s1 |; x4 y ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
, I" E/ T/ S5 ?" A! B( M+ Y ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
! t! K2 [0 j" V" X0 }4 \: X& s0 y* k! I
. f+ U2 R0 `7 V, n8 P$ d3 d#lvdisplay /dev/vg_centos6/lv_root& ?% Y y0 a! `( K
--- Logical volume ---8 U" d8 V; Z( V' d5 t
LV Path /dev/vg_centos6/lv_root
+ h/ |& e8 M; Y LV Name lv_root9 ^) Z& S8 f. Z. Q
VG Name vg_centos6
1 `8 y$ U* y& C1 S/ K LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe7 v5 [$ v+ O+ V5 A
LV Write Access read/write& |$ H" j- Y* r8 {2 v- E
LV Creation host, time ,
) ^ d" ]6 a+ D" B' B0 l LV Status unavailable <==== 銝舐! p# i" D$ Q4 ?- n+ k9 O/ u
# open 1
. B; |8 R% d% \' t( z4 v5 q LV Size 21.84 GiB8 j- i/ `0 [7 x3 _ V: [
Current LE 5591- c2 u$ x, O+ I+ O1 K
Segments 1
( z) T: T( p1 \2 f4 g Allocation inherit- M1 I7 f& e( E3 y1 v; F
Read ahead sectors auto/ k: ]% q; t9 ?! k8 H: y5 w5 `- D. g
- currently set to 256# Q2 ^8 n* q; w- C
Block device 253:2
& ^# f9 o; w. V- d$ A5 y$ A, L5 C- l
; v# x6 W& `/ a I
暺券鋆:
1 k$ C0 b% ^6 u; Uvgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)
+ `1 O, \! j; l# r4 r乩甈 LV:
# O @; w" R$ L: h#lvscan6 y3 O4 ~$ {, e5 t% A/ t
ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭
1 ?" y" k$ E# E ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭: d6 |- n* ?2 z3 n
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit/ W c0 b- y! U1 K" ]
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
6 x+ W7 G- x. ?2 t" w
* V( q, `1 W. ~
& D1 \& R+ f* @5 _5 m4 O! K/ Amount LVM:
$ d4 K J5 K' N! Smkdir /mnt/lvmdisk
! S' H; K( b! j" }6 X$ Qmount /dev/vg_centos6/lv_root /mnt/lvmdisk1 V* [1 E- ~8 m9 R8 a! Q# E+ k
憭批!
9 Z: w, m+ F' G% e7 L$ `$ I: c+ c w; @0 j, h1 T8 N: p
& M( K1 S3 g* P& Q6 _ |
|