fsck.xfs - Linux


fsck.xfs is a utility used to check and repair inconsistencies in an XFS filesystem. It is commonly used during system boot to ensure the integrity of critical filesystems before the system becomes operational.


fsck.xfs [-fnrvyp] [-x option] device


  • -f: Force a check even if the filesystem is not mounted.
  • -n: Non-interactive mode.
  • -r: Repair mode. Automatically fixes detected inconsistencies.
  • -v: Verbose mode. Provides detailed progress information.
  • -y: Assume "yes" to all prompts.
  • -p: Parallel mode. Performs multiple checks simultaneously.
  • -x option: Extended options:
    • preen: Run in preen mode, skipping lengthy checks.
    • eN: Enable additional checks.


Basic Usage:

fsck.xfs /dev/sda1

Repair Mode:

fsck.xfs -r /dev/sda1

Non-interactive Mode:

fsck.xfs -n /dev/sda1

Extended Check:

fsck.xfs -x e2 /dev/sda1

Common Issues

  • FileSystem Not Found: Ensure the device or mount point is specified correctly.
  • Permissions Denied: Make sure you have sufficient permissions to access the filesystem.
  • Corrupt File System: If the filesystem is severely damaged, recovery may not be possible.


fsck.xfs can be integrated into scripts or automated tasks. For example:

if fsck.xfs -n /dev/sda1; then
  echo "Filesystem is clean"
  echo "Filesystem is corrupted. Please repair it manually."

Related Commands

  • tunefs: Adjust filesystem parameters.
  • xfs_repair: Advanced tool for repairing XFS filesystems.
  • xfs_info: Display XFS filesystem information.