software raid -- migrating to a new disk
I have a software raid 5 device /dev/md0 that is has 6 underlying devices:
I've noticed that the /dev/hda IDE disk has some errors in SMART, and I would like to replace the disk. Note that it is not failed in the array, and the array is in a clean state. I just want to preemptively replace it with a SATA drive (/dev/sdf with /dev/sdf1 -- the same size as /dev/sda1).
How do I go about doing this?
My best guess is to do the following, but I'm not sure it's the correct / best path:
1. Use fdisk to create /dev/sdf1 as a Linux Raid auto-detect partition the same size as /dev/hda1 on /dev/sdf.
2. Add /dev/sdf1, which should automatically become a spare.
mdadm --add /dev/md0 /dev/sdf1
3. Mark the partition on the drive I want to remove as failed.
mdadm /dev/md0 --fail /dev/hda1
4. Remove /dev/hda from the system
Will this work? Will the array automatically sync the spare drive after step 3, or is there an extra step in there?
Thanks in advanced,