Replacing a failed drive in an md raid1/raid10: Difference between revisions

From Notes to self
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
*Check if the kernel already removed the faild drive from the arrays: <code># mdadm --detail /dev/md0</code>
*Check if the kernel already removed the faild drive from the arrays: <code># mdadm --detail /dev/md0</code>
**If not, remove if by hand: # mdadm /dev/md0 --remove /dev/sdb1
**If not, remove it by hand: <code># mdadm /dev/md0 --remove /dev/sda1</code>
**If in an array a partition of failed drive is not marked as failed, do this
**If in an array a partition of the failed drive is not marked as faulty, before removing run <code># mdadm --manage /dev/md1 --fail /dev/sda2</code>
*Insert a new physical disk
*Copy the partition table to the new drive from its mirror: <code>sgdisk -R /dev/sda /dev/sdb</code> (from <code>sdb</code> to <code>sda</code>)
 


[[Category: Linux]]
[[Category: Linux]]

Revision as of 20:09, 2 July 2015

  • 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: sgdisk -R /dev/sda /dev/sdb (from sdb to sda)