After a VPS plan upgrade, the virtual disk is bigger, but df -h still shows the old size. The extra space sits unused at the end of the disk until you grow the partition and then the filesystem into it. On modern Linux both steps can usually be done online, on the mounted root disk, with no reboot.

On VPS.DO, plan upgrades are requested through a support ticket. Once the disk has been enlarged, follow these steps.

Before you start: take a backup of important data. Growing is low-risk, but a typo on the wrong device isn’t.

1. Confirm the disk is bigger

lsblk
NAME    SIZE TYPE MOUNTPOINTS
vda     160G disk                 ← disk is 160G
├─vda1   79G part /               ← partition still 79G
├─vda14   4M part
└─vda15 106M part /boot/efi

The disk has grown, but vda1 hasn’t. If the disk still shows the old size, the kernel may need a rescan (echo 1 | sudo tee /sys/class/block/vda/device/rescan) or a reboot.

2. Grow the partition: growpart

growpart is in the cloud-guest-utils package (Debian/Ubuntu) or cloud-utils-growpart (RHEL family):

sudo apt install cloud-guest-utils        # or: sudo dnf install cloud-utils-growpart
sudo growpart /dev/vda 1

Note the space between disk and partition number: /dev/vda 1, not /dev/vda1. For NVMe: growpart /dev/nvme0n1 1.

CHANGED: partition=1 start=227328 old: size=165… end=… new: size=335… end=…

growpart only works if the partition is the last one on the disk, or is followed by free space. On many cloud images the root partition is number 1, but the small boot partitions (14 and 15 above) sit before it on disk, so it works.

3. Grow the filesystem

Check the type:

df -Th /

ext4:

sudo resize2fs /dev/vda1

XFS (takes the mount point, not the device):

sudo xfs_growfs /

Btrfs:

sudo btrfs filesystem resize max /

4. Verify

df -h /

The extra space is now available, with no reboot and no downtime.

If the root is on LVM

Many RHEL-family and some Ubuntu installations put the root filesystem on LVM. The chain is: partition → physical volume → volume group → logical volume → filesystem.

lsblk
# vda3  part → ubuntu--vg-ubuntu--lv  lvm  /

sudo growpart /dev/vda 3                     # 1. partition
sudo pvresize /dev/vda3                      # 2. physical volume
sudo lvextend -r -l +100%FREE /dev/ubuntu-vg/ubuntu-lv   # 3+4. LV and filesystem

-r makes lvextend resize the filesystem too. See extend an LVM volume.

Ubuntu server installs often create a root LV that uses only part of the volume group, leaving free space unused even on a fresh install. Check sudo vgs. If VFree is large, the last command alone claims it.

Data disks (not root)

Same process: grow the partition (if it has one), then the filesystem. If you formatted the whole disk without a partition, skip growpart and run resize2fs /dev/vdb or xfs_growfs /mnt/data directly.

Common errors

NOCHANGE: partition 1 is size … it cannot be grown — the disk isn’t bigger yet (rescan or reboot), the partition isn’t followed by free space, or it has already been grown.

growpart: command not found — install cloud-guest-utils or cloud-utils-growpart.

resize2fs: Bad magic number in super-block — the filesystem isn’t ext4 (it’s probably XFS, so use xfs_growfs), or you pointed it at the disk instead of the partition.

xfs_growfs: … is not a mounted XFS filesystem — pass the mount point (/), not the device.

The partition is MBR and the disk is now over 2 TiB — MBR can’t address beyond 2 TiB. Converting to GPT is possible (sgdisk -g) but needs care. Take a backup first.

Shrinking

Shrinking is a different story. ext4 can only shrink offline (unmounted), and XFS can’t shrink at all. Shrinking a VPS’s root disk usually means migrating to a new server. Plan sizes with growth in mind.

Quick reference

Step ext4 XFS
Partition sudo growpart /dev/vda 1 same
Filesystem sudo resize2fs /dev/vda1 sudo xfs_growfs /
LVM in between pvresize + lvextend -r -l +100%FREE same
Check df -h / same

Related: lsblk, LVM guide and disk full troubleshooting.

  • Linux
  • Storage
  • VPS