3

I had a major server failure. The OS is fine and back up and running. Before I plug my raid drives back in and try and mount it I need to ask this simple question.

The drives that originally mapped /dev/sda(b/c) are unknown to me. I have no idea of knowing which drive in the raid was /dev/sda to the OS. If I connect them in the wrong order will mdadm figure this out or will I break the raid?

4

mdadm uses UUIDs to find the drives part of the array. You'll only have to point it at one of the drives to get it to find the whole set of drives part of the array. Additionally, a complete copy of the metadata of the array should be on every drive part of the array.

Try for yourself (example using /dev/sda2):

# mdadm --query /dev/sda2                                                                                                                                                                                                                          
/dev/sda2: is not an md array
/dev/sda2: device 1 in 4 device active raid10 /dev/md120.  Use mdadm --examine for more detail.
# mdadm --examine /dev/sda2
/dev/sda2:
[...]
        Version : 0.90.00
           UUID : 4412cfc6:5e1882a5:7dff47a2:91b78dd1 (local to host kvmserver)
[...]
   Raid Devices : 4
  Total Devices : 4
[...]
      Number   Major   Minor   RaidDevice State
this     1       8        2        1      active sync   /dev/sda2

   0     0       8       34        0      active sync   /dev/sdc2
   1     1       8        2        1      active sync   /dev/sda2
[...]
  • 1
    Has mdadm ever worked differently? Any serious RAID implementation should be independent of the order in which the disks were plugged in. – Gilles 'SO- stop being evil' Nov 21 '12 at 22:38
  • @Gilles I guess not then. Fixed my answer to prevent that confusion. – gertvdijk Nov 21 '12 at 22:57
  • This was absolutely the truth. Worked fine! Thanks! – Halsafar Dec 4 '12 at 0:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.