Change Disk in a Software Raid-1

If you want to manage a software raid-1 under debian after a disk failure you have to

  1. remove the failed disk from md-device
  2. change the failed disk with a new one
  3. copy over the partition table from the remaining good disk
  4. add the new disk to the md-device
  5. install grub on the new disk

If sda failed in your md0-device, sdb is ok and there is only one partition on the md-raid, this would look the following.

mdadm --manage /dev/md0 --remove /dev/sda1
# change failed disk with new one
sfdisk -d /dev/sdb | sfdisk /dev/sda
mdadm --manage /dev/md0 --add /dev/sda1
grub-install /dev/sda

Leave a Comment