: http://linux.vbird.org/linux_basic/0420quota.php#lvm
7 P: @& I( n" L8 R7 b* _$ ^ http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk" c: Y0 Z, S5 k* B. w
) Z7 e( m; z* j" A# Y
[敶扳曉之LV摰寥]$ l. U' W2 O* T! s: X. {
* }8 k# p4 _3 [8 l7 j
: T% X3 z' W! N& |$ P$ `$ O1) lvextend -l 178813 /dev/11HD_vg/11HD_lv
9 X% b5 }4 }. b5 g, Y; l; T
4 w, n; G9 D5 T. F- j4 L% A) N7 B+ `& R
178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB2 K" @( L* {- \. H& T
* Y4 ]2 d2 c2 |5 `4 E \) M+ Z# w
2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv
# O" @0 O$ B: C) o# n2 Y+ P
+ t- r2 O+ I: l+ |" W! b
5 f" W2 c( D, P1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE- @: w' e' M: c: U; W
6 \" A, P0 W4 W q7 {, H2 [+ c9 s% d9 I% k) q+ {. F
3)resize2fs /dev/11HD_vg/11HD_lv: t# s9 p# M4 Q# d* \ l
& y- J; J1 o1 h f( n
6 V* t0 K( M& \% F* ]
P.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆
& ^! M" H: Y2 e0 t; C雿輻 gdisk 脩,
1 k7 j8 L/ L8 t$ T, p$ PHex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)
/ U! c5 @7 b6 A% P; w z9 t! w7 t7 R
( Y4 @! e" Z5 `) H: }. E8 P) h0 d6 a; q" M. Z6 P- i. k
[蝘駁小v]/ t, n( o1 g3 r
pvscan or pvdisplay 瘥蝖祉憿舐內:
4 `3 ]3 k& U& l" s, F- pCouldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3( V! s1 K" A' K1 m2 o& h8 x4 V8 n& S# x
PV Name unknown device
, ?+ b- b7 C; @2 {' g
& \! N0 v1 F9 U4 N3 a望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:. G3 m0 J% c( k4 @% u; d
vgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV
( C9 e+ |6 J' z }; [pvscan or pvdisplay 撠曹憿舐內 "unknown device"4 {+ @1 i7 u) ~9 J
z. Z+ [9 b$ A0 I9 I" Y
" x @& i) _& Y' c[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]
! N8 M. p6 d8 X* l2 t' ]( X#pvscan. Z: E N/ l, s! Z1 R% K6 y
PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)/ |/ Z! o' `* X
PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]6 s' E3 x+ W4 S4 }
Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]
* a! z3 l0 Z7 V0 Y: u7 \( O
" C! c4 k. y) |#vgscan
* g8 E; U1 d3 D6 h6 B* B# N Reading all physical volumes. This may take a while.../ F& n; E) r- P1 K% [! i5 X
Found volume group "vg_centos6" using metadata type lvm2& V1 U3 b1 `1 n! I* o' \6 l5 N
Found volume group "vg_test" using metadata type lvm2
J1 x/ E/ D3 n Y- E
, R$ E! | {* v: z" v/ U( |9 f3 s/ `' w9 B
#lvscan# E; Y! E G. B2 ]. r
inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸! a, t9 y8 ^) W8 T/ ~, h8 _. ]* V
inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸
; ]% B2 f0 j+ g( h( }( O3 i e0 v ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
' r- N7 I; E' I/ k0 O ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit- a' X) ]( s. V
. \% t6 G; o o4 q7 e( r
& G( V5 x" X2 K# V7 k2 ~
#lvdisplay /dev/vg_centos6/lv_root6 l1 E6 N# [& Z* {( L/ a6 I, @ k
--- Logical volume ---! D& `3 f! s7 G. V6 {0 H) f- O1 e
LV Path /dev/vg_centos6/lv_root9 O: e; K; n' k$ ?
LV Name lv_root2 x9 m/ H F6 v$ `
VG Name vg_centos63 D+ ^4 T$ c4 L6 L
LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe
# W8 g0 H. ^7 Q I LV Write Access read/write6 |7 K: v7 J, Y$ Q' c6 ^
LV Creation host, time ,
4 B7 x+ w6 ^( W( h, ?, Q" S LV Status unavailable <==== 銝舐! @* ^6 a, r$ g; v, e: i
# open 1
( R+ A/ a. c/ c# }+ C# C: O- I LV Size 21.84 GiB
+ ?0 I, g' p2 A+ S' P' n" p* t Current LE 5591
" i9 C; B! m. P8 Z. l) e Segments 1
0 L" X+ ]" w$ u- |; X) e) s Allocation inherit/ G# h9 L8 U; Z1 Q5 f! o
Read ahead sectors auto& ?5 s" _ F q; E$ ~- K+ ~/ f
- currently set to 256
2 S( a, M1 z" l+ m" O4 p( \- Y" [9 v Block device 253:2
% L E3 b" z: e4 ~* P
P# v! F( T7 }" w0 _8 I; q8 z7 R6 G X+ B5 ?: j
暺券鋆:
. a% H* x. A0 B' i" S- j3 x! C# g: ?% nvgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)0 u9 S& { d, t$ V: i: ^& `2 I! q
乩甈 LV:
! s2 T6 z/ }; I4 x+ o' t r3 S" ]#lvscan- x# J4 J* e5 r5 V5 ^1 C
ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭6 Q! u( w( h8 I1 U' z( t7 b5 V
ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭1 U: K6 d& _4 H& y' R* J0 Q
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit4 Q' N( S' B) [& B% `# |
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
# ]/ c+ ?5 f h. r, |
% s0 g. G' ]" t3 ^: D/ i8 b* @
G' _( X$ }( ?" F/ O" zmount LVM:
0 f V4 ~) A" a8 A! I0 |9 l, D/ rmkdir /mnt/lvmdisk
5 L7 I5 J" ~0 _6 N' ~4 L: wmount /dev/vg_centos6/lv_root /mnt/lvmdisk8 u, | a3 F7 R
憭批!- @: i( W Z" n# B U o" \6 Y8 \% s
+ Z2 \' T/ W# W
2 Q' x ~3 Q' f/ x/ j: h! C |
|