Extending a Logical Volume

I seldom do this, but the few times I have, I’ve need to give myself a refresher which makes the process far longer than it should be. This is just here for reference.

  1. initialize the new disk for use by the LVM (use fdisk to find the disk) pvcreate /dev/disk_label

  2. add the PV to the desired VG (Use vgdisplay to find the VG name) vgextend vgname /dev/disklabel

  3. grow the LV. (Use df to find the path) lvextend -l +100%FREE /dev/path_to/lv

  4. resize the FS. (Use df to find the path) lvresize -r -l +100%FREE /dev/path_to/lv

UPDATE 1: If you should run into an error similar to…

fsadm: execvp failed: No such file or directory Command failed with status code 5.

…then you may be running into an issue I found on an Ubuntu bug report. The work around, as noted in the bug report, is to skip the “-r” above and just use…

resize2fs /dev/path_to/lv

This is a personal website. Unless otherwise stated, the content and opinions expressed here are my own and not those of my employer.