Carlo Bertini's personal website

Web Developer/ Devops and problem solver adept at programming

How to resize LVM logical volumes with ext4 as filesystem

# Unmount the filesystem and check its’ LV umount /mnt/foo e2fsck -f /dev/mapper/vg0-foo # Shrink ext4 and then the LV to the desired size resize2fs -p /dev/mapper/vg0-foo 40G lvreduce -L 40G /dev/mapper/vg0-foo # Before continuing, run e2fsck. If it bails because the partition # is too small, don’t panic! The LV can still be extended with # lvextend until e2fsck succeeds, e.g.: # lvextend -L +1G /dev/mapper/vg0-foo e2fsck -f /dev/mapper/vg0-foo