: http://linux.vbird.org/linux_basic/0420quota.php#lvm D; C" W( [9 R% c! w, @
http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk7 D) k! {' L6 c% q4 H" o) s6 N
. E. p$ K, d, b2 a9 e2 h[敶扳曉之LV摰寥] ]: v8 v& B% q8 f6 |3 p2 K
) \% m1 s' L+ L$ U9 u- O/ X
9 t% {3 I% \+ G; K7 g( `; H" b# o* W
1) lvextend -l 178813 /dev/11HD_vg/11HD_lv 3 `4 \( a/ c4 Y- _% K* h* g1 \3 c
! Z: Z3 W! {* @) g+ A# ^; G; ]8 a
% D$ b, H3 I9 I9 S! N
178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB
/ Z+ c+ q ?8 J3 |% S; F
8 v# h3 b' D/ W% g' e: P! c* I
$ S0 v% A& f1 {( E2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv
* @2 U- _8 @* v# a/ t5 ~( _) a' U8 Z) \, m9 A1 f' h5 N
8 |6 Q- i, y0 p5 @# ~
1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE$ {7 E: A; P; B. t- X- V: y4 A" J
$ j+ ]. M# ?- [4 A+ C( i1 y
9 A( \. w& J0 n7 A M3)resize2fs /dev/11HD_vg/11HD_lv
: l- }" e. G3 l0 @
0 F1 ~ N: M& q0 Y6 f# G) E
G9 a ~# ?6 J, G6 tP.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆3 Z; D5 R$ z+ k9 c
雿輻 gdisk 脩, N; \' s' y/ b4 b8 s" @
Hex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)
7 ]8 t( o2 I* h: d, w/ B/ L7 E+ C9 [. J B
0 c0 }. q+ ^' K% @ Z
[蝘駁小v]: f5 Q7 e: j# c/ \; {! v) r
pvscan or pvdisplay 瘥蝖祉憿舐內:
5 E! K2 N- @9 ^; i1 x, m; C4 bCouldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3
( v U7 x& F# r! L! b& gPV Name unknown device9 i4 y7 w( q i C q
0 Z- @; Y+ o1 c/ W
望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:, Y% N. z+ S7 P9 X, i7 z
vgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV
5 m% q, g1 T Vpvscan or pvdisplay 撠曹憿舐內 "unknown device"6 _' a# ]; B1 p! z+ z# E
- u- d, ^0 ?" ]0 {8 }
, P4 n- |- ?* M' [[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]
7 x7 [' [$ F) u6 K7 e, \/ o#pvscan+ N a! i+ C* r
PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)- r) s+ U$ E8 N3 i6 ?, N# M6 R
PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]
! `2 t* d7 g, z. F* W6 V Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]" M# y+ ^' \0 |! K% _
Y% {( B$ a. i' \1 Z#vgscan4 K8 k6 R7 s" w) d
Reading all physical volumes. This may take a while...
& m# P/ Y4 h! y; P& N Found volume group "vg_centos6" using metadata type lvm2
, Q5 `: C A& X Found volume group "vg_test" using metadata type lvm2
5 p- y8 _/ ?" a2 @8 o0 o& P/ W2 z4 _' U' G. V
+ i* C o# V, _! J" f( J8 ^
#lvscan5 t* X5 R) O9 n& W& c. P, n6 O) J
inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸
' r& {4 W% ^7 T9 n- @* K0 [) M inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸
& C% h1 n1 j9 T ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
* N k( P8 p7 ?4 E2 s ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
8 L1 u# Q: G4 \0 o
3 u Z8 E* U# ]! |+ X
' g# u) O9 @0 d' O1 R( h- Y#lvdisplay /dev/vg_centos6/lv_root
& |) ~. F( C. M) x+ Z1 o --- Logical volume ---
3 O7 {+ N8 c/ c, g7 P8 r: W LV Path /dev/vg_centos6/lv_root& o6 @ v7 E9 w7 R, m
LV Name lv_root# j. H1 t! q/ e
VG Name vg_centos63 g8 T2 p: `9 ~+ \* R
LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe, } K- P% D2 J: @: z8 g8 T0 b2 T4 o
LV Write Access read/write! W6 c# u1 v _1 L& [3 ~# y
LV Creation host, time ,$ [# B5 l K' d+ b( a
LV Status unavailable <==== 銝舐! X( q, Y. ?9 I+ m- V- W
# open 13 [ h* i( \! X# x+ s* U* W
LV Size 21.84 GiB7 ^0 A% x+ m. Y, h; o" W! Z8 H5 O' F- q
Current LE 5591* ]. g0 l3 k p' x
Segments 1! J% i! L: |9 B0 B% t" h% ~
Allocation inherit+ y" y1 {+ }, i
Read ahead sectors auto( Y) t' J/ t9 a& y+ H
- currently set to 256
4 M# l3 i( u4 t+ K3 | Block device 253:2
0 e" W. ~% r7 M( y+ ?+ w8 H' @# w. E9 {% B* D2 b6 R$ e" P: S
- Z" w: n# W4 j- A6 O0 Q暺券鋆:$ q V2 D0 G5 J" p3 |: q
vgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)9 Q# x" T( c) c w% ^
乩甈 LV:! f4 t+ |0 V" K7 A4 H5 W& a, |/ V
#lvscan. y% w' g2 j) v" G* ]
ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭* V8 D: R* @/ a V# X
ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭
2 V" x( R, k5 v: T! n8 ? ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
. K% l3 }, w' z s ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
! Z" N, m! [; U" ]0 h9 t
n9 q9 F5 D5 x! M; _) g8 I. e( ]! V/ Z" y" I( |( t
mount LVM:) X/ ^2 b Y1 O" j) H
mkdir /mnt/lvmdisk
5 e9 F/ ?, D+ H6 o. U% B/ q# Lmount /dev/vg_centos6/lv_root /mnt/lvmdisk
9 S$ B' Q4 }# ^0 F0 Z- g z0 b2 Z/ V憭批!# i0 F: X2 I" m. u: X8 ?. O
2 n8 l( J( r6 x% U5 K
3 ?/ B! G7 n& E: P" k$ D* ~ |
|