LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   How does mdadm handle changing drive letters? (http://www.linuxquestions.org/questions/linux-software-2/how-does-mdadm-handle-changing-drive-letters-667451/)

crontab 09-04-2008 01:09 AM

How does mdadm handle changing drive letters?
 
I have a RAID 1 going now, /dev/md0, composed of /dev/sda (internal) and /dev/sdb (usb enclosure). I haven't run into any issues yet, but I'm wondering what'll happen if I boot up with a USB flash drive (/dev/sdc) connected and the drive letters get remapped. If, for example, sdb and sdc were switched around.

Can mdadm be configured to build the md0 array out of two specific UUIDs or volume labels? Or is it intelligent enough to detect the change by itself? I've searched Google and these forums but I haven't found any way of doing so. /etc/fstab doesn't seem to help in this case, since the two block devices that create the array are never actually mounted.

djjoshuad 09-04-2008 01:32 AM

the raid set information is stored on the block devices themselves, and as such will be recognized as part of their respective raid sets regardless of the device name they get assigned. the raid part happens at a lower level than the /dev/xxx assignment :)

Bruce Hill 09-04-2008 04:41 AM

To second djjoshuad's post, I have boot on /dev/md0 RAID1, swap on
/dev/md1 RAID1, and a LUKS encrypted LVM containing / and ~/ running
in RAID0 on /dev/md2 -- 2 SATA drives. There is also a SATA DVD+/-RW,
and another SATA drive (old Windows/Slackware dual boot) in the box.

I have changed SATA cables and the RAID arrays always function well,
simply remapping the device nodes to their proper assignments.

crontab 09-04-2008 10:02 AM

Great, thanks for the replies! This would explain how a brand new debian install knew that my two drives had previously been part of a raid (it warned me when I went to create it).


All times are GMT -5. The time now is 08:32 PM.