LVM Shenanigans

Making a larger partition from new disk space

Enlarge the partition with parted

parted (select disk)
resizepart #
100%

LVM: we need to tell the LV subsystem about the new disk space; we do this by first extending the physical volume which occupies the partition:

pvresize /dev/sdX#

then the logical volume

lvresize -r -l 100%PVS /dev/mapper/XXXXXXXX

Moving disk space around

File system check the volume to be shrunk, then shrink it by several GB more than you will be reclaiming. It will be enlarged later. Shrink the volume by your desired amount.

Assuming an end goal of 200G

e2fsck -f /dev/foo/roo
resize2fs /dev/foo/roo 180G
lvreduce -L /dev/foo/roo 200G

Enlarge your target voume to take all now free space

lvresize -r -l 100%PVS /dev/foo/boo

Fix the filesystems

resize2fs /dev/foo/roo
resize2fs /dev/foo/boo
Back to top