(original article)

Re: mdadm

27 March 2011, 06:10 UTC

Device by ID

My biggest problems with mdadm revolve around the fact that its point of reference for drives is the controller they are attached to instead of the actual disks.

ie. when I create an array you end up saying create me a raid5 array using the disks on controllers /dev/sdc1,/dev/sdd1,/dev/sde1 which doesn't seem a problem.

However if I then add another disk to the system it can sometime bump all the device names so /dev/sdc1 becomes /dev/sdd1

It would be much safer to say create my array using /dev/devicebyid/harddisk1,/dev/devicebyid/harddisk2,/dev/devicebyid/harddisk3.

Which means I can then hang the disks off any controller, and the system will cope and reassemble the arrays on boot should a new drive be added.

Does this make any sense ?

I have tried creating arrays using device-by-id device names, and although the device is created sucessfully the array is not reassembled on reboot, even with a the devicenames in mdadm.conf - further investiagtion using mdadm -vv --assemble --scan ; shows that when assembling mdadm uses only controller names so you get lots of errors that say something like /dev/sda1 does not match /dev/devicebyid/harddisk1.

If you rewrite mdmadm.conf to use controller device names then the array is sucessfully assembled.








[æ]