Which Uuid To Specify A Raid In Fstab

Home » CentOS » Which Uuid To Specify A Raid In Fstab
CentOS 4 Comments

I’m confused about which UUID to use to identify a software RAID in fstab.

lsblk -fs shows:

md127p1 ext4 c43af789-82aa-49e9-a8ed-acd52b1cdd58 /y
— md127 ext4 39c20575-4257-4fd7-b5c8-8a15757e9e8e
— sdb1 linux_r hostname:0
af77830e-8cfd-9012-62ce-e57105c3bf6c
— sdb
— sdc1 linux_r hostname:0
af77830e-8cfd-9012-62ce-e57105c3bf6c
— sdc linux_r hostname:0
af77830e-8cfd-9012-62ce-e57105c3bf6c

mdadm –detail

gives for both md127p1 and md127

UUID : af77830e:8cfd9012:62cee571:05c3bf6c

I want to add some disks to the server, not to the raid and I wanted to avoid trouble with the names.

Any help would be appreciated.

Barry

4 thoughts on - Which Uuid To Specify A Raid In Fstab

  • Assuming your raid group is /dev/md127, you can run:

    ls -l /dev/disk/by-uuid

    or

    blkid /dev/md127

    and use the ID both will show for /dev/md127

  • /etc/fstab needs the UUID for the filesystem volume; so if you use blkid, find the line with the filesystem type and label you used when you created the file system, and use the uuid listed after UUID
    The grub.cfg should have a boot parameter mduuid which makes mdadm in the initramfs aware that it should assemble the array as soon as it can. It ought to be able to discover what it needs from mdadm metadata
    1.x from the member drives, but I’m actually not certain of the role the /etc/mdadm.conf plays or whether it needs to be baked into the initramfs these days.

    You can use ‘systemd-analyze blame’ to see if any particular unit file is waiting for either the fs uuid or md uuid to appear. If so I’d probably start with just rebuilding the initramfs with a ‘dracut -f’. I’d like to believe on-disk metadata can just be discovered automatically but…

    Chris Murphy

  • I’m not sure if grub2-mkconfig will automatically detect and add mduuid to grub.cfg. You can try it. If not then you could add the entry to the extra boot params line in /etc/default/grub and then recreate the grub.cfg with grub2-mkconfig -o…