Raid 5 Replace failed drive – Create partitions, add the new drive, check if the raid is syncing and have a look at the mdstat file.
Create the partitions like on the other drives
parted /dev/sdb mklabel gpt
parted -a optimal — /dev/sdb mkpart primary 2048s -8192s
parted /dev/sdb set 1 raid on
Add the new drive to the raid
root@homeserver:~# mdadm –manage /dev/md0 –add /dev/sdb1
mdadm: added /dev/sdb1
Check if the raid is syncing
root@homeserver:~# cat /proc/mdstat Personalities : [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid1] [raid10] md0 : active raid5 sdb1[4] sdd1[1] sdc1[3] 5860259840 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/2] [_UU] [>....................] recovery = 0.0% (544996/2930129920) finish=985.4min speed=49545K/sec bitmap: 16/22 pages [64KB], 65536KB chunk unused devices:
After a night the raid is synced (depending on the size of the raid)
root@homeserver:~# cat /proc/mdstat Personalities : [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid1] [raid10] md0 : active raid5 sdb1[4] sdd1[1] sdc1[3] 5860259840 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU] bitmap: 3/22 pages [12KB], 65536KB chunk unused devices: <none>