: http://linux.vbird.org/linux_basic/0420quota.php#lvm4 K' w1 m3 }/ b3 n9 M9 S
http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk' u8 I! `9 t$ g/ b
: l7 a2 @& ~5 r/ N9 J
[敶扳曉之LV摰寥]2 C4 z, e: {) k" @, X
( F7 R9 v7 E- L0 Q3 z; g
0 d7 X6 x1 E) N5 [ t
1) lvextend -l 178813 /dev/11HD_vg/11HD_lv 1 E Y4 o% t- ~( ]; _& U
2 x) h9 k% W; i0 N6 p1 f+ N9 \5 f2 ?9 ~' L1 }5 G3 u \% M
178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB7 r& O U6 r# F; W
9 B# M6 K7 s. S
4 D! v5 g7 C, {8 Y+ H
2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv4 ~$ m- c8 h* m' f) C/ {
( C6 z9 E% I5 H" G- ]7 q
& u/ a E5 k8 N1 ~2 ^) \$ q; I) z1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE
$ q3 V% y. j+ Q: a
; a7 h& d: b; _" P+ A2 L; i! I
/ }, j4 }8 e3 S. i4 {2 Q3)resize2fs /dev/11HD_vg/11HD_lv' j0 j/ E& l6 F2 I! c
W, t3 m& n% H8 N. k; q6 A
) I) K3 V# b5 v
P.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆
+ @6 K) i5 O Q& I) I雿輻 gdisk 脩, - D( y6 @' l# X. B/ B5 T
Hex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)" r1 S$ x& A& T- I7 f
. n3 Q6 E7 C& M3 N# ~; B
5 [3 o" O% F% }$ j2 U
[蝘駁小v]/ Q- ^6 d5 V& q0 H
pvscan or pvdisplay 瘥蝖祉憿舐內:/ @: {! k8 K( B: i7 J0 Q
Couldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3
% f: o0 A! [8 a) I/ n! g9 @0 kPV Name unknown device3 \: a, U- R; n$ z
3 M& _3 S9 c% s2 x4 k& m
望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:
% h$ w: H1 b4 Q5 q; mvgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV) S6 z# N7 O0 `! O- k
pvscan or pvdisplay 撠曹憿舐內 "unknown device": A" ~+ c L$ F) f% S
0 {" b" q# M6 w1 L1 r
* Y- ~' ~6 r$ W
[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]. { e& o; t& @2 Z# p
#pvscan( H# [& @ p+ W. y
PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)1 O$ y1 M! \* R* z
PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]: G& f/ s* r% a
Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]
' r1 a. z, k% g2 B, m( f: j5 v% F, P1 `2 v9 t4 I k2 r# u7 f& g
#vgscan# N$ c4 q6 D- @ ~# g6 \( X
Reading all physical volumes. This may take a while...
7 \7 o+ m# g: T& h+ `. g2 H. k Found volume group "vg_centos6" using metadata type lvm2
% }0 t) ^2 O7 f: Q, H2 U+ H' K% f( V! x Found volume group "vg_test" using metadata type lvm2
2 z& s. A9 ]" S; M9 V. P- r3 o' @! M/ T
g: k3 N: J0 ]' e#lvscan
, G6 E) |+ h4 R, ~3 m! E1 _ inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸
- W3 g! R) Y- N. i! P5 }( m inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸' A% q" i2 g6 a: @
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
7 q. h! C3 I* }& |6 Z) g. B ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
' P1 B* c! X1 l& j* i# @
) W+ V& {% V' G( n. E3 ^# i P! ~ [+ A$ C/ |
#lvdisplay /dev/vg_centos6/lv_root8 K+ b n0 g# H
--- Logical volume ---
+ e3 N7 H# k9 Y% {8 b& ~2 m8 [ LV Path /dev/vg_centos6/lv_root- ^) P6 N: r# T
LV Name lv_root
7 Q1 e7 s5 ?4 A/ d0 r/ v VG Name vg_centos6* L2 g; |! v; z
LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe
6 X( C" C5 ^! N5 p; z( ]$ G LV Write Access read/write- ~: m# _, @% s( H" j, k
LV Creation host, time ," S% k2 O9 Q9 m3 @8 r% F( p0 h! t
LV Status unavailable <==== 銝舐
% l' o$ p0 I8 J% F2 V) h # open 12 i4 n: _3 ]) K Y
LV Size 21.84 GiB2 W% d, d& \- x! [( U
Current LE 5591; P" G' t1 Q% J; |- f) [2 [1 I
Segments 1
! b& v) N& R4 F: u& n Allocation inherit
+ x v7 S# v2 Q0 |/ g. z) |4 M5 j Read ahead sectors auto
! |/ y* m+ r; P0 e0 f M- ^ - currently set to 256; {1 J* ~* z" u' L
Block device 253:2; H: `0 m' E4 D$ P) ?: t
* S3 w0 J4 U' X @" q: R
- e8 J+ s: L: l5 c0 M
暺券鋆:2 m$ ?: R& t0 w/ I1 L9 |
vgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)
" J1 O1 ?5 U. N, }' K$ ?: r! X乩甈 LV:% X3 l, X5 N R
#lvscan$ S0 H$ Q" |& D# t0 _$ ^; w8 P# M
ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭% ]& r' O. A* @+ C2 @: S. J4 H
ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭
3 F- ?" x# k9 X+ m% Q ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit5 _. K) A' f u. @
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
1 t( r: G6 u% o) D4 O9 a* @
2 u$ K) ^! Z& x
' y# O3 o7 ^' R! f) ]$ S' @mount LVM:7 ` o( e- F2 c
mkdir /mnt/lvmdisk
* u$ h% R5 l: G, o$ @/ Zmount /dev/vg_centos6/lv_root /mnt/lvmdisk
1 X2 [( H# v* z) C* r8 a# h憭批!; u- F+ r+ v; |1 ?% p
" G1 g" V- e, Y" v0 d' T3 r8 W" H5 M* A; e3 y0 ^) t
|
|