Made the VM disk bigger and had to tell the OS to actually use the extra space. Took 3 steps.
1. Grow the disk (hypervisor side)
Resized the virtual disk in Proxmox/VirtualBox, adding extra space (e.g. +20G). OS doesn't see it yet.
2. Grow the partition
sudo apt install cloud-guest-utils
sudo growpart /dev/vda 3
-
growpartstretches a partition to fill new space. - The
3is the partition number (fromlsblk), not part of the disk name. - Ignored an unrelated
shim-signederror during install — didn't affect anything.
3. Grow the filesystem
Checked for LVM first:
sudo pvresize /dev/vda3
Got "command not found" → no LVM here, skip it.
Then resized the filesystem directly:
sudo resize2fs /dev/vda3
(Use xfs_growfs / instead if filesystem is XFS, not ext4.)
4. Confirm
df -h /
Showed full new size. And we're done! No reboot needed.
Cheat sheet
| Check disk/partitions | lsblk |
|---|---|
| Check filesystem usage | df -h / |
| Grow partition | sudo growpart /dev/vda 3 |
| Grow filesystem (ext4) | sudo resize2fs /dev/vda3 |
| Grow filesystem (XFS) | sudo xfs_growfs / |
Remember
- Back up/snapshot before resizing.
- "Command not found" on LVM tools = you're not using LVM, that's fine.
- Whole thing can be done live, no reboot.
Top comments (0)