Updated: 28 September 2026 · Applies to: Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9
Ubuntu 18.04 is end of life; these steps work on Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9. When you enlarge a virtual disk, Linux sees the bigger disk but the partition and file system keep their old size until you grow them. This can be done while the server runs.
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.
Ucartz services for this topic
- KVM VPS hosting: NVMe SSD and full root access, with Free Basic Managed Support.
- Unmanaged dedicated servers: full root access and free IPMI KVM, with Free Basic Managed Support.
- Linux server management: hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.
