No repair is performed automatically at boot time. To initiate a filesystem check or repair, the
xfs_repairtool is used.
fsck.xfsbinary is present in the xfsprogs package, this is present only to satisfy initscripts that look for an
fsck.filesystembinary at boot time.
fsck.xfsimmediately exits with an exit code of 0.
Another thing to be aware of is that older xfsprogs packages contain an
xfs_checktool. This tool is very slow and does not scale well for large filesystems. As such, it has been depreciated in favor of
A clean log on a filesystem is required for
xfs_repairto operate. If the filesystem was not cleanly unmounted, it should be mounted and unmounted prior to using
xfs_repair. If the log is corrupt and cannot be replayed, the
-Loption may be used to zero the log.
-Loption must only be used if the log cannot be replayed. The option discards all metadata updates in the log and will result in further inconsistencies.
It is possible to run
xfs_repairin a dry run, check-only mode by using the
-noption. No changes will be made to the filesystem when this option is specified.
xfs_repairtakes very few options. Commonly used options include:
- No modify mode. Check-only operation.
- Zero metadata log. Use only if log cannot be replayed with mount.
- Limit memory used during run to maxmem MB. 0 can be specified to obtain a rough estimate of the minimum memory required.
- Specify the external log device, if present.
All options for
xfs_repairare specified in the
The following eight basic phases are performed by
- Inode and inode blockmap (addressing) checks.
- Inode allocation map checks.
- Inode size checks.
- Directory checks.
- Pathname checks.
- Link count checks.
- Freemap checks.
- Superblock checks.
These phases, as well as messages printed during operation, are documented in depth in the
xfs_repairis not interactive. All operations are performed automatically with no input from the user.
If it is desired to create a metadata image prior to repair for diagnostic or testing purposes, the
xfs_mdrestore(8)utilities may be used.