Replacing a failed drive in an md raid1/raid10: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 8: | Line 8: | ||
***<code># sgdisk -G /dev/sdb</code> (to make the new disk's GUID different the mirror's one) | ***<code># sgdisk -G /dev/sdb</code> (to make the new disk's GUID different the mirror's one) | ||
** For mbr partition table: <code># sfdisk --dump /dev/sdb | sfdisk /dev/sda</code> | ** For mbr partition table: <code># sfdisk --dump /dev/sdb | sfdisk /dev/sda</code> | ||
*Add the new drive into the arrays: <code># mdadm /dev/md0 --add /dev/sda1</code> | |||
*Observe the mirroring process with <code>$ watch cat /proc/mdstat</code> | |||
[[Category: Linux]] | [[Category: Linux]] | ||
Revision as of 20:20, 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
- If not, remove it by hand:
- 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(fromsdbtosda)# sgdisk -G /dev/sdb(to make the new disk's GUID different the mirror's one)
- For mbr partition table:
# sfdisk --dump /dev/sdb | sfdisk /dev/sda
- For gpt partition table:
- Add the new drive into the arrays:
# mdadm /dev/md0 --add /dev/sda1 - Observe the mirroring process with
$ watch cat /proc/mdstat