I have a buch of logical volumes and I need to remove. I can able to remove them but when i remove lvm which has 5gb, i dont see
that space is alloted to root partition. Any ideas.Thanks
You will not see any change in partitions. However, if you remove logical volumes, you should see a corresponding increase in free space within its volume group. You can then extend volumes within that volgroup by the new free amount and then grow its filesystem.
Thanks for your reply.
I'm in confusion. I have LVM's like
/dev/mapper/VolGroup00-LogVol00 -10gb /
/dev/mapper/VolGroup00-LogVol01 -2gb /tmp
/dev/mapper/VolGroup00-LogVol03- 500mb /opt
/dev/mapper/VolGroup00-LogVol04 - 10gb /var
so if i remove /dev/mapper/VolGroup00-LogVol01, i should see 2gb free space right? how can I check that?
and also I need to increase /dev/mapper/VolGroup00-LogVol03 to 2gb from 500mb. how can i do this?
Thanks
You type vgdisplay and look for Free PE. Those free physical extents are what you can allocate to LogVol03. You would use lvextend -l [extents] [path to logvol]. But after that you have to use resize2fs to grow the filesystem.
Thanks it works.
---------- Post updated at 01:35 PM ---------- Previous update was at 01:15 PM ----------
it works with extending the size. But when i remove "/dev/mapper/VolGroup00-LogVol04 - 10gb /var" and I check for the Free PE with vgdisplay command, i see same free PE even after lvm. is there anything i missed? Thanks
Hopefully this illustrates how it should go
[root@F10 ~]# vgdisplay Beatles
--- Volume group ---
VG Name Beatles
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 4
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 2.00 GB
PE Size 4.00 MB
Total PE 511
Alloc PE / Size 511 / 2.00 GB
Free PE / Size 0 / 0
VG UUID ZEama4-bjx6-DUnz-xEAR-Zcir-YM1L-pHvZHp
[root@F10 ~]# lvdisplay Beatles
--- Logical volume ---
LV Name /dev/Beatles/John
VG Name Beatles
LV UUID HeNEwB-HYTo-ke3G-bNYJ-W2Xu-JNze-yaZ9tE
LV Write Access read/write
LV Status available
# open 0
LV Size 512.00 MB
Current LE 128
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
--- Logical volume ---
LV Name /dev/Beatles/Paul
VG Name Beatles
LV UUID toWU48-FghQ-WkBy-mPxH-s9bP-ORpF-Xh6XZ7
LV Write Access read/write
LV Status available
# open 0
LV Size 512.00 MB
Current LE 128
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:3
--- Logical volume ---
LV Name /dev/Beatles/George
VG Name Beatles
LV UUID iZivOZ-ZBoo-vSG6-1Lvn-7FcC-RAPx-GJe5mR
LV Write Access read/write
LV Status available
# open 0
LV Size 512.00 MB
Current LE 128
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:4
--- Logical volume ---
LV Name /dev/Beatles/Ringo
VG Name Beatles
LV UUID ClIOwj-P1n0-i6MB-F4aS-CSlK-puUZ-ZAp0fn
LV Write Access read/write
LV Status available
# open 0
LV Size 508.00 MB
Current LE 127
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:5
[root@F10 ~]# lvremove /dev/Beatles/John
Do you really want to remove active logical volume "John"? [y/n]: y
Logical volume "John" successfully removed
[root@F10 ~]# vgdisplay Beatles
--- Volume group ---
VG Name Beatles
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 2.00 GB
PE Size 4.00 MB
Total PE 511
Alloc PE / Size 383 / 1.50 GB
Free PE / Size 128 / 512.00 MB
VG UUID ZEama4-bjx6-DUnz-xEAR-Zcir-YM1L-pHvZHp
There's enough room now for a new Beatles member.