Quick answer: After a disk upgrade the virtual disk is bigger, but the partition and filesystem inside your OS usually still need growing: growpart /dev/vda 1 then resize2fs /dev/vda1 (ext4) or xfs_growfs / (XFS). Check with df -h before and after.
Overview
A disk has three layers: the virtual disk (grown by the upgrade), the partition table, and the filesystem. Many OS templates grow the last two automatically at boot (cloud-init); when that doesn't happen, two commands finish the job. Take a backup first — partition operations are safe in the normal case but unforgiving of mistakes.
Before you start
- The disk upgrade is paid and applied, and the VPS rebooted.
- A fresh backup of important data.
- Root SSH access;
cloud-guest-utils(Ubuntu/Debian) orcloud-utils-growpart(Alma/Rocky) installed forgrowpart.
Step-by-step guide
- See the layout — confirm the disk grew but the partition didn't:
Typical VPS disk islsblk df -h/dev/vdawith the root partition/dev/vda1(sometimes/dev/sda). - Grow the partition (note the space between disk and partition number):
apt install -y cloud-guest-utils # Ubuntu / Debian, if growpart is missing growpart /dev/vda 1 - Grow the filesystem. Find the type with
lsblk -f. For ext4:
For XFS (default on AlmaLinux/Rocky) — grow by mount point:resize2fs /dev/vda1xfs_growfs / - Verify:
df -h /
Common issues
NOCHANGE: partition ... is size ...? The partition is already grown — go straight to the filesystem step.- Using LVM? The chain is longer:
growpart→pvresize /dev/vda2→lvextend -r -l +100%FREE /dev/mapper/your-root(the-ralso grows the filesystem). - df still shows the old size? You grew the partition but not the filesystem — run step 3.
When to contact support
Not comfortable resizing a live disk, or the layout looks unusual (multiple partitions, custom LVM)? Open a support ticket — we'd rather help than have you lose a filesystem.
Frequently asked questions
Why is the disk bigger but df shows the old size?
The virtual disk grew, but the partition and filesystem must be expanded inside the OS: growpart, then resize2fs (ext4) or xfs_growfs (XFS).
Is growing a filesystem safe on a live server?
Online growth of ext4 and XFS is routine and safe in the normal case, but always take a backup first.
Can I shrink a disk the same way?
No — shrinking is not automatic and XFS cannot shrink at all. Free the space and open a ticket to discuss a downgrade.
Related articles
Need a hand? Contact Cloud2Y support →
