LVM2 works as expected

The comments below are just a reminder for the next time I’ll need to increase the size of a mounted LVM2 enabled filesystem.

If you don’t have enough space left in the existing volume group, you have to create and add a physical volume.

When the disk is added to a running system, you may need to reinitialize the adapter to get the disk listed.

echo "- - -" > /sys/class/scsi_host/host#/scan

pvcreate /dev/md6 Physical volume "/dev/md6" successfully created

Extend the existing volume group with the new physical volume:

vgextend system /dev/md6 Volume group "system" successfully extended

Use ‘lvdisplay’ to search for the correct logical volume name you want to extend. In my case I needed to extend the logical volume on which the /var filesystem lies. This filesystem is named differently in the df output. The example below shows an 5G increase of the var logical volume.

lvextend -L +5G /dev/system/lv-var Extending logical volume lv-var to 23.00 GB Logical volume lv-var successfully resized

The final step is to resize the filesystem to expand to fit in the resized logical volume:

resize2fs /dev/system/lv-var resize2fs 1.40-WIP (14-Nov-2006) Filesystem at /dev/system/lv-var is mounted on /var; on-line resizing required old desc_blocks = 2, new_desc_blocks = 2 Performing an on-line resize of /dev/system/lv-var to 6029312 (4k) blocks. The filesystem on /dev/system/lv-var is now 6029312 blocks long.

Done and ready for use!