Replacing a degraded drive in a software RAID 1 array

After physically replacing the degraded drive with the new one and rebooting the system, run the folowing command to create exactly the same partitioning on /dev/sdb (new drive) as on /dev/sda (healthy existing drive):

sfdisk -d /dev/sda | sfdisk /dev/sdb

You can run

fdisk -l

to check if both hard drives have the same partitioning now.

Next we add /dev/sdb1 to /dev/md126 and /dev/sdb2 to /dev/md127:

mdadm --manage /dev/md126 --add /dev/sdb1
mdadm --manage /dev/md127 --add /dev/sdb2

Now both arrays (/dev/md126 and /dev/md127) will be synchronized. Run

cat /proc/mdstat

to see when it's finished.

Tags:

Add new comment

Filtered HTML

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.