Extending the disk inside the system after increasing storage
When you increase storage from Editing a VPS or by moving to a larger plan, the virtual disk itself grows. But the operating system divides the disk into partitions, which hold file systems, and these may keep their old size until you extend them. This article explains how to check for this and extend them.
Changing partitions is a sensitive operation. Take a snapshot or a backup first, and copy the commands exactly after matching the disk and partition names to what appears on your server.
Step 1: Has the new space appeared?
Reboot the server if you haven't done so since the increase, then run:
lsblk
df -hT /lsblkshows the disk (such asvdaorsda) with its total size, and the partitions under it (such asvda1).df -hT /shows the size and type (ext4orxfs) of the root file system.
Possible results:
- The
dfsize matches the new size: the system extended itself automatically at boot, and you don't need to do anything. This happens on many modern templates. - The disk shows the new size, but the partition or file system shows the old size: continue with the steps below.
- The disk itself shows the old size: the increase hasn't been applied yet. Check that the change completed in History, reboot the server, and contact technical support if it stays the same.
Step 2: Extending on Linux
In this example, the disk is vda and the root partition is vda1. Replace them with what lsblk shows on your server.
Install the growpart tool if it isn't already installed:
apt install cloud-guest-utils # Ubuntu / Debian
dnf install cloud-utils-growpart # AlmaLinux / Rocky / Oracle / CentOSExtend the partition to the end of the disk. Note the space between the disk name and the partition number:
growpart /dev/vda 1If you see a NOCHANGE message, the partition already fills the whole disk.
Extend the file system according to its type in the df -hT / output:
resize2fs /dev/vda1Verify with df -h /; it should show the new size. No reboot is needed.
If lsblk shows a device of type lvm under the partition (such as almalinux-root), then after extending the partition with growpart, extend the physical volume, then the logical volume and the file system together:
pvresize /dev/vda2
lvextend -r -l +100%FREE /dev/mapper/almalinux-rootReplace vda2 and the logical volume name with what appears on your server. The -r option extends the file system too.
growpart extends a partition into the free space immediately after it. If there is another partition after the root partition (such as a swap partition), it won't find any space to grow into. In that case, use the new space as a separate partition, or contact technical support before moving any partition.
Extend the partition, then tell the ZFS pool about the new space, for example:
gpart recover vtbd0
gpart resize -i 4 vtbd0
zpool online -e zroot vtbd0p4Check the disk name, partition number and pool name with gpart show and zpool list before running these.
Extending on Windows Server
Right-click the Start button and choose Disk Management.
The new space appears after the C: partition, labeled Unallocated. If it doesn't appear, choose Action → Rescan Disks.
Right-click the C: partition and choose Extend Volume, then complete the wizard with the default values.
If the Extend Volume option is grayed out, there is another partition between C: and the new space (usually the Recovery partition). Don't delete it before taking a backup, and contact technical support if you're not sure.
How is this guide?
Editing server settings
Change the main settings, resources and add-ons of an existing VPS: CPU, memory, storage, IP addresses, backups and Mail-ready.
Permanently deleting a server
Permanently delete a VPS from your account: what to do before deleting, what gets deleted with it, and the alternative if you only want to stop renewal.