Pcornel
Browse topics
Options
Recent
Favorites
Storage · Technical reference

XFS · Linux Storage

Direct answer

XFS is a high-performance journaling Linux file system and the default on RHEL. It scales well for large files and parallel I/O and can grow online, but cannot be shrunk.

When to use this

Use this when using or repairing XFS file systems on Linux.

First 30 seconds

1. XFS: scalable, default on RHEL.

2. Grow online, no shrink.

3. Use xfs_repair (unmounted), not fsck.

4. Reflink support.

5. Quotas via mount options.

Operational verification

files → XFS AGs → block device

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Trying to shrink XFS — not possible; back up and recreate.
  • Running xfs_repair on a mounted file system.
  • Using xfs_repair -L (zero the log) too early — mount first to replay the log.
  • Forgetting that xfs_growfs takes the mount point, not the device.
Platform / version applicability
Linux Storage
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformLinux Storage
Scope / prerequisiteUse this when using or repairing XFS file systems on Linux.
What next?2 suggested next steps
Evidence1
On this pageJump to a specific section
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • XFS can grow online but not shrink.
  • Repair with xfs_repair on an unmounted file system.
  • It scales well for large files.
Key checks
  • xfs_info <mount> — geometry
  • xfs_repair -n /dev/<dev> — check
  • xfs_growfs <mount> — grow
ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

XFS in operations: grow online, repair offline, never shrink

XFS is the default file system on RHEL and common for large volumes. Day-to-day tasks:

$ xfs_info /srv
meta-data=/dev/mapper/vg0-srv    isize=512    agcount=16, agsize=16777216 blks
data     =                       bsize=4096   blocks=268435456, imaxpct=5
log      =internal log           bsize=4096   blocks=131072, version=2
# lvextend -L +200G vg0/srv && xfs_growfs /srv
# xfs_quota -x -c 'report -h' /srv

Repair

xfs_repair(8) says the file system must be unmounted before repair. -n only scans and reports. A dirty log can only be replayed by the kernel: mount and unmount the file system on a machine with the same CPU architecture, after confirming the hardware is reliable. -L zeroes the log as a last resort, and the manual warns it can lose user files and data.

# umount /srv
# xfs_repair -n /dev/vg0/srv; echo $?
# mount /dev/vg0/srv /srv && umount /srv     # replay the log first
# xfs_repair /dev/vg0/srv
Exit code (xfs_repair)Meaning
0No problems (with -n: no corruption detected)
1Corruption detected (-n) or runtime error
2Dirty log, repair cannot proceed

Operational notes

TopicDetail
ShrinkingNot supported; back up, recreate smaller, restore
Forced shutdownThe kernel log shows xfs_do_force_shutdown after metadata I/O errors; fix the device, then repair
Backupsxfsdump/xfsrestore, or file-level tools
Reflink copiescp --reflink on file systems created with reflink support

Always check the block layer (journalctl -k, SMART, multipath) before running a repair. Repairing on failing hardware makes damage worse.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Quick reference

XFS on Linux servers: default on RHEL, excellent for large files and parallel I/O, grow-only.

mkfs.xfs -d su=256k,sw=4 -L data /dev/md0
xfs_info /data
xfs_growfs /data
xfs_quota -x -c 'report -h' /data
xfs_fsr /data              # online defragmentation

Project quotas (prjquota mount option) limit directory trees, which is useful for per-tenant or per-container limits on a shared filesystem.

ReferenceConfiguration & state2 sections · depth on demand

Commands

mkfs.xfs -L data /dev/sdb1
xfs_info /data
xfs_growfs /data                    # grow while mounted
xfs_repair -n /dev/sdb1             # check (unmounted)
xfs_fsr /data                       # defragment

Documented example, not captured output. XFS cannot shrink; to make it smaller, back up, recreate and restore. Good for large files and parallel I/O; default on RHEL.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docLinux Storage current

Authoritative/upstream documentation reviewed for bounded claims in Linux Storage → XFS. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.kernel.org/block/index.html · confidence 94%
Confirmation

Confirm action

Continue?