: http://linux.vbird.org/linux_basic/0420quota.php#lvm5 e$ I t- e& u3 c
http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk! w! T0 c9 A' f6 T* W ^3 r2 P
" u o& ~) f: ?$ _[敶扳曉之LV摰寥]
+ v) Y- O2 d$ S; T% f8 Z$ M$ ]! Q4 F
6 m8 P. x% p$ j1 S' G$ ~1) lvextend -l 178813 /dev/11HD_vg/11HD_lv
, N/ F. a8 `& b) j5 F5 w- j: v# J6 i/ P1 k$ ^5 d. ?
2 q1 r' ^# a* N% U5 [/ j" g$ ~
178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB
% A3 d2 e( m, _1 I A6 M" Y0 h& D1 N) G- r: ^ A
- L/ T2 |: [4 O1 o2 l, _2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv; t+ X; o* p7 b. @+ M7 O
5 `- b. Z; z% a; b i) V- K2 Y4 m# T
1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE; A. H# s5 @$ R: `+ A8 N! ~
4 | V; s7 m. D: L! I9 a/ w; T
3 T+ b8 E8 s1 X: Y' H" L3)resize2fs /dev/11HD_vg/11HD_lv" ]3 S$ K, r1 l! w8 L
& g3 d4 K- v2 c/ G. Z3 |2 _
! U5 e6 K+ I6 p/ E7 L% m& W% F3 g& rP.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆
; q: P4 W: l$ p# a+ L: v9 q/ Q雿輻 gdisk 脩,
* l- u5 T" M2 V1 J) {Hex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager). l& T2 X2 r7 e7 A4 t- }1 q
+ k2 W9 I; I" |, b- f8 e& S
$ r' F) g; s H" R[蝘駁小v]
2 i4 u- N8 J) Jpvscan or pvdisplay 瘥蝖祉憿舐內:
8 w( j. ?" E+ Y& ^" |Couldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3) \8 T. s0 u2 e1 @1 F$ w
PV Name unknown device
# ?: D# }* s( A9 \! Q1 f+ V( S1 x# ?' J. ~1 ^7 r. O; \
望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:
3 P+ T3 y" `9 s/ {' yvgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV8 V! {0 k& j+ W- p) ~% A
pvscan or pvdisplay 撠曹憿舐內 "unknown device"
2 S8 e2 V v( {, y% |& D: l+ b3 j: x
. S$ W6 ?( s. x: p[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition], }% G+ [6 G; E8 Y1 t0 R `5 r
#pvscan
2 d7 t& i) v, }+ _% g PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)
, T2 V7 N7 k3 I5 N6 h- _# [ PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]
: A1 G O! F. O Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]2 t7 Z K e) r1 \
+ C2 l5 o9 C S' @' N
#vgscan0 G, ]1 ?9 `& T9 W
Reading all physical volumes. This may take a while... T( n3 I' ]3 `) A
Found volume group "vg_centos6" using metadata type lvm2! H+ h$ x' M0 h4 c* ]: R A( T q
Found volume group "vg_test" using metadata type lvm2( ^" p8 [! {6 Q* e
_/ H3 f( O1 }) D
8 h% k' I7 W3 `- T" b1 Z#lvscan
9 r. i) J# r9 B) l+ ~/ E+ d inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸
* e8 g4 h. X& V6 A9 @ inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸
5 D. O: o5 Z" L- u; V: i ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
! w5 w% n' a: M# o ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit' D& x! p; m3 D' A2 Y
; g* f. f, S& x$ W5 N; W* z; N0 N3 ~8 ]; x! G: P1 q
#lvdisplay /dev/vg_centos6/lv_root+ a, B D7 t' f
--- Logical volume ---
8 g" D- N% K, q1 A2 L7 P; R LV Path /dev/vg_centos6/lv_root, h+ U. {1 _# g$ h
LV Name lv_root
9 J2 Z; ?3 k! T- [ VG Name vg_centos64 m6 P8 I h* o
LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe- E3 K: A( K: u3 S b/ |* G9 D
LV Write Access read/write
! }8 q$ f: _8 X7 y8 `* P LV Creation host, time ,8 b$ ^ o; C$ a# @8 B( N
LV Status unavailable <==== 銝舐" D9 ]* P. v+ m8 v) j
# open 1
" m" t/ r! G6 j# ~* i D7 F LV Size 21.84 GiB6 m0 Y0 P# X. P0 y
Current LE 5591! ^. Q1 Q- S. G$ Q3 H
Segments 1
9 s1 H1 I n3 h5 q/ K' a: h' F b R Allocation inherit
' y Z/ [) w) r/ s% y) a. A' C Read ahead sectors auto/ o+ ?3 u1 O |4 i
- currently set to 256
' Q- X: K4 b' v5 P Block device 253:2
- i4 ?' r) D2 D) A3 z( ]' C4 O7 l' h# w% S" u) X) ^9 C- y2 k9 l
6 \5 c8 F8 R" C8 m5 x暺券鋆:' Y0 N* t6 K8 I; X9 ^0 d' m8 C
vgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)! b7 X: S8 w) y9 y; E! N3 L
乩甈 LV:
9 L* Q) C3 h) p( I# u; Z#lvscan
9 c' G# G# K) C. A% B ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭
( l4 `2 F8 l/ `0 I5 P ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭
+ V( i9 E6 l( P, K' O ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit; r4 |$ a+ J/ m$ W6 I
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit
8 i- a* ?1 C, v0 Q( c4 u" L6 v* ?( j( m9 T( F, |" ~' r# n5 R; ?
! f; ~" U+ }2 P
mount LVM:1 A! F6 L- k/ d% Q* a5 J/ R& p
mkdir /mnt/lvmdisk- o0 a1 M* Z, H
mount /dev/vg_centos6/lv_root /mnt/lvmdisk
* ~8 S# `: [7 P7 d/ V6 Q& |憭批!" z- a: L; e. H: t9 e' R7 Q
$ p0 h6 C2 a. {
2 x& e: x+ m( H0 l1 b |
|