Replacing a failed drive in an md raid1/raid10

From Notes to self
Revision as of 20:11, 2 July 2015 by Verbovet (talk | contribs)
Jump to navigation Jump to search
  • Check if the kernel already removed the faild drive from the arrays: # mdadm --detail /dev/md0
    • If not, remove it by hand: # mdadm /dev/md0 --remove /dev/sda1
    • If in an array a partition of the failed drive is not marked as faulty, before removing run # mdadm --manage /dev/md1 --fail /dev/sda2
  • Insert a new physical disk
  • Copy the partition table to the new drive from its mirror:
    • For gpt partition table: sgdisk -R /dev/sda /dev/sdb (from sdb to sda)
      • sgdisk -G /dev/sdb