Pcornel
Storage · Filesystems

XFS

Cheat sheet · https://pcornel.dk/topic.php?topic=3951

Back to the Topic

Answer

XFS organizes storage into allocation groups to scale metadata operations and journals metadata changes. Online growth is supported, while shrink support and repair behavior depend on implementation/version and must not be assumed.

Remember

  • XFS allocation groups ≠ RAID stripes.
  • Journal recovery ≠ full data validation.
  • xfs_repair ≠ generic online fix.
  • Large free capacity ≠ absence of metadata or underlying I/O faults.

First checks

  • xfs_info <mount> — geometry
  • xfs_repair -n /dev/<dev> — dry-run check (unmounted)
  • xfs_db -r -c frag /dev/<dev> — fragmentation

Verify in this order

file → AG → inode → extents

Where it usually breaks

First mismatch in media/provider → controller/pool → logical object → path/protocol → filesystem/share/object namespace → consumer workload; preserve identity/pre-state before mutation.

Filesystems → XFS filesystem map

Filesystem boundaryWhat to verifyProof limit
Identity / attachmentFilesystem type, source/backing object, mount/attachment target and effective optionsPresence or mount state alone does not prove consistency or lower-layer health
Capacity / metadataData space, metadata/inodes, quotas/reservations and filesystem stateFree bytes at one layer do not prove allocation can succeed end to end
Failure boundaryA mounted XFS filesystem proves namespace availability for tested operations; it does not prove all allocation groups or backing storage are healthy.Correlate filesystem evidence with the backing volume/path/backend before repair
AcceptanceHealthy evidence: expected XFS mount is active, allocation succeeds, filesystem messages are clean and representative I/O completes without correlated lower-layer errors.Close only after the original path/workload and read-back check succeeds

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3951

Confirmation

Confirm action

Continue?