: http://linux.vbird.org/linux_basic/0420quota.php#lvm+ p7 R* o4 R4 b+ C% O0 }' U
http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk* B' @. @5 S2 K
$ J4 x* c6 c6 w( y% _$ ?; h[敶扳曉之LV摰寥]
8 g7 y# ]' x) w/ V4 R* s% B* e ]4 C* l
+ h$ `/ M/ C6 ?- A9 y, i1) lvextend -l 178813 /dev/11HD_vg/11HD_lv ) L- _- I& N1 ^. J
/ W% c" @8 w* {9 y0 \
8 R. o3 ^5 a. ]1 Y8 s" [178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB& r5 G" @8 x `! @5 _
7 h: R) K8 L) a+ ]3 b/ f1 Z
' Y7 Y/ X- k( a& r( D( j9 e) B
2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv
. F6 f; a0 ~8 d; i( ?: g( i- e) {4 c; B' M
4 `! R( j3 q# S" W" p' t6 [
1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE
, B, L: b5 T: [/ l6 e; D. J
5 C4 u+ z7 g3 @ c( Z
6 e% W) e( C0 R `% e% ?( A3 K3)resize2fs /dev/11HD_vg/11HD_lv' @' o6 a( m- z5 \
* f+ u# D3 d, [, |$ G
* g, p, e. F1 ^0 b# G
P.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆# `' u0 ?' W* G# K5 Y3 G* e
雿輻 gdisk 脩, 7 ? [ {- O$ r6 h7 y' x6 o8 j, F
Hex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)
/ m, E$ D+ j6 Z# Z+ g+ F
3 P# o L3 l' I Q* ]- F7 l
* u1 B0 U, ]' x$ a+ o0 F* A6 `8 l[蝘駁小v]
, F; Q9 H2 M% }; D( spvscan or pvdisplay 瘥蝖祉憿舐內:
6 l) {, n# F& C0 J* y: c$ E5 y8 V0 iCouldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3) ^+ P& w# n/ N
PV Name unknown device" N4 ]$ D7 K F% w
1 Z0 q5 L: Y! H; i7 f: _1 q' d望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:6 `# ^2 p' r- S* _1 ?8 H0 g
vgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV ^$ {/ h6 M; I1 i2 A3 T
pvscan or pvdisplay 撠曹憿舐內 "unknown device"
: v: D' f6 ~! b" f+ t" ~" b; v; m. B+ C+ T- @
( j+ G# f1 R! {6 k8 Q, F) V. S
[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition] n! g) v6 R& l% }5 h5 ]1 R
#pvscan8 p2 g9 y( W6 A- r" ]/ {
PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)
" m4 Z( T; a% }, w$ { PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]
; Z1 i7 n0 C0 f Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]3 y/ n! E& f5 s, m3 a
1 e! w; E; L) [ X
#vgscan) ]$ ?# A3 O4 U# I, `3 \- P
Reading all physical volumes. This may take a while...0 f* P% F; ~6 k7 ^. E( f6 A6 `2 c4 v
Found volume group "vg_centos6" using metadata type lvm2
& y! ~4 |* _, y3 w Found volume group "vg_test" using metadata type lvm24 t$ a. n" Y5 i! L6 `
6 n# v. ^4 G, e8 d: V$ x, c
5 ~' L H+ u8 s
#lvscan
8 @, v2 J/ F: z. K. a' f inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸
' s+ b' t ]8 x* J5 d, \ inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸' r* t3 A1 I$ |# i$ ~, g s( X- x+ h
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit p- ^5 Y8 m- M: u' E) W# C1 d
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
/ i7 } o( D( r9 P8 q$ U9 }& J7 O8 j5 y% a8 }& }- S4 ?
# w1 I& I( {- m#lvdisplay /dev/vg_centos6/lv_root
( s9 y- [( A% d$ o8 b$ Y! }0 i --- Logical volume ---
* H4 k# Q/ }9 I% }# \ LV Path /dev/vg_centos6/lv_root
- |, A6 S$ W% U. R! D" i LV Name lv_root
6 s8 z; F3 U. P2 c/ _# H VG Name vg_centos6
5 `: i8 i5 F% U7 @& R2 w6 D+ T LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe
7 ]' o9 B; E* {6 l P LV Write Access read/write$ c& k( J8 ?' W( ^0 d4 ?+ t8 Z
LV Creation host, time ,
" S2 o& X6 s* N3 n2 F; {$ X( ~ LV Status unavailable <==== 銝舐0 q' z" \' T4 o1 K( k
# open 13 J6 u0 I/ i' `- x7 a
LV Size 21.84 GiB7 y% j, S8 x! G4 ?( A9 w
Current LE 5591
' |/ `/ V0 @# [) w Segments 1 v D% p+ \9 S4 g p. I9 \3 E' d' j
Allocation inherit
9 p$ q" l2 d% L" `; j6 \9 X: | Read ahead sectors auto
, z t& C5 J1 u m - currently set to 256
/ {* E6 D- G( E; j4 v Block device 253:2
# i% W; j1 N5 z. ~' M# [1 [0 u5 S/ O/ i& n; C6 u8 t
7 V1 @8 k" F5 a; A ]. `暺券鋆:
* Q! r* @- X, n0 U( t! W) [vgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)
- `% ?* z0 n$ T7 w- v) r V C乩甈 LV:' X: i1 E+ H1 }/ \, d1 U
#lvscan
; Z( r+ v3 L+ ?" u. L0 d- g' P ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭7 f$ u8 Z2 ]9 t( d, h4 f
ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭9 H; i I. j' F! S
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit0 G M) {4 k/ \( _
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit e6 J0 |8 n f& k0 ^" I
/ ]7 Y! l4 d0 N( A2 ^
$ J" Z4 i$ s" w3 pmount LVM:
5 I- o6 \# v. O. N3 W* n. G% q: emkdir /mnt/lvmdisk7 Y4 U p' K" I. s( ?/ u9 n
mount /dev/vg_centos6/lv_root /mnt/lvmdisk
- ^" |+ Z7 G# X2 m3 W1 u" x$ q; L憭批!5 `; E" P5 s5 W
" V. ^5 Z7 D3 {
3 \. ]4 F' R( j0 L7 p& X
|
|