xfs_repair

From RaySoft

xfs_repair repairs corrupt or damaged XFS filesystems. The filesystem is specified using the device argument which should be the device name of the disk partition or volume containing the filesystem. If given the name of a block device, xfs_repair will attempt to find the raw device associated with the specified block device and will use the raw device instead.[1]

Regardless, the filesystem to be repaired must be unmounted, otherwise, the resulting filesystem may be inconsistent or corrupt.[1]

Documentation

Syntax

xfs_repair [PARAMETER ...] [DEVICE]

Parameters

-d
Repair dangerously. Allow xfs_repair to repair an XFS filesystem mounted read only. This is typically done on a root filesystem from single user mode, immediately followed by a reboot.
-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 copied or written into an ordinary file. This option implies that any external log or realtime section is also in an ordinary file.
-l DEVICE
Specifies the DEVICE special file where the filesystem's external log resides. Only for those filesystems which use an external log.
-L
Force Log Zeroing. Forces xfs_repair to zero the log even if it is dirty (contains metadata changes). When using this option the filesystem will likely appear to be corrupt, and can cause the loss of user files and/or data.
-m MEMORY
Specifies the approximate maximum amount of MEMORY, in megabytes, to use for xfs_repair. xfs_repair has its own internal block cache which will scale out up to the lesser of the process's virtual address limit or about 75% of the system's physical RAM. This option overrides these limits.
-n
No modify mode. Specifies that xfs_repair should not modify the filesystem but should only scan the filesystem and indicate what repairs would have been made.
-t INTERVAL
Modify reporting INTERVAL. During long runs xfs_repair outputs its progress every 15 minutes. Reporting is only activated when ag_stride is enabled.
-v
Verbose output.

References

  1. 1.0 1.1 man 8 'xfs_repair'