Extend an LVM volume
After the disk or the partition that holds the physical volume grows, LVM does not pick up the extra space by itself. Extend each layer from the bottom up: physical volume, logical volume, filesystem.
After a VPS upgrade the disk is expanded automatically; this guide is for the cases where that did not happen, or where you resized the disk yourself.
WARNING
Back up critical data before you change disks, partitions or LVM metadata. A mistake at any layer can make the volume unmountable.
Find the names on your system
Confirm the actual names before running anything below:
lsblk
sudo pvs
sudo vgs
sudo lvsThe rest of this guide uses a typical Ubuntu install:
| Disk | /dev/sda |
| LVM partition | /dev/sda3 |
| Volume group | ubuntu-vg |
| Logical volume | ubuntu-lv |
| Mount point | / |
Step 1: confirm the OS sees the new size
lsblkIf the disk reports the new size and the partition does not, grow the partition first (growpart, parted, or fdisk) before continuing.
Step 2: resize the physical volume
sudo pvresize /dev/sda3Confirm there is now free space inside the volume group:
sudo vgsThe VFree column should be non-zero.
Step 3: extend the logical volume
To use all available free space:
sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lvOr to grow by a specific amount, e.g. 20 GiB:
sudo lvextend -L +20G /dev/mapper/ubuntu--vg-ubuntu--lvStep 4: resize the filesystem
ext4:
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lvxfs (online resize, mount path):
sudo xfs_growfs /Step 5: verify
df -h
sudo pvs
sudo vgs
sudo lvsThe mount point should now report the new size. If lsblk still shows the old partition size, the disk-level resize step was not picked up - confirm with dmesg | tail or reboot.

