: http://linux.vbird.org/linux_basic/0420quota.php#lvm
8 H; N- M; \" c5 n5 z( k1 h5 Y2 F http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk& y, p# h0 V% ~5 g* W" |
5 L/ T _/ F0 {
[敶扳曉之LV摰寥] {/ s" i+ r4 \/ g, v* x) ^6 B5 `
) {. V, ~3 {; H" A- D' h# G% _0 @
1) lvextend -l 178813 /dev/11HD_vg/11HD_lv
% c0 C: B% s4 V$ D+ ]0 p3 Y6 H$ h+ j' N- N6 z1 X
4 {) t4 n; t+ C5 m- i( }) U
178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB/ J. D. ~1 {; T0 H$ t2 \- m( k
1 ^. P9 Q+ H+ C' q
& K( b6 j$ @9 ?# g5 N2 m2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv
+ @5 ^7 @% t, l9 a; K
% O4 L& @9 ?. _6 u6 I' J% x- x9 o9 T) e6 J! ~9 F" b
1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE
+ h6 k( ]% J8 F9 k* W
6 a0 Z0 X1 X- x- A$ e
6 w; N" E% ^8 n! F3)resize2fs /dev/11HD_vg/11HD_lv
$ v6 X" V& B" b4 [" Q, ? C# b* o
7 R# v. k8 B# ~+ }# c& B, v4 [2 D
P.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆7 A8 [9 U9 w2 _: T. E# p
雿輻 gdisk 脩, * d* ]" m: Y' H8 d
Hex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)+ o N6 O M+ S) H% |
5 i o8 P. [0 N) [6 _
0 U8 z: O8 E, [7 L k# _9 a( @[蝘駁小v]+ m' G& m; c" n( Q4 w# a, I; H' s9 E
pvscan or pvdisplay 瘥蝖祉憿舐內:
# P8 ?5 d5 t! zCouldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3
" g" {! G% h+ @- F5 K4 k. o9 GPV Name unknown device
: d5 h+ W M1 t$ T, Y Q% Y t7 N
望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:
" v2 D$ F4 v9 X8 M- d8 Bvgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV' ?. k5 u$ B' ?4 \3 K
pvscan or pvdisplay 撠曹憿舐內 "unknown device"4 J3 |& ?7 y, e( y4 ?* p
: n. i4 u# q \+ e9 d' X1 _4 z e5 `3 |/ U
[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]
: ^2 o5 m$ S7 `5 k2 }, }2 A: @#pvscan S* T, @7 y0 ~5 m. k
PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)
, g; u2 y8 S- p. k) ]# q/ z* R, U$ w PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]0 q4 T! q8 \8 }6 q6 D
Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]
: o1 @& B8 ]# k9 ?
- ?, c* h3 S* H5 n% l. ?( j) g#vgscan
# s' h# m0 ]- w; K- L Reading all physical volumes. This may take a while...
. q7 d8 m" T( D4 {) Q( B5 S& N Found volume group "vg_centos6" using metadata type lvm2
- j7 V4 M* Q: |$ D5 o8 Z Found volume group "vg_test" using metadata type lvm2
4 [0 N/ h5 s/ ] d3 M
" H! o+ s$ X* C; I, B6 z! n
+ X* L" n+ y$ b5 Q) ?#lvscan
* B; h+ [) Z# h8 o+ o inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸5 k5 j7 ^' g1 `* g
inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸
" B' _7 j2 Z( A ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
* O, d6 {& \. d7 G9 Q h ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit) T' W: M2 j# R/ Q6 e: q
% V6 _2 ?2 O% ^5 q; Q" F* V
& x6 ^ \) E, {4 j#lvdisplay /dev/vg_centos6/lv_root
5 I; N1 i; U$ r8 N% L --- Logical volume ---
! Z6 f' S+ v! C. @. ^/ { LV Path /dev/vg_centos6/lv_root* I# E* s1 O5 d% M
LV Name lv_root
! Z' C/ R: K1 U2 h6 {7 U3 t! M VG Name vg_centos6
( g! U/ P0 Q2 J3 G- a3 K LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe# [3 T# P, R' W* r* q( t5 ^% X! T
LV Write Access read/write
' S8 i; P2 a% t LV Creation host, time ,
2 }5 h9 U9 r s/ r LV Status unavailable <==== 銝舐
, H6 P0 J1 p- V# C9 D # open 1
5 K5 n7 F" z4 Q/ w1 @# M; F LV Size 21.84 GiB! @% k. A2 N8 ^* l. k
Current LE 5591 x& w$ M+ n, {7 N$ G
Segments 1" o) f& V! s% T( E1 r
Allocation inherit- T9 Q- w" s9 Z# ]' D9 y! c
Read ahead sectors auto8 f+ T5 [% j1 e
- currently set to 256! [; X1 Y W0 U1 m
Block device 253:2
% o* [4 P- u2 q6 l6 |1 {
% x2 Q: K- B0 J {( _- L
9 @- c; G3 z& t) n暺券鋆:
, z$ q/ v8 |: Kvgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)
. C' ]6 k4 I% D2 y9 X乩甈 LV:1 ~8 |2 m: p7 J* W
#lvscan
' c. ?+ `* E x, a! C/ I7 v ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭; [& G: F5 u! i( o9 p
ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭
$ J) z/ J7 q" P& e D4 ^+ q ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
3 X+ q; ~. @% l# S7 S/ Q ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
\1 E8 h- I, P+ }! u) g% K+ Q# Q
: B9 v& A- U1 ~; D5 W$ F% C8 @% H r: c+ z
mount LVM:3 L7 X7 |" W4 b4 V: r; l
mkdir /mnt/lvmdisk
% z; b3 S$ L; t* w, ^/ J9 mmount /dev/vg_centos6/lv_root /mnt/lvmdisk: R8 n: r* F( A, I+ X8 [8 Q* t& U6 G( Z
憭批!. ]8 b# j2 @0 b/ O2 J0 Y5 \
3 w8 N8 t! D, H7 k+ U
, o' w% ~. n( `5 p& N! X _ |
|