Growing Disks Without Downtime: Why Rocky Linux Bets on XFS
Rocky Linux defaults to XFS on LVM — great for online growth and parallel I/O, but shrinking is impossible. Here's how to plan around that one-way door and grow volumes live.
04 Sept 2025, 12:04 UTC

You provisioned a Rocky Linux server with a 100 GB root volume. Eighteen months later, the application data has eaten 90 GB, the monitoring alerts are firing, and the last thing you want is a maintenance window to rebuild the disk. This is exactly the scenario Rocky Linux's default storage stack — XFS on top of LVM — is designed to handle, and it handles it well. The catch is that the design makes a deliberate one-way bet: growing is trivial, shrinking is effectively impossible. Understanding that trade-off changes how you should plan partitions from day one.
What XFS actually gives you
XFS is a 64-bit journaling file system originally developed by SGI and long favored in enterprise Linux for large files and high-throughput workloads. Rocky Linux, following its upstream RHEL lineage, formats the root partition as XFS by default (you can confirm this on any fresh install with df -T).
Two design choices matter most in practice:
- Allocation groups. XFS divides the file system into multiple allocation groups, each managing its own free space and inodes. On a multi-core server, several processes can write concurrently to different groups with minimal lock contention — a real advantage for database and container workloads.
- Delayed allocation. Rather than deciding where data lives on disk at write time, XFS buffers data in memory and picks block placement at flush time. This reduces fragmentation and improves write throughput, at the cost of a small risk window: data acknowledged to the application but not yet flushed can be lost on a power failure. Use storage with power-loss protection or battery-backed cache where that matters.
The one-way door: no shrinking
Here is the limitation that bites people. XFS supports online growth — expanding a mounted file system while applications keep running — but it has no shrink operation at all. If you over-allocate a volume and later want the space back, your only path is: back up the data, destroy the logical volume, recreate it smaller, and restore. On a production system that is a maintenance window, not a command.
The practical consequence is a planning rule: size XFS volumes for what you need now plus realistic headroom, and rely on LVM to leave unallocated space in the volume group for later. It is far easier to grow into free extents than to recover from an oversized filesystem.
Worked example: growing a logical volume online
The standard Rocky Linux layout puts XFS filesystems on LVM logical volumes, which is what makes online growth possible. Assume your monitoring shows /var at 95% and the volume group still has free extents.
First, inspect the current state. Run these as root (or via sudo) directly on the server:
df -h /var
lvs
vgslvs shows logical volume sizes; vgs shows free space in the volume group (the VFree column). Verify the free space exists before extending — extending beyond available extents will simply fail, which is safe but wastes your time.
Extend the logical volume by 20 GB, substituting your actual volume group and LV names from the lvs output:
lvresize -L +20G /dev/mapper/rl-varThen grow the mounted XFS filesystem to fill the new space. Note that xfs_growfs takes the mount point, not the device path — a common trip-up for people coming from ext4's resize2fs:
xfs_growfs /varVerify with df -h /var; the new size should appear immediately, with no unmount, no reboot, and no application restart. Alternatively, lvresize -r -L +20G ... performs both steps in one command via fsadm.
Risks are modest but real: a crash mid-resize of the LV metadata is rare but not impossible, so take an LVM snapshot or backup first on critical systems. And double-check you are extending the correct LV — growth is irreversible without a rebuild.
Where XFS is the wrong choice
XFS is not universally superior. Workloads dominated by millions of tiny files — some CI caches, mail spools, certain build systems — can perform better on ext4, and ext4 can be shrunk offline. If you genuinely need flexible up-and-down resizing, XFS's no-shrink rule is a structural mismatch. Also note that advanced features like quota management depend on kernel and mount-option support; verify /etc/fstab and test quotas before relying on them in a compliance-sensitive setup.
The actionable takeaway
Rocky Linux's XFS-on-LVM default is a coherent engineering decision: it optimizes for the common case of servers that grow, parallel workloads, and large files, while accepting that shrinking requires a rebuild. Work with the grain — leave headroom in your volume groups, grow online with lvresize plus xfs_growfs, and verify every change with df -h and lvs. If your workload profile genuinely needs shrinkable volumes, choose ext4 at install time rather than fighting the default later.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.