Linux – Configuring Disk by UUID with mdadm

linuxmdadm

I want to create a soft RAID-5 and use UUIDs im the mdadm config file. So I have four disks with 1 partition each that spans the whole disk. But since the partitons don'5 have a filesystem, blkid does not give a UUID. Is there a way to do that?

Best Answer

You first create the RAID5 device and then use the UUID of it in your mdadm.conf, not the UUID for a filesystem:

# mdadm --detail /dev/md0
/dev/md0:
        Version : 1.2
 ....
           Name : enterprise:0  (local to host enterprise)
           UUID : 7d2bf7e5:dc6edd5c:3ca12e46:8c9e5d4b
         Events : 48

    Number   Major   Minor   RaidDevice State

So I have a mdadm.conf of

ARRAY /dev/md/0 metadata=1.2 UUID=7d2bf7e5:dc6edd5c:3ca12e46:8c9e5d4b name=enterprise:0