3

We are thinking about to change all Linux fstab configuration to work with UUID instead the current configuration

Some of the disks are with non RAID and some of the disks are with RAID10

I searched in google and find complain about using UUID for RAID1 :

" Unfortunately you MUST NOT use UUID in /etc/fstab if you use software RAID1. Why? Because the RAID volume itself and the first element of the mirror will appear to have the same filesystem UUID. If the mirror breaks or for any other reason the md device isn't started at boot, the system will mount any random underlying disk instead, clobbering your mirror. Then you'll need a full resync. Bad juju."

So I just want to know if we can use UUID for RAID10 ?

and in which cases ( RAID configuration ) not to use UUID?

second - in few lines what are the benefit to use UUID ?

3
  • I don't have a suitable system to test. Can you update your question with the output of blkid from a suitable system of yours? Because I think that between any duplicated UUID's for the mirrored file-systems there should also be a unique UUID for the software raid block device that gets created.
    – HBruijn
    Dec 6, 2017 at 13:50
  • maybe you talk about Software RAID and not physical RAID in this case maybe you right
    – shalom
    Dec 6, 2017 at 14:49
  • In physical raid you only see the logical volume, and not the underlying physical disks and then you will never run the risk of mounting "a random underlying disk". The RAID controller will protect against that.
    – HBruijn
    Dec 6, 2017 at 15:17

1 Answer 1

2

Yes, you can use UUID's with Linux software raid.

But rather than using the UUID of the filesystem (which can show up as non-unique in case of software raid mirroring) you should use the UUID of the RAID device in your /etc/fstab as that will be unique for sure.

mdadm --detail /dev/md0

will display the UUID of the /dev/md0 block device.

I think blkid should show the same.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .