
by
Jeremy Canfield | Updated October 16th, 2017
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