: http://linux.vbird.org/linux_basic/0420quota.php#lvm
9 X; A/ g" B5 e) c# X http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk
! E5 `: U0 P/ Z& H- F3 Y: J
( J- i, r8 X( i4 E[敶扳曉之LV摰寥]3 y4 S3 Q' k0 w/ s
6 N1 F" }+ b1 {2 @8 ^* k/ P
! b% Q1 g1 A1 A1 m) f9 h/ B; M1) lvextend -l 178813 /dev/11HD_vg/11HD_lv 4 K* h3 ^# g* n$ L
X7 f6 q" n) E& S: ?- C; x1 k
; }5 K) Z' X8 i* i4 T: E* v: q1 u0 o
178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB! Q K# D& ]% \+ {. R, [
$ D% W( g/ d: l
! k5 y M$ `. ]5 H* f& p2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv
3 ^3 O& J$ `* F+ K9 i/ F
% S" G* j0 P6 e, A
1 R0 [- C6 }3 P; P, j( s3 p& {) G1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE
9 `" b# \" Q9 L5 P5 S; e6 t1 `5 S4 s0 F! @9 u+ t
* _1 V/ H/ I' I3 J) J: W3)resize2fs /dev/11HD_vg/11HD_lv( v$ [/ L9 S/ W; r
" D! x `5 L/ ?/ K! a% G) U8 z* `$ g
, {7 F) d3 a2 l# r BP.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆
/ p* G0 l0 V M, K雿輻 gdisk 脩,
, q! E5 S% Z$ Z p1 {" nHex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager); g' A% O) t# N, U6 k
! z9 L: O( V' C0 V& r
2 K! @: ~2 M; w0 D9 @[蝘駁小v]7 K& U: _ d& m5 @3 }
pvscan or pvdisplay 瘥蝖祉憿舐內:- [$ F0 ^; x9 V; V0 ^ o; \# @0 y
Couldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3& G! B8 P/ ~% b# Q- G N
PV Name unknown device
2 Q2 X8 K4 m6 Y! [3 w2 T" `$ x8 R# p! F2 Q9 A B' Y. [7 J
望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:3 O% b1 H1 |& H. _3 B* j9 `2 T( E
vgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV% ?, _7 n/ ]% o7 ~1 I" R
pvscan or pvdisplay 撠曹憿舐內 "unknown device"
2 V l) X' @; F7 h. {% {& R4 C
l5 Z3 m( p: E: L. ]7 v& ^$ d N4 S7 G' {: a5 y) P+ e6 I
[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]; I8 K/ Y) P0 n3 i+ u
#pvscan
/ d# l) ? i$ [& w3 w+ S PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)
( ~9 b9 ?0 J, g3 g PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]
4 p- C3 n8 M9 |/ b Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ], c4 G- \ U" E1 g
8 q2 e" _/ M, @. O3 H- h
#vgscan
6 U% P3 x' G% a% b9 M4 m Reading all physical volumes. This may take a while...& }6 h o! `9 ^# l5 q- x) a) B
Found volume group "vg_centos6" using metadata type lvm2
" G. @' L2 F; C9 A* R! d, g: d% y Found volume group "vg_test" using metadata type lvm25 ^$ X. \" I5 K+ R7 V8 U$ |$ k/ t
% W$ J# p- O% ^, G! D
1 C4 `, ?# l% f' j! Q#lvscan
9 x' v# M" }0 ]$ } inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸( X! L- n) J; V6 S7 X4 ?5 j# x
inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸
) s/ ~) x8 S9 @* c( ]1 j ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit( U8 _! f6 L4 T F g7 y; y! S
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit% }( l: e) N3 u
0 G* {* @( ]0 D" U
9 x4 @( I$ ~5 }$ H#lvdisplay /dev/vg_centos6/lv_root
* Y# [6 x0 R8 Z `1 {4 Y --- Logical volume ---
]1 ?" e5 e5 O& C1 U0 A9 a* w LV Path /dev/vg_centos6/lv_root
: X% @& ^7 B' k# s4 h& ]) ^+ K LV Name lv_root
I0 @' W- {+ p2 Z% i) P0 ^, t VG Name vg_centos6; r# k5 S9 @) x3 l$ S: z" l
LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe/ g! L! {7 C; b* o" B; N
LV Write Access read/write7 K" H& _1 Z# r0 G X$ ^: v$ c
LV Creation host, time ,# e3 ~( l, f* ]- m5 D8 Y( u2 p
LV Status unavailable <==== 銝舐
4 g0 q8 r& u) k" p4 a. q. A/ z # open 1$ f( f# ~- g) R* b9 I
LV Size 21.84 GiB
) p8 R/ I7 G# c' A Current LE 5591! W7 s5 h/ U1 `' |% m3 b8 Z
Segments 1
& t! v7 C) ^9 u$ | Allocation inherit9 d% o: u. S4 O. h% ~
Read ahead sectors auto, M, q' l$ W8 q/ B' {7 b0 X
- currently set to 256
; m/ q' P, e, s* D Block device 253:2
; f% Y. [% J/ r3 {5 g' m" Q
0 G# Q$ \( |: \$ }3 e o9 G& C- M/ l6 ?
暺券鋆:
& \3 [! B- w+ ]/ Ivgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)
# G; A! B$ n( X. i4 p4 U乩甈 LV:* _9 h* Q: ^* Z
#lvscan( Q! z3 |$ X: A/ N1 z$ ]
ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭 ?" S" V6 t8 H# E" e" g# r* ^
ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭; G7 |/ t6 W- w$ u: x& T4 @. O
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
$ I# v3 w! Q6 S0 K! d: j* m ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
- o; E" z! p2 |" n! i8 z% c8 Z
0 N: Z2 ~4 Z1 v! N! T9 K
* N9 Z+ P5 ?4 |mount LVM:$ p3 B! {% w6 E! e6 x: V
mkdir /mnt/lvmdisk2 h2 ?- Y9 L) q7 z; y2 B
mount /dev/vg_centos6/lv_root /mnt/lvmdisk- H: h0 `. j6 }6 J* I
憭批!
$ S$ g. {( [4 F
4 U& e" _5 P* M& y. e, q3 c8 j1 |1 n7 r1 d6 u3 Y
|
|