Disks with identical UUIDs

hard driveraiduuid

I have three disks that make up a RAID-5. Mdadm repeatedly spat out the third disk (even after replacing it), so I took a closer look.
After checking the cables, I eventually decided to label the disks with their UUID as reported by blkid. (and (originally) used in mdadm.conf to identify the disks. This was replaced by the /dev/sdX because the third UUID stopped showing up)

Leaving only one disk plugged in, I rebooted, labeled the disk with what blkid told me, removed the disk, plugged in a different one, rebooted…

The second disk's UUID looked very similar to the first one, so I plugged them all in again, and asked blkid their UUIDs again.

It looked like this on the server:

/dev/sdb: UUID="32c8da8b-e6d5-9a85-5cfc-1a8b59535263" TYPE="linux_raid_member"
/dev/sdc: UUID="32c8da8b-e6d5-9a85-5cfc-1a8b59535263" TYPE="linux_raid_member"
/dev/sdd: UUID="32c8da8b-e6d5-9a85-5cfc-1a8b59535263" TYPE="linux_raid_member"

Popping them each into an external cradle and attaching them to my laptop confirms that these are their actual UUIDs.

I've tried changing the UUIDs, but I can only find information about changing partition's UUIDs, but these belong to the disks themselves.

Every time a disk is removed or added, the BIOS shows the new configuration and asks you to accept this before rebooting, so I suspect that the BIOS/SATA driver is at fault here.

Best Answer

The duplicate UUIDs are normal.

Here's what mine look like:

$ stat /dev/disk/by-uuid/* | grep md
  File: `/dev/disk/by-uuid/4047dc03-xxxx-xxxx-xxxx-xxxxxxxxxxxx' -> `../../md1'
  File: `/dev/disk/by-uuid/78aeced1-xxxx-xxxx-xxxx-xxxxxxxxxxxx' -> `../../md0'
  File: `/dev/disk/by-uuid/aec72c9f-xxxx-xxxx-xxxx-xxxxxxxxxxxx' -> `../../md2'

mdadm gives:

$ sudo mdadm -D /dev/md{0,1,2} | grep UUID
       UUID : cb706582:xxxxxxxx:xxxxxxxx:xxxxxxxx
       UUID : 4033316c:xxxxxxxx:xxxxxxxx:xxxxxxxx
       UUID : e7ae2c88:xxxxxxxx:xxxxxxxx:xxxxxxxx

mdadm and vol_id give the same UIDs for the partitions (vol_id output omitted for brevity, but I haven't tried pulling the disks and checking while not in an array):

$ sudo mdadm -E /dev/sd{a,b,c,d}{1,2} 2> /dev/null | grep UUID
       UUID : cb706582:xxxxxxxx:xxxxxxxx:xxxxxxxx
       UUID : 4033316c:xxxxxxxx:xxxxxxxx:xxxxxxxx
       UUID : e7ae2c88:xxxxxxxx:xxxxxxxx:xxxxxxxx
       UUID : 4033316c:xxxxxxxx:xxxxxxxx:xxxxxxxx
       UUID : e7ae2c88:xxxxxxxx:xxxxxxxx:xxxxxxxx
       UUID : cb706582:xxxxxxxx:xxxxxxxx:xxxxxxxx

blkid gives me a different set of UUIDs, but they are still duplicated across mirrored partitions:

$ sudo blkid /dev/sd{a,b,c,d}{1,2} 2> /dev/null
/dev/sda1: UUID="826570cb-xxxx-xxxx-xxxx-xxxxxxxxxxxx" TYPE="mdraid" 
/dev/sdb1: UUID="6c313340-xxxx-xxxx-xxxx-xxxxxxxxxxxx" TYPE="mdraid" 
/dev/sdb2: UUID="882caee7-xxxx-xxxx-xxxx-xxxxxxxxxxxx" TYPE="mdraid" 
/dev/sdc1: UUID="6c313340-xxxx-xxxx-xxxx-xxxxxxxxxxxx" TYPE="mdraid" 
/dev/sdc2: UUID="882caee7-xxxx-xxxx-xxxx-xxxxxxxxxxxx" TYPE="mdraid" 
/dev/sdd1: UUID="826570cb-xxxx-xxxx-xxxx-xxxxxxxxxxxx" TYPE="mdraid"

Assuming you've tested the disks with hdparm, smartctl, or some other tool, feel free to blame the next cheapest component to replace (assuming the disks were the cheapest).

Related Topic