Step1:
I have 3 lvm enabled partitions with sizes
300M,200M,100M.
Step2:
I converted them into physical volumes.
Step3:
I made volume group(VG) out of those physical volumes
i.e, total size of VG is 600M
Step4:
I created a logical volume of 100M under the (VG) volume group.
----------------------------------------------------
Now the volume left under the VG is 500M
Q:I want reduce the size of VG by 300M(500M-300M).
Please tell me the necessary commands and required explaination.
Code:
# lvdisplay
--- Logical volume ---
LV Name /dev/drink/coke
VG Name drink
LV UUID 8w5OmT-6u7F-80Eb-F3cX-KYYm-1USF-3g0I07
LV Write Access read/write
LV Status available
# open 0
LV Size 100.00 MB
Current LE 25
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
Code:
# pvdisplay
--- Physical volume ---
PV Name /dev/sda8
VG Name drink
PV Size 290.21 MB / not usable 2.21 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 72
Free PE 47
Allocated PE 25
PV UUID Z01VCO-DVL0-LENB-FtaU-CGQq-pphT-I9hEKD
--- Physical volume ---
PV Name /dev/sda9
VG Name drink
PV Size 196.08 MB / not usable 4.08 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 48
Free PE 48
Allocated PE 0
PV UUID JXp7NM-Bxul-ElSJ-ONjD-dYg8-I1s3-2n639W
--- Physical volume ---
PV Name /dev/sda10
VG Name drink
PV Size 101.94 MB / not usable 1.94 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 25
Free PE 25
Allocated PE 0
PV UUID 9sTrmU-Brl2-yzT5-z3MO-o7P3-ksZ9-OE9O5d
Code:
# vgdisplay
--- Volume group ---
VG Name drink
System ID
Format lvm2
Metadata Areas 3
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 3
Act PV 3
VG Size 580.00 MB
PE Size 4.00 MB
Total PE 145
Alloc PE / Size 25 / 100.00 MB
Free PE / Size 120 / 480.00 MB
VG UUID ACF0T4-B80c-iwhk-u6GN-t53Q-KnCj-nyp0B7
Code:
# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
coke drink -wi-a- 100.00M
# pvs
PV VG Fmt Attr PSize PFree
/dev/sda10 drink lvm2 a- 100.00M 100.00M
/dev/sda8 drink lvm2 a- 288.00M 188.00M
/dev/sda9 drink lvm2 a- 192.00M 192.00M
# vgs
VG #PV #LV #SN Attr VSize VFree
drink 3 1 0 wz--n- 580.00M 480.00M
Code:
# vgreduce /dev/drink /dev/sda8
Physical volume "/dev/sda8" still in use