XFS Filesystem has duplicate UUID problem

If you can not mount your XFS partition with classical wrong fs type, bad superblock etc. error and you see a message in kernel logs (dmesg) like that:

XFS: Filesystem sdb7 has duplicate UUID - can't mount

you can still mount the filesystem with nouuid options as below:

mount -o nouuid /dev/sdb7 disk-7

But every mount, you have to provide nouuid option. So, for exact solution you have to generate a new UUID for this partition with xfs_admin utility:

xfs_admin -U generate /dev/sdb7
Clearing log and setting UUID
writing all SBs
new UUID = 01fbb5f2-1ee0-4cce-94fc-024efb3cd3a4

after that, you can mount this XFS partition regularly.

Thanks man, I know it’s an old post but I was in this situation to recover data from a virtual machine centos disk image in the cloud that I could no longer ssh into. I needed to attach it to a newly provisioned vm that I had access to. So this solved my problem.

Thanks man, tip was handy one!

Thanks man, helped a lot!

Thanks a loooooooot… saved my life

Thanks a lot I was just about to reformat a 10 TB XFS partition, this tip saved it!

Many thanks! It works!