XFS volume restore does not mount

XFS cloned volumes cannot mount with duplicate UUID error

Description: XFS kernel module remembers old UUID and refused to mount

Cloning an XFS volume and mounting the filesystem of the cloned volume on the same node as the source volume will throw “duplicate UUID” error or similar errors.  The cloning of the volume reflects everything from the source at the point of time of the snapshot which also includes the UUID of the partitions within the volume.  The UUID is the unique identifier pointing to the partition and hence it is not unique anymore with the cloned volume on the host.

This is generally not an issue when the cloned volume is attached to different host than that of the source volume.

Error: Filesystem has duplicate UUID - can't mount

For EXT4 filesystems, even though /var/log/messages shows error about device appeared twice with different sysfs paths, it doesn’t throw the error when mounting the filesystem from the cloned volume.

Resolution

There are two ways to overcome such failures:

  1. The UUID of the partition should be changed before it is mounted.  The commands vary based on the filesystem type (EXT4 vs XFS) but the idea is to change the UUID of the partition and mount.  Run xfs_repair first on the partition, followed by xfs_admin to generate new UUID.
  2. Using the nouuid mount option for XFS will likely work around the issue but not always recommended.

Note: This is confirmed with other similar bug reports.