xfs_mdrestore
Restore XFS filesystem metadata from a dump
SYNOPSIS
xfs_mdrestore [-bfpq] [-d device] [-i file]
PARAMETERS
-b
Buffer the entire input file in memory before processing. This can improve performance for small files.
-d device
Specify the device to which the metadata should be restored. This is the filesystem being reconstructed.
-i file
Specify the input file containing the metadata dump created by xfs_metadump.
-f
Force overwrite of existing filesystem metadata on the target device. Use with caution as this can lead to data loss if not performed correctly.
-p
Preview mode. Simulates the restore operation without actually writing to the device. Useful for verifying the restore process.
-q
Quiet mode. Suppresses verbose output.
DESCRIPTION
xfs_mdrestore is a command-line utility used to restore the metadata of an XFS filesystem from a metadata dump created by xfs_metadump.
It allows you to restore filesystem metadata to a new or existing filesystem. This is particularly useful for recovering from metadata corruption or migrating an XFS filesystem.
Note that xfs_mdrestore restores metadata only and not user data.
After restoring the metadata, additional steps (such as running xfs_repair) may be needed to ensure filesystem consistency.
CAVEATS
This utility is designed for metadata only. Data recovery is not supported. It requires careful planning and understanding of XFS filesystem internals. Using xfs_mdrestore incorrectly can lead to severe data loss.
EXIT STATUS
Exit status is 0 on success, 1 on failure.
EXAMPLES
To restore metadata from dump.xfs to /dev/sda1:
xfs_mdrestore -i dump.xfs -d /dev/sda1
To preview the restore operation:
xfs_mdrestore -p -i dump.xfs -d /dev/sda1
HISTORY
The xfs_mdrestore command has been developed and maintained as part of the XFS filesystem utilities. It's primary use is restoring metadata from a filesystem after errors or corruption. It is used when creating a new filesystem from existing metadata.
SEE ALSO
xfs_metadump(8), xfs_repair(8), mkfs.xfs(8)