How to Resize a VPS Disk After Upgrading Your Plan

How to Resize a VPS Disk After Upgrading Your Plan

You pay for a bigger plan, the provider confirms the upgrade, and your server still reports the old disk size. That is normal. Most VPS providers grow the virtual disk behind the scenes, but the partition and filesystem inside your server do not grow on their own. Until you resize a VPS disk yourself, the extra space sits unused and your sites keep running on the old limit.

This guide walks through the full process on Ubuntu and Debian-based servers: check what changed, back up, grow the partition, and grow the filesystem. The commands are short, but order matters. Do them in the wrong order and you can lose data, so read the backup section before you touch anything.

Why the Extra Space Does Not Show Up Right Away

A VPS disk has three layers, and each one must grow in turn. First the provider grows the virtual disk. Then the partition table inside the server must use the new space. Then the filesystem must stretch to fill the partition. Most panels handle only the first layer. The other two are your job unless your provider states otherwise.

A common scenario shows why this matters. A small WordPress site on a 20 GB disk starts failing uploads and MySQL stops writing. The owner upgrades to a 40 GB plan, but df -h still shows 20 GB. The upgrade worked, the disk just has not been resized yet. If you want to catch this kind of problem early, learn how to monitor VPS disk space before it fills up and crashes MySQL so the next warning arrives before the site breaks.

Back Up Before You Resize Anything

Resizing a partition rewrites the partition table, and a typo or power cut during that step can leave the disk unreadable. Make a snapshot from your provider panel before you start. A snapshot takes a few minutes and gives you a way back if anything goes wrong. If your provider does not offer snapshots, take a full file backup of /etc, /var/www, and your databases first.

Do not skip this step on a live server. The resize commands below are routine and usually finish in seconds, but “usually” is not a guarantee. If you need a refresher on the snapshot flow, this walkthrough covers how to restore a VPS from a snapshot on Hetzner, DigitalOcean, and Vultr.

Check the Current Disk and Partition Layout

Start by confirming the provider actually grew the disk. Run:

lsblk
df -h

lsblk shows the raw disk size, for example 40 GB on /dev/vda, while the partition /dev/vda1 may still sit at 20 GB. df -h shows what the filesystem can use, which is the number your apps care about. If lsblk still shows the old size, the provider upgrade has not applied yet. Reboot the VPS once and check again; some providers only attach the larger disk at boot. If it still shows the old size after a reboot, open a support ticket instead of forcing anything.

Next, find out which filesystem you run:

lsblk -f
blkid /dev/vda1

Note whether the root partition uses ext4 or XFS. The resize command differs, and using the wrong one will fail. Also check whether you use LVM. If lsblk shows an lvm type, the steps below change: you would run lvextend before growing the filesystem. This guide covers the standard case, a plain partition without LVM, which is what most small VPS setups use.

How to Resize a VPS Disk in 6 Steps

With the backup done and the layout confirmed, work through these steps in order. Keep the SSH session open until the end so you can see any error right away.

1. Confirm the disk grew. Run lsblk and compare the disk size with the partition size. The disk should be larger than the partition.

2. Install growpart if it is missing. On Ubuntu and Debian:

sudo apt update && sudo apt install -y cloud-guest-utils

3. Grow the partition. The growpart resize partition step tells the partition table to use all free space on the disk. Replace vda and 1 with your own disk and partition number:

sudo growpart /dev/vda 1

If growpart reports “NOCHANGE”, the partition already uses the full disk, and the problem sits at the filesystem layer. Move on to step 4.

4. Grow the filesystem. For ext4, use resize2fs ext4 tooling:

sudo resize2fs /dev/vda1

For XFS, use xfs_growfs, which takes the mount point rather than the device:

sudo xfs_growfs /

Both commands run while the filesystem stays mounted, so there is no need to boot from a rescue image for the root disk in most cases.

5. Verify the new size. Run df -h again. The root filesystem should now show close to the new disk size. If the number has not changed, re-run lsblk to see which layer stayed small.

6. Test that services still work. Check the site loads, MySQL answers, and you can write a test file. A quick disk write check also tells you the filesystem is healthy after the change.

What to Do When the Resize Fails

A few errors show up again and again. “No space left on device” during the resize usually means the disk filled up completely before you started, and growpart needs a small amount of free space to write. Clear old logs or a stale backup first, then try again. resize2fs complaining about a bad superblock points at a different problem, often a wrong device name, so double-check lsblk output before you retry.

If growpart says the partition is already at its maximum but df -h still shows the old size, you likely grew the partition but skipped the filesystem step. Run the step 4 command that matches your filesystem. On some older setups the root partition is the last partition but a swap partition sits after it, blocking growth. In that case, move or remove the swap partition first, or ask the provider to resize from their side.

A full disk can also hide the real cause. Before you blame the resize, check what is actually eating the space with htop, df, and free to check VPS resource usage. Log files and old Docker images are common culprits, and clearing them sometimes frees enough room to finish the resize.

After the Resize: Keep the Disk Healthy

A bigger disk buys time, not a fix for runaway growth. Set up a disk usage alert at 80 percent so the next upgrade happens before the site breaks. Review what fills the disk every month: logs that never rotate, backups stored on the same disk they protect, and database tables that grow without cleanup are the usual suspects.

It also pays to check disk speed after a plan change, since some providers move you to different storage when you upgrade. This guide to benchmarking VPS disk I/O with fio before hosting a database shows how to confirm the new disk performs as expected. If write speed dropped after the upgrade, that is worth a support ticket while the change is still fresh.

To resize a VPS disk well, treat it as a short routine: back up, confirm the new size at each layer, grow the partition, grow the filesystem, and verify. Once you have done it a single time, the next upgrade takes about ten minutes, and your sites keep running on the space you already paid for.

Ditulis oleh

Firdaus Safari Putra

Founder, PT FirKaizen Digital Solutions

Firdaus Safari Putra adalah founder PT FirKaizen Digital Solutions. Ia membangun dan mengoperasikan infrastruktur server di balik panduan ini, dan menulis berdasarkan apa yang benar-benar ia jalankan, uji, dan ukur — bukan teori.