LinuxCommandLibrary

xfs_check

Check XFS filesystem for errors

SYNOPSIS

xfs_check [ options ] device

PARAMETERS

-s
    Enable the display of superblock information.

-L
    Lock the filesystem during the check. Requires exclusive access to the filesystem. Implies -v.

-v
    Enable verbose output.

device
    Specifies the block device (e.g., /dev/sda1) containing the XFS filesystem to be checked.

DESCRIPTION

xfs_check is a utility used to verify the consistency of an XFS filesystem.
It examines the filesystem metadata structures and attempts to identify any inconsistencies or errors. This tool is essential for maintaining data integrity and stability on XFS filesystems. It is typically run on unmounted filesystems to avoid further corruption during the check. While xfs_check can identify problems, it *does not* repair them.
xfs_repair(8) is used for repairing XFS filesystems. The output of xfs_check provides valuable information for diagnosing filesystem issues and determining the best course of action for recovery. It can be useful for identifying hardware failures or software bugs that could have caused filesystem corruption. Run it regularly to prevent data loss.

CAVEATS

xfs_check should only be run on unmounted filesystems to prevent further data corruption. It only identifies problems and doesn't repair them. xfs_repair is needed to repair the filesystem.

EXIT STATUS

The exit code will be 0 if no errors were found, and a non-zero value if any errors were detected.

SEE ALSO

xfs_repair(8), mkfs.xfs(8), xfsdump(8), xfsrestore(8)

Copied to clipboard