: http://linux.vbird.org/linux_basic/0420quota.php#lvm# u' o" y: g0 K1 V+ w4 z
http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk+ I0 e- c) x( K( J& R, q8 w/ l& ^1 `
5 r$ d5 P# n* ^5 s[敶扳曉之LV摰寥]
W! q" n5 |2 Z5 u( X+ K! t0 }
' \. I7 Q# c' A" Q2 C0 n4 N( O
; V/ j0 v# M5 O( l3 `$ h1) lvextend -l 178813 /dev/11HD_vg/11HD_lv 8 Y5 q+ ?# k& x9 `8 \( J/ y. _
! S9 h s+ d2 K6 L# W1 J# ?$ I1 r$ F3 |- i: X; x; V
178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB
8 W- ^$ C$ w1 G, ]4 @2 n$ n5 V) p9 ?5 s+ b) \
0 E$ Z6 @+ v3 T; x/ z' N2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv
5 h( b! [6 D* c7 f1 G& l! s0 J" k" V O$ b5 f1 l; L8 I
0 G( f) m0 w w1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE
6 Y1 ~9 k$ M1 c. r5 Y L# R* W! `& i
; y; I: K: c5 M% P. t
3)resize2fs /dev/11HD_vg/11HD_lv( X8 z, p8 T3 _
( f' z- T6 r m% d
T# ^% ~7 J0 Y* }5 e) X
P.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆
4 ~& t! {8 V1 F! I* B7 y' }雿輻 gdisk 脩, - @& z6 A$ J6 m' C' M
Hex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)$ X& l. s5 P, l" k6 Y1 S
: c8 u: K1 E) A. h3 I h! |: `# N. S- L
[蝘駁小v]) i1 V* v6 M2 ~! i% A
pvscan or pvdisplay 瘥蝖祉憿舐內:# u3 ]: P' B4 y: V! P( F1 q
Couldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3
$ E/ H* W. W: u/ EPV Name unknown device4 h* P" z$ n5 T* {: x
9 l0 K# C( G4 q4 I& R/ ^, k' X望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:: G/ ?$ {! r: F$ S6 l! I
vgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV9 G a- ~# H6 E' S p
pvscan or pvdisplay 撠曹憿舐內 "unknown device"* c: ?: c1 ]/ {- {7 w
4 l5 {* d$ h( ?2 m1 p4 {, x/ V
7 J3 o$ N# l: ^3 `+ `[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]1 _, P1 u0 D. m$ x6 C6 r F% ]
#pvscan/ i8 S* ?- @; A1 w- h0 A
PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)" H) n% x8 m. D2 x
PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]
* e ^' q8 Q0 }2 H; @: @9 l1 A Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]
~$ s/ i' U. H' k! z4 ?. C; t( V9 O
2 s5 ^% d9 ^/ L6 h) }1 o#vgscan8 b, D& f" H% e& I& ^
Reading all physical volumes. This may take a while...
: V$ I: v; \" T" x7 W! {: V Found volume group "vg_centos6" using metadata type lvm2# ]% s' }+ \9 L' H' _$ S$ \- g
Found volume group "vg_test" using metadata type lvm2
3 w- `. |+ c" k- |( V1 x4 Q& ^2 B: | y
& z* t0 ]* q) k9 y* Y
#lvscan$ S. o2 q0 s2 `3 K
inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸+ i% G' ?, M5 j$ }1 u7 ~( V
inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸
7 N* x' w0 z7 F/ a ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit+ h' L7 p* j' f) N. `: i
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit9 Y6 D; |) [4 \& a& f
& D- W9 c$ I% i! A! q; o! D2 G" s: n3 v; y% j; S
#lvdisplay /dev/vg_centos6/lv_root
# h+ {7 H9 {# J" B3 B --- Logical volume ---
3 q- F" g3 A/ L% `9 A) o4 A3 l LV Path /dev/vg_centos6/lv_root
7 C# V# a/ Q0 H8 E& k LV Name lv_root
% q. c9 i+ b! _; V& R$ b6 C. s VG Name vg_centos6
, q- Z `; i: i: N LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe
: h$ |: I. o+ Y. k$ G, N LV Write Access read/write
/ T. F4 N& A# Z+ ?& G/ C- f LV Creation host, time ,
0 \, R- T G2 y7 f3 U LV Status unavailable <==== 銝舐" I [2 ~, B' |9 j, w3 X8 p- j3 n5 A
# open 1
7 Q, l3 P/ @4 H: D: L5 B' Z- f- [ LV Size 21.84 GiB6 o( P1 F; S: Z5 L# t# E8 u" O7 G
Current LE 5591
0 z4 p3 Z: ? s* Y. K3 I5 m- W) n3 [ Segments 1
: }# W( Y; |7 H- q y ~* t3 G5 g Allocation inherit
/ O4 x2 O( B5 D, L* C5 M, L Read ahead sectors auto
0 N- \' y' J2 F) G- F - currently set to 256
5 J4 y y% i/ U; D Block device 253:2
* A. ]. Y' {1 j3 R; I: d( Q
5 l- j- g4 D: p2 u' w3 |- ]
+ j M2 V; v' p9 ?$ S0 m暺券鋆:
) J7 }8 M8 p! Y. Rvgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)
9 \; t- T- v+ b$ G9 Y% m3 }乩甈 LV:4 ^9 a {% V( M! V
#lvscan( S- m- s# i1 [% v8 g; S4 H7 k3 g& g
ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭# W& J# r3 F7 I7 s8 m/ G
ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭 F1 K2 {6 i) m* u
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
, K1 b9 r, }) h/ q" }6 Q- ` ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
! s( ] A- e9 A3 H: ]# P: Z9 I$ q" J! g. N
5 x3 G9 `7 j# y* L Mmount LVM:
2 R7 b$ U. f% k) Q0 D; \mkdir /mnt/lvmdisk, V1 g+ [, m- l1 n8 g
mount /dev/vg_centos6/lv_root /mnt/lvmdisk3 E# {! E1 \ l, E# n
憭批!7 `6 _7 e' ]% r( E6 t7 @7 ~8 M+ X
) T' U# N2 Y: a: E; @* s0 w
. @6 d2 |$ u4 o5 I, v3 d2 P
|
|