: http://linux.vbird.org/linux_basic/0420quota.php#lvm$ ?& g! C6 s8 ]9 h
http://linux.vbird.org/linux_basic/0230filesystem.php#gdisk
# _( e; x& C- R5 _+ n5 x% m& Z! @& ?/ P- v$ f2 U
[敶扳曉之LV摰寥]" f1 c7 u, \: L1 t! c1 \/ K
4 B, R; ]6 O) A4 h# f
, p0 M& G, t, u+ |0 U Y; e1) lvextend -l 178813 /dev/11HD_vg/11HD_lv
& f" m& g0 ~: o# ]
- d% z/ `* o3 B5 t# }* @
, i" s$ ?# I2 D% d178813舀炬憭抒size,憒2.7T=178813 PE, 1 PE=16MB1 a* p! D# o# u/ u- ~% w
* E8 g7 q. Y: [$ u9 {7 l
* N c- f M/ r" b+ t2)lvresize -l 1966943 /dev/11HD_vg/11HD_lv8 i8 U4 J* A+ D I, C, O0 N
6 u, J& D! C; ^5 M; N+ o' l
( u/ H2 b; |5 ^8 c+ G1 [3 r5 l
1966943臬憭批蝮編ize,憒30T=1966943 PE , 臭誑 vgdisplay 11HD_vg 亦桀 vg 閰喟敦鞈,咨otal size and free size ,桐賣 PE, y; {4 C% d; K8 _3 |
) L- Y+ m& O; [* W. d6 Y
0 U0 B! J% b Q. w Y
3)resize2fs /dev/11HD_vg/11HD_lv
/ x6 e7 b: g6 k+ |( b7 e
, w, k; {1 a/ y* f5 O
3 C+ c* G' c! _( P3 v2 SP.S憒曆迷disk隞,雿輻 yum install gdisk 摰鋆
8 Y3 ^5 R( ^! h雿輻 gdisk 脩, 8 }2 ~. Y" X. j) p: {
Hex code or GUID (L to show codes, Enter = 8300): 頛詨8e00 ===> LVM (logical volumn manager)9 w, h4 u# j# `0 ?
) i8 e: O0 o7 M! K+ g% q v* C5 J3 u d: y
[蝘駁小v]" O# p2 r: }$ U8 p* W; \5 i6 H
pvscan or pvdisplay 瘥蝖祉憿舐內:
( E7 x; {% e! s( I4 lCouldn't find device with uuid WWeM0m-MLX2-o0da-tf7q-fJJu-eiGl-e7UmM3* s: w3 h \$ Y
PV Name unknown device, Y( [) m3 `% |( l- B
. l# j8 y- e# |0 m4 R
望潛′蝣瘥,蝝汲G,甇日蝘駁 PV:
8 b7 o w8 o' m' V; f6 Cvgreduce --removemissing --force 11HD_vg #雿銋 LV芷,撱 LV! l- c8 T4 k* S& S
pvscan or pvdisplay 撠曹憿舐內 "unknown device"
- E/ ~3 r J; t% I \9 o9 \8 P
3 y9 U6 v: R' q$ G7 _: f6 f) s: W ~' E' C9 l
[憒雿mount 撌脣冽潔憿蝖祉找LVMpartition]
+ P- v' w& }, f#pvscan
' O0 E: {+ y% ^, S: D- e PV /dev/sdc2 VG vg_centos6 lvm2 [27.46 GiB / 0 free] <===== 曆犖唾mount LVM (撌脣冽澆仿蝖祉)8 }* `$ C8 `& P5 I
PV /dev/sdb2 VG vg_test lvm2 [18.92 GiB / 0 free]2 E l' ], ]$ j Z
Total: 2 [46.39 GiB] / in use: 2 [46.39 GiB] / in no VG: 0 [0 ]
6 c. `$ r& l# e7 d' @4 s- c
' _1 [: A. m) d; \# l( s#vgscan' m0 u, i% q* B+ N
Reading all physical volumes. This may take a while...
3 F9 ~) ?1 L$ ?+ d& O0 _ Found volume group "vg_centos6" using metadata type lvm26 I/ A/ S8 Y& @, S# a, N7 A2 D( ?! o& T
Found volume group "vg_test" using metadata type lvm2
1 Y' J! G# t3 {) P
( S% L+ ~8 I; z
& R+ j3 }. f: r0 j; w9 i' Y% N#lvscan( M! r9 j& w: Y: i* X8 P
inactive '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====芸
& | Y: Z5 r2 _/ `4 j/ \$ C inactive '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====芸: p( X& e [7 v: B, }% V
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit4 n* k: ^% }) k; n! U3 X
ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit8 w$ H& l8 a3 @! c( k0 |& a
, B7 S- h+ I9 f) E) ?; l
2 ~ @8 U; S( e0 t8 o
#lvdisplay /dev/vg_centos6/lv_root# j7 X6 s7 y/ E9 w& ^6 z% H
--- Logical volume ---
6 K, a6 i) z. J# V( C% P( W3 \ LV Path /dev/vg_centos6/lv_root# P! U. ~3 P7 T2 D6 Z n) K7 X$ @$ a' n
LV Name lv_root
/ i r# S7 P9 g/ z$ D3 @( \% ? VG Name vg_centos6
0 m3 _- \# [7 i- N/ B LV UUID 0nFiiu-yDQG-1JUB-JI2r-uoTe-Hupi-WGisCe! u$ Y+ g! r3 N8 H8 p) [
LV Write Access read/write/ M6 [4 V7 E' Q) K& V2 p. F
LV Creation host, time ,& T. U- o6 V% o
LV Status unavailable <==== 銝舐
2 |, [- W+ ]% _7 o8 k& Y) z: y3 K # open 1- y" J2 \! b0 ~$ G' I! x
LV Size 21.84 GiB
7 z2 ^* J5 l- P4 k) a8 X* a4 t Current LE 5591; j) G2 Y0 a& _' K
Segments 1, t- T" q, d% W: b4 x7 `
Allocation inherit
( T0 B1 \7 f8 V. W Read ahead sectors auto$ P9 r1 | K! x! H6 _ \
- currently set to 256
: G0 M- q% T2 c- r/ G# N" d8 r Block device 253:2+ N& v L9 }+ n) b# Q* @- R
9 X- G) e' Z- k- L. Z z- [& i
9 E! v2 I4 e* J, O+ S
暺券鋆:" j8 p4 ]/ x2 v( ?
vgchange -ay vg_centos6 <====== VG (憒 VG ==> vgchange -an vg_centos6)
- k9 }1 x8 w! ]: J; F乩甈 LV:
8 _/ \4 q4 v7 L0 e2 W% N4 V#lvscan' w$ P. \* u3 d+ O, u
ACTIVE '/dev/vg_centos6/lv_root' [21.84 GiB] inherit <====撌脣鈭
D1 R' ]) n& C$ ]5 x ACTIVE '/dev/vg_centos6/lv_swap' [5.62 GiB] inherit <====撌脣鈭0 Y: j9 h% Z8 z3 G& c% M4 s) j
ACTIVE '/dev/vg_test/lv_root' [16.98 GiB] inherit
* j' n# G7 H1 p% q5 w* m" r/ }9 z7 V ACTIVE '/dev/vg_test/lv_swap' [1.94 GiB] inherit1 l$ e, L( ^" c' e0 }1 P. e1 X
/ n) B0 R3 n' C$ ]% \+ M! i! r' x7 z: [9 p
mount LVM:
3 x0 i4 Z! w" }, U- Pmkdir /mnt/lvmdisk$ l2 N& ]2 C+ B5 b) m- [' G5 v+ n
mount /dev/vg_centos6/lv_root /mnt/lvmdisk
6 L2 Y# x3 s6 n" n- r2 f. N5 N憭批!
$ I1 F6 X. V# O. d- ?4 i
/ l& J+ r H- y* P; g- A* m9 T- S3 U# m9 e7 p; y
|
|