Category: ‘LVM’

Resize your LVM volumes on the Fly

January 7, 2015 Posted by admin

Linux has made it pretty easy to resize LVM volumes using lvresize. I have been resizing the following ext3/ext4 filesystems for quite some time now without any issues. You can easily grow or shrink both the volumes and the file system with little effort.

lvresize!

Note: if you’re resizing down (shrinking), you’ll need to umount the shrinking volume first. If it is mounted, it’ll ask you to do it for you.
Note: if you’re resizing up (growing), There is no umount needed

Say you need to move 20GB from /home, to /var, and they’re in the same VG:

umount /home
lvresize –resizefs -L -1TB /dev/mapper/vg1-home
lvresize –resizefs -L +1TB /dev/mapper/vg1-home
mount /home

Done! (though the shrink command will take a little bit of time to finish)