What is XFS?
Silicon Graphics (SGI) created XFS in the early 1990s for its IRIX operating system, aiming at workstations and servers that handled very large files. It was later ported to Linux and is now part of the standard Linux kernel. Red Hat Enterprise Linux (RHEL) made XFS its default file system starting with RHEL 7, and distributions built from RHEL, such as Rocky Linux and AlmaLinux, use it too.
CompTIA's acronym list expands XFS as Extended File System. Do not confuse it with the ext family (ext2, ext3, ext4), a separate line of Linux file systems whose name comes from extended file system.
Key features
- 64-bit design for very large files and file systems.
- Allocation groups. The file system is split into independent regions that can be used in parallel, so XFS scales well when many threads read and write at once.
- Metadata journaling. Changes to file system structures are logged first. After a crash, XFS replays the log in seconds instead of scanning the whole disk.
- Extent-based and delayed allocation, which keep large files in contiguous blocks and reduce fragmentation.
- Online growth. A mounted XFS file system can be enlarged after its partition or logical volume grows.
- No shrinking. XFS cannot be made smaller. Reducing its size means backing up, re-creating it at the new size, and restoring the data.
- Online defragmentation with
xfs_fsr, and backup and restore withxfsdumpandxfsrestore.
Common commands
| Command | Purpose |
|---|---|
mkfs.xfs /dev/sdb1 | Create an XFS file system on a partition |
mount /dev/sdb1 /data | Mount it |
xfs_info /data | Show its layout, such as block size and allocation groups |
xfs_growfs /data | Grow a mounted XFS file system to fill its enlarged partition or volume |
xfs_repair /dev/sdb1 | Check and repair it; the file system must be unmounted |
lsblk -f or df -T | Show which file system each volume uses |
Running fsck against XFS does nothing useful, because XFS checks itself through its journal at mount time. Use xfs_repair when a real repair is needed.
XFS compared with other file systems
| File system | Where you see it | Notes |
|---|---|---|
| XFS | RHEL and related distributions, large-file servers | Journaling, grows online, cannot shrink |
| ext4 | Default on Debian and Ubuntu | Journaling; can be shrunk while unmounted; repaired with fsck |
| Btrfs | Default on Fedora Workstation and openSUSE | Copy-on-write, snapshots, data checksums |
| NTFS and ReFS | Windows | Windows does not read XFS natively |
| APFS | macOS and iOS | Apple's file system, with snapshots and native encryption |
XFS handles large files and many simultaneous reads and writes well, which is why it is common on file, media, and database servers. Because it cannot shrink, ext4 is often the simpler choice for small volumes that may need to be resized smaller later.
XFS on the CompTIA A+ exam
XFS is on the Core 1 acronym list, where CompTIA spells it out as Extended File System. File system comparisons are Core 2 material, together with NTFS, ReFS, FAT32, exFAT, ext4, and APFS, which are also on the acronym list. Know XFS as a Linux journaling file system, the default on Red Hat Enterprise Linux, built for large files and volumes, and able to grow but not shrink. If a question describes a high-performance journaling file system on a Red Hat server, the answer is XFS; if it describes the default on Ubuntu, the answer is ext4.