Rebuild mdadm Raid5 after OS hard drive died

Solution 1:

Amazingly enough, your RAID should actually be autodetected by Linux simply by the virtue of being made up of "Linux RAID Autodetect" partitions. So, after you install on the OS drive, after first boot, you should have an MD device here:

cat /proc/mdstat

To manage it, you'll want to make sure you have mdadm installed:

apt-get install mdadm

Just installing mdadm will actually try to auto-detect your arrays so check /proc/mdstat again. If they're still not there, you can assemble by running something like:

mdadm --assemble /dev/md0 /dev/sdXX /dev/sdYY ....

You'll want to save the configuration if you have to do that manually:

/usr/share/mdadm/mkconf

And then update the initramfs for your system:

update-initramfs -u        

Solution 2:

Wow. Linux really does kick ass. Here's what I did:

  1. Because my old Boot/OS drive failed, I installed Ubuntu (10.10) onto a brand new hard drive. (I made sure not to reformat or install over the other 4 RAID drives which did not fail).
  2. After Ubuntu installed and booted up for the first time, I then installed mdadm with "sudo apt-get install mdadm"
  3. Now I wanted to see if my RAID was recognized by the system. Inside the disk utility, the raid array was listed, but it said "Not running, not enough components to start."
  4. I checked on an Ubuntu forum about this problem...and the solution was rebooting the system. I rebooted...and the RAID array is now fully functioning again (listed inside the disk utility, and mounted in the filesystem under "Places").

That's all I had to do!