Using mdadm 3.3 --------------- Since [`mdadm` 3.3][1] (released 2013, Sep 3), if you have a [3.2+ kernel][2], you can proceed as follows: # mdadm /dev/md0 --replace /dev/sdd1 --with /dev/sdc1 `sdd1` is the device you want to replace, `sdc1` is the preferred device to do so and must be declared as a spare on your array. The `--with` option is optional, if not specified, any available spare will be used. Older mdadm version ------------------- *Note: You still need a [3.2+ kernel][3].* First, add a new drive as a spare (replace `md0` and `sdc1` with your RAID and disk device, respectively): # mdadm /dev/md0 --add /dev/sdc1 Then, initiate a copy-replace operation like this (`sdd1` being the failing device): # echo want_replacement > /sys/block/md0/md/dev-sdd1/state Result ------ The system will copy all readable blocks from `sdd1` to `sdc1`. If it comes to an unreadable block, it will reconstruct it from parity. Once the operation is complete, the former spare (here: `sdc1`) will become active, and the failing drive will be marked as failed (F) so you can remove it. *Note:* credit goes to *frostschutz* and *Ansgar Esztermann* who found the original solution (see the [duplicate question][4]). Older kernels ------------- Other answers suggest: - *Johnny*'s [approach][5]: convert array to RAID6, "replace" the disk, then back to RAID5, - *Hauke Laging*'s [approach][6]: briefly remove the disk from the RAID5 array, make it part of a RAID1 (mirror) with the new disk and add that mirror drive back to the RAID5 array (theoretical)... [1]: https://github.com/neilbrown/mdadm/commit/70c55e36b73827579fcb2dadbb6359ef605191ff [2]: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=2d78f8c451785f030ac1676a18691896b59c69d8 [3]: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=2d78f8c451785f030ac1676a18691896b59c69d8 [4]: http://unix.stackexchange.com/questions/102492/#102499 [5]: http://unix.stackexchange.com/a/74930 [6]: http://unix.stackexchange.com/a/74936