Operating Systems

What is XFS?

XFS is a 64-bit journaling file system created by Silicon Graphics (SGI) for large files; it is the default in Red Hat Enterprise Linux 7 and later.

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 with xfsdump and xfsrestore.

Common commands

CommandPurpose
mkfs.xfs /dev/sdb1Create an XFS file system on a partition
mount /dev/sdb1 /dataMount it
xfs_info /dataShow its layout, such as block size and allocation groups
xfs_growfs /dataGrow a mounted XFS file system to fill its enlarged partition or volume
xfs_repair /dev/sdb1Check and repair it; the file system must be unmounted
lsblk -f or df -TShow 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 systemWhere you see itNotes
XFSRHEL and related distributions, large-file serversJournaling, grows online, cannot shrink
ext4Default on Debian and UbuntuJournaling; can be shrunk while unmounted; repaired with fsck
BtrfsDefault on Fedora Workstation and openSUSECopy-on-write, snapshots, data checksums
NTFS and ReFSWindowsWindows does not read XFS natively
APFSmacOS and iOSApple'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.

Studying for CompTIA (Operating Systems)?

ExamWizardz turns the official objectives into a guided study plan — with practice tests, realistic PBQs, and a readiness score. Start free.

Start studying free

Related terms