Updated: 28 September 2026 · Applies to: xfsprogs 6.x and LVM 2.03 on AlmaLinux and Rocky Linux 9 and 10, RHEL 9 and 10; also Ubuntu 24.04 and 26.04 and Debian 13 with XFS
XFS is the default file system on AlmaLinux, Rocky Linux and RHEL. It can be grown while it is mounted and in use, with no downtime, using xfs_growfs. It cannot be shrunk. Growing always has two parts: first make the space underneath bigger (the logical volume or partition), then grow the file system into it.
Before you start
- Check the current state:
df -hT(file system sizes) andlsblk(disks, partitions and volumes). - Take a backup. Growing is safe, but a typo in a disk name is not.
- The volume group needs free space (
vgs, column VFree), or you add a disk first (step 1).
1. Add a new disk to the volume group (if there is no free space)
pvcreate /dev/sdb vgextend almalinux /dev/sdb vgs
Replace almalinux with your volume group name from vgs (on Rocky Linux it is often rl, on RHEL rhel).
2. Grow the logical volume and the file system in one step
lvextend -r -L +20G /dev/almalinux/root
-r grows the file system right after the volume, so you do not need a separate command. Use -l +100%FREE instead of -L +20G to use all free space.
Or grow the file system separately
If the volume or partition is already bigger (for example after lvextend without -r, or after a VPS disk upgrade and growpart), grow XFS on its own. xfs_growfs takes the mount point:
xfs_growfs / # grow to fill the device xfs_growfs -n / # only show the current geometry, change nothing
The output ends with a line such as "data blocks changed from 204800 to 307200".
Growing a partition (no LVM)
On a VPS where the disk was enlarged and / sits directly on a partition, grow the partition and then XFS:
growpart /dev/vda 1 xfs_growfs /
growpart is in the cloud-utils-growpart package (AlmaLinux, Rocky Linux, RHEL) or cloud-guest-utils (Ubuntu, Debian).
Check the result
df -hT /
Common problems
- "is not a mounted XFS filesystem":
xfs_growfsneeds the mount point of a mounted file system, for example/or/data. - Nothing changes: the device underneath was not grown. Check with
lsblk, then runlvextendorgrowpartfirst. - "Insufficient free space" from lvextend: the volume group is full. Add a disk (step 1).
- Need a smaller XFS file system? That requires backup, re-creation and restore; see how to shrink an LVM volume with XFS.
Official documentation: xfs_growfs manual page and lvextend manual page.
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.
