Linux VPS

Grow the disk on a Linux VPS after an upgrade (growpart and resize2fs)

After your VPS disk is enlarged, extend the partition and filesystem to use the new space: check with lsblk, run growpart, then resize2fs or xfs_growfs, including LVM setups.

IntermediateLinux VPS2 min read

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

lsblk

Example: disk vda is 80G but partition vda1 is still 40G. Also check filesystem types:

df -hT

Install growpart

sudo apt install -y cloud-guest-utils

On AlmaLinux/Rocky: sudo dnf install -y cloud-utils-growpart.

Extend the partition

Note the space between disk and partition number:

sudo growpart /dev/vda 1

Use 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/vda1

For XFS (default on AlmaLinux/Rocky), pass the mount point:

sudo xfs_growfs /

If you use LVM

  1. Grow the partition holding the physical volume: sudo growpart /dev/vda 3.
  2. Grow the PV: sudo pvresize /dev/vda3.
  3. 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.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.