Updated: 28 September 2026 · Applies to: Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9

This guide grows an ext4 or XFS root partition that does not use LVM, while the system runs. It replaces the CentOS 7 example with Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9.

Note: Take a backup before you change partitions or upgrade the operating system. A mistake can make data unreadable or the server unbootable.

On a Ucartz VPS, the disk grows when you upgrade to a plan with more storage. If lsblk does not show the new size, Stop and Start the VPS from the VPS dashboard (client area › your VPS service), then continue below.

1. Check the layout

lsblk
df -hT /

In the examples the disk is /dev/vda and the root partition is /dev/vda1. Use your own names.

2. Grow the partition

dnf install cloud-utils-growpart      # AlmaLinux / Rocky
apt install cloud-guest-utils          # Ubuntu / Debian
growpart /dev/vda 1                    # disk, space, partition number

3. Grow the file system

xfs_growfs /                  # XFS (default on AlmaLinux / Rocky)
resize2fs /dev/vda1           # ext4 (default on Ubuntu / Debian)

Both work while the file system is mounted; no reboot is needed. Check the result with df -h /.

If the root file system is on LVM

growpart /dev/vda 2                                   # the partition that holds the LVM physical volume
pvresize /dev/vda2
lvextend -r -l +100%FREE /dev/mapper/almalinux-root   # -r also grows the file system

Note: growpart can only grow the last partition into free space directly after it. If another partition (for example swap) sits after the root partition, move or remove it first, or add the space as a new partition.

Common problems

  • NOCHANGE: partition 1 is size … it cannot be grown: the disk is not bigger yet, or there is another partition after it.
  • resize2fs: Bad magic number: the file system is XFS; use xfs_growfs.
  • XFS cannot shrink: XFS file systems can only be grown, never made smaller.

Ucartz services for this topic

Was this answer helpful? 0 Users Found This Useful (0 Votes)