Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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
[...]
share|improve this answer
    
Has mdadm ever worked differently? Any serious RAID implementation should be independent of the order in which the disks were plugged in. –  Gilles 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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