Remove SCSI faulty spare hdd from RAID with mdadm

I manage a lot of servers with simple software RAID1 configuration. One of the disks started to fail notably on partition sdb8, so I had to set all other partitions to failed status before removing and replacing the disk:

mdadm --manage /dev/md0 --fail /dev/sdb5
mdadm --manage /dev/md3 --fail /dev/sdb7
mdadm --manage /dev/md1 --fail /dev/sdb6

After this my /proc/mdstat looked like this:

cat /proc/mdstat
Personalities : [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
md2 : active raid1 sdb8[1](F) sda8[0]
 284019576 blocks super 1.0 [2/1] [U_]
 bitmap: 3/3 pages [12KB], 65536KB chunk

md0 : active raid1 sda5[0] sdb5[1](F)
 528372 blocks super 1.0 [2/1] [U_]
 bitmap: 0/1 pages [0KB], 65536KB chunk

md3 : active raid1 sda7[0] sdb7[1](F)
 4200436 blocks super 1.0 [2/1] [U_]
 bitmap: 0/1 pages [0KB], 65536KB chunk

md1 : active raid1 sda6[0] sdb6[1](F)
 4199412 blocks super 1.0 [2/1] [U_]
 bitmap: 1/1 pages [4KB], 65536KB chunk

unused devices: <none>

Continue reading “Remove SCSI faulty spare hdd from RAID with mdadm”