A disk was enlarged but the filesystem is still the old size
Enlarging a virtual disk changes the block device. The partition, the LVM layers and the filesystem each have to be grown separately, in order.
What you see
The hypervisor shows a 200GB disk and df still shows 50GB. Nothing appears to have happened.
What is actually wrong
Four layers — disk, partition, physical volume, logical volume, filesystem — and each must be told about the new size in sequence.
Codes and articles
Fixes (2)
Grow every layer in order
LVM. Each command below only does one layer, which is why partial attempts appear to fail.
Confirm the kernel has seen the new size. If it has not, nothing else will work.
lsblksudo dmesg -T | tail -5
Rescan the device if the new size is not visible, which avoids a reboot.
echo 1 | sudo tee /sys/class/block/sda/device/rescanGrow the partition. growpart handles the alignment and the GPT backup header correctly.
sudo growpart /dev/sda 3sudo partprobe /dev/sda
Doing this by hand in fdisk means deleting and recreating the partition at the same start sector. It works, and one mistyped start sector destroys the filesystem. growpart is the safe equivalent.
Grow the physical volume.
sudo pvresize /dev/sda3sudo pvs
Grow the logical volume and the filesystem together.
sudo lvextend -r -l +100%FREE /dev/vg0/rootThe -r flag resizes the filesystem in the same command, choosing resize2fs or xfs_growfs as appropriate. It removes the most commonly forgotten step.
Confirm.
df -h /sudo lvs
df -h; lsblkGrow a partition and filesystem with no LVM
No LVM — common on cloud images.
Snapshot the machine first. There is no undo below this line.
Check the layout and which partition needs growing.
lsblksudo parted /dev/sda print free
Grow the partition.
sudo growpart /dev/sda 1sudo partprobe /dev/sda
Grow the filesystem. ext4 and XFS use different tools, and XFS can only grow while mounted.
sudo resize2fs /dev/sda1 # ext4sudo xfs_growfs / # xfs, by mountpoint
xfs_growfs takes a mount point, not a device, and refuses to work on an unmounted filesystem — the opposite of what most people expect from a resize tool.
If growpart is unavailable, install cloud-guest-utils rather than editing the partition table by hand.
sudo apt install cloud-guest-utils || sudo dnf install cloud-utils-growpart
df -hWhere this stops. This write-up was written and checked by hand. It says what each step changes, how to confirm it worked and how to reverse it, and anything destructive is flagged before you reach it. If it does not match what your machine is doing, search the Support Centre for the exact code or message — and when something needs a person, get in touch.