: http://linux.vbird.org/linux_basic/0420quota.php#lvm
" t1 g: Y* c& [0 y4 W http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk
# {4 ]6 |5 a k% ]1 b4 m, |1 u* `8 ?/ V$ M7 |
[敶扳曉之LV摰寥], v8 D9 f! o) } \
6 E W( E9 m# i1 \2 B
/ Z* y3 @# O+ Z2 U
1) lvextend -l 178813 /dev/11HD_vg/11HD_lv \7 p% M" l# w6 d/ b
7 b. P, K# D- ?
) ]8 G- q& M8 M' k178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB
* }: E8 }7 v3 e8 r% A2 E9 k( i* ~' K- i/ ?$ {( B
% A: u9 f& t* E% p3 a
2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv
/ [/ ~8 J1 r% C
6 p* r/ D( M+ e+ w% X
: t) a. H/ V8 b6 \: a' J1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE; A0 ^# X/ q) {/ n) e6 T
. C) s# j1 j: o7 }% G1 S+ C' o* T; Z. N- I% l
3)resize2fs /dev/11HD_vg/11HD_lv" R% f* O0 e. r8 @
. V* h8 A! [7 w6 c# `3 W8 G$ M3 V0 P; {. M
P.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆, o5 b5 P) ?* V* A/ e6 m
雿輻 gdisk 脩,
' i& Y4 v. h& M- rHex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)
! `% C0 p+ D7 f+ j" L" @4 W i1 L3 M6 ]* k
, W9 V3 S, s6 U7 Q( K6 Y6 R7 b6 M[蝘駁小v]
: a" l+ K$ E1 N: { ipvscan or pvdisplay 瘥蝖祉憿舐內:
6 O# t% |- I/ ]/ Z8 U8 CCouldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3/ e% h# i1 P" E. p8 Z" D; R: H
PV Name unknown device( c; a6 F' d0 u
$ r' O* ? f* o& S8 O% b# r& Y
望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:
I' @+ G' e7 p/ \, W- f. P' `% zvgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV
9 i$ b6 i5 T3 d# J6 r3 F: e' t: W, Ppvscan or pvdisplay 撠曹憿舐內 "unknown device"
5 v- \! s1 S0 L% h
$ }3 I+ b! f5 G
# N! T- X/ a7 r7 A9 r( v[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]
* }. }. b& x ?4 T& @#pvscan1 `, v! I- A+ S& Z& u8 E. _. H
PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)
, q% I) X( S: H' b; S PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]
( P; |8 t1 n, K Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ] ~) K+ o" A7 W6 G K7 H$ T5 y
5 T2 S1 ?) v4 Y. }#vgscan& J$ a" U( }/ Q2 {/ o
Reading all physical volumes. This may take a while...
5 f& B& x+ O% k4 n& C Found volume group "vg_centos6" using metadata type lvm2% k( |9 ]0 k1 n& p V
Found volume group "vg_test" using metadata type lvm28 Y/ P' k( J* t/ J! I% e' u
5 m6 T7 ~3 j0 U: }, _! h3 L- y& ?
' e" {# r! C& r9 W. E#lvscan
# x/ @( w1 G0 {+ Y3 K9 n+ J7 ]9 p inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸' E+ i$ U+ q9 D/ l. [
inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸/ o z) m& f% c) A) G6 o' \( K
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit- M5 {) P) x* w; a, w6 r; `" h
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit9 l/ }, Y- j2 V
1 K+ k; I/ c& N1 _( v$ v& _. K
3 [3 H" m6 K4 S3 l#lvdisplay /dev/vg_centos6/lv_root
) e" |! W2 j6 g- k& e --- Logical volume ---# Q, v! n4 C; o& e2 I
LV Path /dev/vg_centos6/lv_root% {( V* V( N& _- M
LV Name lv_root
6 F' N) D5 \% ?9 @ VG Name vg_centos65 r) E4 n5 v1 q+ M( ?6 \
LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe
8 ?6 a( n# T0 R K/ v. b* D' Y- S LV Write Access read/write
: z% J5 Y' P/ @1 e. G" n$ \4 u LV Creation host, time ,
/ i$ C1 v) G; Y9 p+ ~ LV Status unavailable <==== 銝舐1 A( [" S3 X) `& O( g% o6 ?
# open 1- u$ p" {& t, t* R. a M0 r
LV Size 21.84 GiB9 q- @, o& g( B, ?& r% R! X- S: q
Current LE 55913 y# V, w3 z) v* p! I& V T
Segments 1
- z3 M5 ]* F5 O4 n9 } Allocation inherit
. T6 Y# X: x; [# v9 p3 V( Z- M Read ahead sectors auto
+ B* r( q- j' _, h, `3 ^4 g - currently set to 256; x& I5 H; R& { G. t" }
Block device 253:2
G, C) J; \3 F* X2 b% U; S; l. }2 y5 K) Q* R
6 R: c8 a2 \! B8 `7 l) R3 H暺券鋆:5 D K5 K6 |) r: Z% _% u' _( w
vgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)
$ `4 \/ c- o( |) u; s乩甈 LV:5 q3 ?+ e$ e: @: b! r6 T. x
#lvscan2 Q: d% @- z! d1 C* x
ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭
, N: `5 H, M. Z% ?' A( ? ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭
: W0 O5 K5 W( N9 ^8 ~( a ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
/ k- s, c7 p, c4 ? ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit: x \6 g6 W7 i+ C
) O ~0 ^- n7 m) d2 `* S3 ]* b" v0 M/ S: x/ a- H5 h* Z
mount LVM:
. F' r( M$ j: Mmkdir /mnt/lvmdisk$ {6 s6 g8 X* K7 a5 L7 b( X
mount /dev/vg_centos6/lv_root /mnt/lvmdisk
! a2 g1 E" Q5 i. Z憭批!
5 r" j9 W) r5 t. E9 K _% g+ g1 b6 v6 r$ I* i$ Q1 {
9 C* A$ l" H! D! g% ? |
|