[SOLVED] Use UUID of HDDs in RAID 1 Array
-
- Posts: 92
- Joined: 2017/07/12 21:02:02
[SOLVED] Use UUID of HDDs in RAID 1 Array
Hey everyone,
I've been searching the interwebs for an answer to my but for whatever reason I am unable to find a clear solution.
I currently have a RAID 1 array composed of 2 x 4TB HDDs. It is configured using /dev/sdb and /dev/sdc. However I would like to change this config to use the UUIDs of each device instead since the /dev/sd* can change when adding extra storage devices. Is there any way to be able to do this with the current config or will I have to nuke the array and start over?
Btw, the reason for wanting to use the UUID is I'm trying to add another HDD for a VM, but when I boot my server I get an error saying my array is degraded. It is due to the array using /dev/sd* for device identifier and when I added the extra HDD it used /dev/sdc.
I've been searching the interwebs for an answer to my but for whatever reason I am unable to find a clear solution.
I currently have a RAID 1 array composed of 2 x 4TB HDDs. It is configured using /dev/sdb and /dev/sdc. However I would like to change this config to use the UUIDs of each device instead since the /dev/sd* can change when adding extra storage devices. Is there any way to be able to do this with the current config or will I have to nuke the array and start over?
Btw, the reason for wanting to use the UUID is I'm trying to add another HDD for a VM, but when I boot my server I get an error saying my array is degraded. It is due to the array using /dev/sd* for device identifier and when I added the extra HDD it used /dev/sdc.
Last edited by simon_lefisch on 2019/07/02 22:15:10, edited 1 time in total.
Hardware:
Supermicro X10SRi-F mobo
E5-2683v4 16-core CPU
112GB ECC RAM
2x 250GB SSD RAID1 (current CentOS 7 version)
2x 500GB SSD RAID1 (VM Disk Image Storage)
2x 4TB HDD RAID1 (Backup Storage via FreeNAS VM)
2X 6TB HDD RAID1 (Data Storage via FreeNAS VM)
Supermicro X10SRi-F mobo
E5-2683v4 16-core CPU
112GB ECC RAM
2x 250GB SSD RAID1 (current CentOS 7 version)
2x 500GB SSD RAID1 (VM Disk Image Storage)
2x 4TB HDD RAID1 (Backup Storage via FreeNAS VM)
2X 6TB HDD RAID1 (Data Storage via FreeNAS VM)
Re: Use UUID of HDDs in RAID 1 Array
Sure, it's the default way of setting it up anyway and there should be no problem changing over. If you edit /etc/mdadm.conf to look something like this you should be good to go. Use the UUID from mdadm --detail /dev/md0 | grep -i uuid
Edit: if you have data on the array that is required by the boot process then you may need yo alter the kernel command line in /boot/grub2/grub.cfg to add rd.md.uuid=<md raid uuid> but if it works now then it's probably ok.
Code: Select all
$ cat /etc/mdadm.conf
ARRAY /dev/md/0 metadata=1.2 UUID=12318cc4:45663f68:789c462b:abc6c778 name=trevor9.trevor.local:1
MAILADDR trevor.h@my.email
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
-
- Posts: 92
- Joined: 2017/07/12 21:02:02
Re: Use UUID of HDDs in RAID 1 Array
Hi Trevor,TrevorH wrote: ↑2019/06/29 17:48:09Sure, it's the default way of setting it up anyway and there should be no problem changing over. If you edit /etc/mdadm.conf to look something like this you should be good to go. Use the UUID from mdadm --detail /dev/md0 | grep -i uuid
Edit: if you have data on the array that is required by the boot process then you may need yo alter the kernel command line in /boot/grub2/grub.cfg to add rd.md.uuid=<md raid uuid> but if it works now then it's probably ok.Code: Select all
$ cat /etc/mdadm.conf ARRAY /dev/md/0 metadata=1.2 UUID=12318cc4:45663f68:789c462b:abc6c778 name=trevor9.trevor.local:1 MAILADDR trevor.h@my.email
Thanks for responding. Not sure if my question made sense or if I'm not understanding your answer, so apologies. Here is the output of mdadm --detail /dev/md0 | grep -i uuid:
Code: Select all
ARRAY /dev/md/0 level=raid1 num-devices=2 metadata=1.2 name=server:0 UUID=a0f4b81c:f32bd676:14105dbd:09292f38
devices=/dev/sdb,/dev/sdc
MAILADDR my.email@address.com
Hardware:
Supermicro X10SRi-F mobo
E5-2683v4 16-core CPU
112GB ECC RAM
2x 250GB SSD RAID1 (current CentOS 7 version)
2x 500GB SSD RAID1 (VM Disk Image Storage)
2x 4TB HDD RAID1 (Backup Storage via FreeNAS VM)
2X 6TB HDD RAID1 (Data Storage via FreeNAS VM)
Supermicro X10SRi-F mobo
E5-2683v4 16-core CPU
112GB ECC RAM
2x 250GB SSD RAID1 (current CentOS 7 version)
2x 500GB SSD RAID1 (VM Disk Image Storage)
2x 4TB HDD RAID1 (Backup Storage via FreeNAS VM)
2X 6TB HDD RAID1 (Data Storage via FreeNAS VM)
Re: Use UUID of HDDs in RAID 1 Array
What's currently in your /etc/mdadm.conf? It can use device names like /dev/sd[ab] or it can use UUIDs. I showed my example file that's using uuids so you would need to adapt yours to match. The metadata= bit cannot be changed as that would need a complete rebuild to implement, the rest can be.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
-
- Posts: 92
- Joined: 2017/07/12 21:02:02
Re: Use UUID of HDDs in RAID 1 Array
Apologies Trevor, the output of mdadm --detail /dev/md0 | grep -i uuid is:TrevorH wrote: ↑2019/06/29 19:11:02What's currently in your /etc/mdadm.conf? It can use device names like /dev/sd[ab] or it can use UUIDs. I showed my example file that's using uuids so you would need to adapt yours to match. The metadata= bit cannot be changed as that would need a complete rebuild to implement, the rest can be.
Code: Select all
UUID : a0f4b81c:f32bd676:14105dbd:09292f38
Code: Select all
ARRAY /dev/md/0 level=raid1 num-devices=2 metadata=1.2 name=server:0 UUID=a0f4b81c:f32bd676:14105dbd:09292f38
devices=/dev/sdb,/dev/sdc
MAILADDR my.email@address.com
Hardware:
Supermicro X10SRi-F mobo
E5-2683v4 16-core CPU
112GB ECC RAM
2x 250GB SSD RAID1 (current CentOS 7 version)
2x 500GB SSD RAID1 (VM Disk Image Storage)
2x 4TB HDD RAID1 (Backup Storage via FreeNAS VM)
2X 6TB HDD RAID1 (Data Storage via FreeNAS VM)
Supermicro X10SRi-F mobo
E5-2683v4 16-core CPU
112GB ECC RAM
2x 250GB SSD RAID1 (current CentOS 7 version)
2x 500GB SSD RAID1 (VM Disk Image Storage)
2x 4TB HDD RAID1 (Backup Storage via FreeNAS VM)
2X 6TB HDD RAID1 (Data Storage via FreeNAS VM)
Re: Use UUID of HDDs in RAID 1 Array
I am about 99% sure that you can just remove the devices=/dev/sdb,/dev/sdc bit of that. The UUID that is already there should be enough - it matches the one from your mdadm --detail. If you are concerned about it, make a backup copy of the file as it is now and make sure that you have an install DVD handy and you can boot that in rescue mode (an option off the initial Troubleshooting menu) and copy the backup copy back.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
-
- Posts: 92
- Joined: 2017/07/12 21:02:02
Re: Use UUID of HDDs in RAID 1 Array
Thanks Trevor, I will give that a shot. Currently out and about so I will let you know what happens when I get back.TrevorH wrote: ↑2019/06/29 19:38:30I am about 99% sure that you can just remove the devices=/dev/sdb,/dev/sdc bit of that. The UUID that is already there should be enough - it matches the one from your mdadm --detail. If you are concerned about it, make a backup copy of the file as it is now and make sure that you have an install DVD handy and you can boot that in rescue mode (an option off the initial Troubleshooting menu) and copy the backup copy back.
I also just came across something that uses the UUID of the array and the disks by ID in fstab like this:
Code: Select all
UUID=a0f4b81c:f32bd676:14105dbd:09292f38 /mnt/raid1 ext4 auto,noatime,nodiratime,device=/dev/disk/by-id/ata-TOSHIBA_MD04ACA400_26F4KJ1NFSAA,device=/dev/disk/by-id/ata-TOSHIBA_MD04ACA400_26F4KJ1OFSAA 0 0
Code: Select all
/dev/md0 /mnt/raid1 ext4 defaults 0 0
Hardware:
Supermicro X10SRi-F mobo
E5-2683v4 16-core CPU
112GB ECC RAM
2x 250GB SSD RAID1 (current CentOS 7 version)
2x 500GB SSD RAID1 (VM Disk Image Storage)
2x 4TB HDD RAID1 (Backup Storage via FreeNAS VM)
2X 6TB HDD RAID1 (Data Storage via FreeNAS VM)
Supermicro X10SRi-F mobo
E5-2683v4 16-core CPU
112GB ECC RAM
2x 250GB SSD RAID1 (current CentOS 7 version)
2x 500GB SSD RAID1 (VM Disk Image Storage)
2x 4TB HDD RAID1 (Backup Storage via FreeNAS VM)
2X 6TB HDD RAID1 (Data Storage via FreeNAS VM)
Re: Use UUID of HDDs in RAID 1 Array
UUIDs also work well in fstab and can help avoid things like the device name of /dev/md0 changing. It won't be the _same_ uuid
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
-
- Posts: 92
- Joined: 2017/07/12 21:02:02
Re: Use UUID of HDDs in RAID 1 Array
Hi Trevor,
Sorry for the late response. I did what you said as far as removing the devices line in my mdadm.conf file and that worked perfectly!. Thanks for your help, it is much appreciated
Hardware:
Supermicro X10SRi-F mobo
E5-2683v4 16-core CPU
112GB ECC RAM
2x 250GB SSD RAID1 (current CentOS 7 version)
2x 500GB SSD RAID1 (VM Disk Image Storage)
2x 4TB HDD RAID1 (Backup Storage via FreeNAS VM)
2X 6TB HDD RAID1 (Data Storage via FreeNAS VM)
Supermicro X10SRi-F mobo
E5-2683v4 16-core CPU
112GB ECC RAM
2x 250GB SSD RAID1 (current CentOS 7 version)
2x 500GB SSD RAID1 (VM Disk Image Storage)
2x 4TB HDD RAID1 (Backup Storage via FreeNAS VM)
2X 6TB HDD RAID1 (Data Storage via FreeNAS VM)