: http://linux.vbird.org/linux_basic/0420quota.php#lvm
+ M; t% F( h! Q7 l: X http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk
8 E; d' z- R/ p. ?7 T4 G
0 l q! N- D% k: ]# J8 ?; A[敶扳曉之LV摰寥]; J8 C0 a/ U' p/ C
6 P( M( R2 p( d2 Y
* H/ }- y. Z; M8 ?1) lvextend -l 178813 /dev/11HD_vg/11HD_lv + Z4 f3 ~+ _5 ?8 D- b3 \' H, h; Y, _
0 `+ S$ f0 ?. y. R# L# A* v1 f
' ^* a/ c3 g X5 C$ j" O178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB5 ]3 L$ f/ h- B/ y; C' e5 f5 I
* f6 L) \; D4 @7 G# C% u: T9 W( M7 ^6 w2 f$ M+ [( L
2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv
- n. m- @$ d4 P; `1 N$ q
. g- O2 L7 p! F5 Z5 t0 r/ c" v% d3 U# Q$ ]& N
1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE) ^# { F+ `. {* Q1 c. A: i/ O
; T7 ?& {3 K( n$ C6 x6 [9 s# _, S, Y3 d& N
3)resize2fs /dev/11HD_vg/11HD_lv
: F) ^& c+ H c- e2 f# f7 ?& f, m# d+ W$ q
% ?6 x/ g* m$ d5 C) r: p3 p' H
P.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆8 F8 w& _3 q7 v* r1 F4 r
雿輻 gdisk 脩, 9 z, i5 R3 {; c; ^
Hex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)
9 r6 N9 ]8 e V- s' c3 e0 u- C( G4 y6 c6 f6 F
+ G* a) D: g6 J* B% ^
[蝘駁小v] f* s9 g+ L Z
pvscan or pvdisplay 瘥蝖祉憿舐內:" K. I7 Q6 w* H0 Q- ?- I+ M
Couldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3# p9 T h) r& Z$ D8 K4 a6 i3 O
PV Name unknown device
7 |* y3 X6 r- C3 B
, ?6 u0 H7 C9 q, \望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:3 p( o( |5 a, L/ R2 f
vgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV
( X9 E; S y: U. w; Dpvscan or pvdisplay 撠曹憿舐內 "unknown device" M% s$ U. J* g! i
" O8 w) K; W. J& }9 O" p# z0 [) S" ]/ D: M5 z; a& Z; K
[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]5 E. E9 c$ |! l m9 J' K8 f
#pvscan- [: z: H& t$ e* i
PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)0 i- f7 C2 z- \" W* D: ^
PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]
9 H2 v) ^- s0 q8 O) z6 k Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]
, g; s% E( E9 ?! y; d0 Y
. _! N- P# H1 ~: p* z& ?$ y; q8 ^#vgscan
2 V% G( o5 H! f4 H Reading all physical volumes. This may take a while...
' Q. D0 y& ^( Y3 K5 S9 O i9 ~ Found volume group "vg_centos6" using metadata type lvm2
4 t. _# g3 ]/ z+ e F7 ^- r! Q Found volume group "vg_test" using metadata type lvm2
0 {0 I' v5 [ A. j R: Y& l @7 \; i$ K# g0 x% Y
3 G& G% t: c$ _) v G4 u6 y2 b#lvscan, I5 u1 F! P5 t# Q
inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸- s; @$ `1 M( G- ~: B1 m- m% M" P- U
inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸* i6 Y2 v" r5 w* {- V
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
1 f/ R1 }. q. Y$ u; h ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit0 q5 l! R% L4 n. G: `$ q
9 r* m; n$ l5 Q2 f; C6 h0 J
! x) {$ V( N3 Q a0 g# J
#lvdisplay /dev/vg_centos6/lv_root
: i* c: T* K! r1 L$ Z" f% f# ] --- Logical volume ---0 Y8 T$ H- k) j Y4 o6 u
LV Path /dev/vg_centos6/lv_root$ l% Y( O+ z, d. z4 C- z$ n( Q
LV Name lv_root
4 J3 Z; O6 U+ t/ @; A- U3 F# \ VG Name vg_centos6
5 b% A+ E7 @) ^$ g4 B; j' K& g. J LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe! f( F/ b, |9 A/ y" |3 H
LV Write Access read/write
/ M# }/ f1 c# K' h; l6 l LV Creation host, time ,6 `9 h; I5 m& Q
LV Status unavailable <==== 銝舐2 W& [/ r0 |9 P' g
# open 1' v. U, c2 u& e" b% U
LV Size 21.84 GiB
+ F2 R9 o1 g1 H$ S2 H& s( j' }( ^: e2 z" ~ Current LE 5591
: q+ p; H& v7 s( d2 e Segments 1
6 w$ ~0 P" E- ]# w9 ^6 _ Allocation inherit
! \- b! I) G% Q, P5 ~' B Read ahead sectors auto+ }3 `/ `' h- J! u0 A8 \4 u
- currently set to 256. S k% ^+ [0 n7 w
Block device 253:2
& f9 V8 n5 d6 A1 L. g" `/ N, f4 Q/ q8 y2 I
2 {" J' |) L) ]7 v3 v
暺券鋆:
4 n ^0 k9 g; n- R7 X% @% Xvgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)/ u5 a- g3 w* b2 F5 w3 O
乩甈 LV:( t; r& r8 R0 r9 k( L9 T: p
#lvscan. n, L" P9 C; O$ `6 J5 H$ V4 v, d
ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭
! F1 e6 `' \* K" z8 Q* ]4 j2 ^ ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭
/ @3 p+ A" ?$ G! ?0 F ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
- J- o. R2 F/ W" G' J- d ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit; _. b* D. N8 J9 o7 I" m
% R3 D4 W& N6 v. S( e+ A
4 e- L7 L' b2 Gmount LVM:9 I3 ]! J g0 k: \
mkdir /mnt/lvmdisk
% Y# Z s) P7 O! d) n, j- xmount /dev/vg_centos6/lv_root /mnt/lvmdisk) ^$ u! I+ y! p7 c, r8 C0 Z5 A
憭批!
2 m1 n; w! u. c* i; M; I8 T, G( H/ H4 z
Z& D) ~# S: y; m |
|