When you upgrade a VPS plan, the virtual disk usually gets bigger, but your partition and filesystem stay the old size. This guide shows how to grow a Linux VPS disk online with growpart and the right filesystem tool, without reinstalling.
Before you start
- The disk has already been enlarged in your VPS panel (for example Virtualizor or VirtFusion), and the VPS was rebooted if required.
- A recent backup. Resizing is safe but mistakes with partitions are not.
- Root or sudo access.
Check the current layout
lsblkExample: disk vda is 80G but partition vda1 is still 40G. Also check filesystem types:
df -hTInstall growpart
sudo apt install -y cloud-guest-utilsOn AlmaLinux/Rocky: sudo dnf install -y cloud-utils-growpart.
Extend the partition
Note the space between disk and partition number:
sudo growpart /dev/vda 1Use the actual partition number holding root (for example 3 on some layouts). If the root partition is not the last one on the disk, growpart cannot extend it; ask support or plan a reinstall.
Resize the filesystem
For ext4:
sudo resize2fs /dev/vda1For XFS (default on AlmaLinux/Rocky), pass the mount point:
sudo xfs_growfs /If you use LVM
- Grow the partition holding the physical volume:
sudo growpart /dev/vda 3. - Grow the PV:
sudo pvresize /dev/vda3. - Extend the logical volume and filesystem in one step:
sudo lvextend -r -l +100%FREE /dev/mapper/vg-root.
See Linux LVM basics for details.
Verify
df -h /The size should now match the new disk.
Troubleshooting
- "NOCHANGE: partition 1 is size ... it cannot be grown": the kernel has not seen the larger disk; reboot the VPS, then retry.
- resize2fs says the filesystem is already the size: you skipped growpart, or targeted the wrong partition.
- Disk still old size in lsblk: the upgrade did not resize the disk, or needs a full stop/start from the panel.
Frequently asked questions
Can I do this without downtime?
Yes. growpart, resize2fs and xfs_growfs work on mounted filesystems.
Can I shrink a disk the same way?
No. XFS cannot shrink at all, and shrinking ext4 requires unmounting. Providers rarely support disk downgrades.
Does Windows need this?
On Windows, extend the volume in Disk Management; see Windows disk management.
