Resize an LVM logical volume

Home > Search
  by

The lvextend command can be used to add space to 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 1.1 GB. There is no need to unmount the volume prior to increasing the size of the logical volume.

~]# lvresize -L 1.1G /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 -L 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 in the box below so that we can be sure you are a human.




Comments