FreeKB - 0 Resize an LVM logical volume using the LVRESIZE command
Resize an LVM logical volume using the LVRESIZE command

Before resizing a logical volume, you'll need to ensure the physical volume has available space.

The lvresize command can be used to add or remove space from an LVM logical volume. For example, let's say /dev/myVG/myLV is 1 GB.

~]# lvdisplay
. . .
LV Size    1.0 GiB


To increase myLV to use all of the free extents. There is no need to unmount the volume prior to increasing the size of the logical volume.

~]# lvresize --resizefs -l +100%FREE /dev/myVG/myLV


To decrease myLV, you will first need to unmount the volume. For example, lets say /dev/myVG/myLV is mounted on var.

~]# umount /var


You can now reduce the size of the volume. In this example, myLV is reduced to 900 MB. Prior to reducing the size of the volume, ensure no data is using the end of the sectors that will be eliminated.

~]# lvresize --resizefs --size 900M /dev/myVG/myLV


Remount the volume.

~]# mount.ext4 /dev/myVG/myLV /var


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 057a0 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |