I had a RAID 5 (Linux software RAID) server which recently decided not to boot anymore. It seems to be a motherboard problem possibly due to not being protected by a UPS during a power failure. It managed to extend its slow death to the point of taking up plenty of my time without much reward but I know that the drives are fine.

Is it possible to rebuild the RAID array even though the drives will have different numbers by plugging it into a machine over USB adapters?

Is it possible any damage can be done to the array in the process by attempting to rebuild the array with the wrong drive numbers?

I don't want to do a mdadm assemble --force unless I know it's safe. Is there something I can do to investigate if it will be safe to force the assembly?


The short answer is: yes, it is possible.

Linux software RAID writes some meta information on the devices such that you can easily plug them into another system (using another controller and so on) and use them there. Before doing any assembling, you can query the devices (status, look what Linux think what part of what RAID this device was etc.).

When you are using USB adapters be aware that you can't query SMART information over it (or use other more sophisticated ATA commands).

To be safe you should have a backup available. If you don't have a recent one you can copy the devices of your RAID5 via dd before issuing any mdadm commands.

  • You mean that mdadm actual writes to firmware, as in there is information outside of the partition that it may need? Excellent idea to simply DD the images first. Would it be possible to use them as loopback devices and assemble the RAID from them? They are 750Gb each drive though! The answer always seems to end up being "buy more storage" somehow !! :-P – barrymac Nov 1 '11 at 16:37
  • @barrymac On the contrary, mdadm does not require any information outside what's stored inside the partition, not even the name or location of the partition. I believe that you can make some or all of the md components loop devices. – Gilles Nov 1 '11 at 19:50
  • @Giles excellent thanks, that gives me the hope I need to carry on! I should be able to test things out, recover data just in case and perhaps even re-add a replacement drive to the array using the loopback devices – barrymac Nov 2 '11 at 0:23
  • Are RAID 5 and RAID 6 both where there are two parity bits? Or does only one of them have two parity bits? – Kaitlyn Mcmordie Nov 2 '11 at 1:46

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.