Servers & Storage
Use this after making a disk bigger, for example after growing a VM's virtual disk in Proxmox or VMware, enlarging a VPS disk, or cloning onto a larger physical drive. Linux does not use the new space until you grow each layer: disk → partition → physical volume → logical volume → filesystem.
The examples use a default Ubuntu Server layout (/dev/sda3 holding volume group ubuntu-vg). Your device names may differ, so check them first.
Grow the disk
Increase the disk size in your hypervisor or hosting panel. If the VM doesn't see the new size without a reboot, rescan the disk (replace sda with your disk):
echo 1 | sudo tee /sys/class/block/sda/device/rescan
Check the layout
lsblk
sudo pvs; sudo vgs; sudo lvs
Note three things: the disk (e.g. sda, vda, nvme0n1), the partition number that holds LVM (e.g. 3), and the logical volume path (e.g. /dev/ubuntu-vg/ubuntu-lv).
Grow the partition
sudo apt install cloud-guest-utils # provides growpart, if missing
sudo growpart /dev/sda 3
Note the space between the disk and the partition number. For NVMe disks it is still growpart /dev/nvme0n1 3.
Grow the physical volume
sudo pvresize /dev/sda3
On NVMe the partition is /dev/nvme0n1p3. If pvresize reports no change, it was already resized and you can move on.
Grow the logical volume and filesystem
sudo lvextend -r -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
-r resizes the filesystem as well (ext4 and XFS), so no extra step is needed. To do it manually instead, run lvextend without -r and then:
# ext4
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
# XFS (RHEL, Rocky, Alma) – takes the mount point
sudo xfs_growfs /
Confirm
df -h /
The size should now match the new disk, minus the boot partitions.
Troubleshooting
growpartsays NOCHANGE – the partition already fills the disk, or the OS hasn't seen the new disk size yet. Rerun the rescan in step 1 or reboot.lvextendsays "no free extents" – the physical volume wasn't resized. Recheck step 4 withsudo pvs.- Disk uses a GPT layout and
growpartwarns about the backup header – this is normal after growing a disk.growpartfixes it automatically.

