Rebuilding RAID

I was suffering from a hard drive I/O problem. A quick check with smartctl -A -l error revealed 38 errors on sda, so it had to be replaced.

So this morning the hard drive was swapped for a new blank one and I began the process of rebuilding the RAID.

I booted of a Gentoo Minimal Install CD. These are notable as they are the only install CDs I’ve found that contain the necessary md[0–3] devices in /dev.

  1. I created the partitions on the new hard drive, set the types to Linux RAID and made partition 1 bootable
  2. I then mounted the root partition from sdb3 and copied the mdadm.conf file to /etc. I unmounted sdb3
  3. I edited the mdadm.conf file:
    For every ARRAY entry I added the text devices=/dev/sda3,missing at the end of each line
  4. I mounted the RAID arrays under /mnt/gentoo as appropriate
  5. For each array I issued mdadm /dev/md0 --add /dev/sdb1, changing md0 and sdb1 as appropriate
  6. I also had to re-install GRUB on my system:
    grub
    device (hd0) /dev/sda
    root (hd0,0)
    setup (hd0)
    device (hd1) /dev/sdb
    root (hd1,0)
    setup (hd1)
    quit

Two hours later it was finished and I’m now giving the system a solid hard drive test to ensure future stability.

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.