xfs_check

From RaySoft

xfs_check checks whether an XFS filesystem is consistent. It is normally run only when there is reason to believe that the filesystem has a consistency problem. The filesystem to be checked is specified by the device argument, which should be the disk or volume device for the filesystem. Filesystems stored in files can also be checked, using the -f flag. The filesystem should normally be unmounted or read-only during the execution of xfs_check. Otherwise, spurious problems are reported.[1]

Documentation

Syntax

xfs_check [PARAMETER ...] [DEVICE]

Parameters

-b BLOCKNUMBER
Specifies verbose behavior for the specific filesystem block at BLOCKNUMBER. For instance, it can be used to determine what a specific block is used for. [...] Conversion between disk addresses and file system blocks may be accomplished using xfs_db's convert command.
-f FILE
Specifies that the filesystem image to be processed is stored in a regular FILE at device (see the mkfs.xfs -d file option). This might happen if an image copy of a filesystem has been made into an ordinary file.
-i INODE
Specifies verbose behavior for the specified INODE. For instance, it can be used to locate all the blocks associated with a given inode.
-l DEVICE
Specifies the DEVICE where the filesystem's external log resides. Only for those filesystems which use an external log.
-s
Specifies that only serious errors should be reported. Serious errors are those that make it impossible to find major data structures in the filesystem. This option can be used to cut down the amount of output when there is a serious problem, when the output might make it difficult to see what the real problem is.
-v
Specifies verbose output; it is impossibly long for a reasonably-sized filesystem. This option is intended for internal use only.

Examples

Check /dev/hda3
mount -o 'remount,ro' '/dev/hda3'
xfs_check -v '/dev/hda3'

Output

...
inode 1594586 mode 0100444 fmt extents afmt local nex 1 anex 0 nblk 1 sz 1400
inode 1594586 nlink 1 not dir
inode 1594586 extent [0,99629,1,0]
setting block 3/1325 to data
setting inode to 1594586 for block 3/1325
mount -o 'remount,rw' '/dev/hda3'

References

  1. man 8 'xfs_check'