I run RAID5 and RAID1 with 4 hard disks:
$ cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid1]
md0 : active raid1 sdc1[2] sdb1[1] sda1[0] sdd1[3]
255936 blocks super 1.0 [4/4] [UUUU]
md1 : active raid5 sdc2[2] sdd2[4] sda2[0] sdb2[1]
2929119744 blocks super 1.1 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]
bitmap: 3/8 pages [12KB], 65536KB chunk
unused devices: <none>
However, one of the disks (sdb) is failing
Jul 21 10:54:12 karoline smartd[1958]: Device: /dev/sdb [SAT], FAILED SMART self-check. BACK UP DATA NOW!
Jul 21 10:54:12 karoline smartd[1958]: Device: /dev/sdb [SAT], Failed SMART usage Attribute: 5 Reallocated_Sector_Ct.
So now I want to replace the failing disk. I found
https://wiki.contribs.org/Raid:Manual_Rebuild, but it mostly describes RAID 1.
I don't have room to physically add an extra disk, so I guess the correct procedure is something like
1. mark sdb as faulty:
# mdadm --manage /dev/md0 --fail /dev/sdb1
# mdadm --manage /dev/md1 --fail /dev/sdb2
2. remove sdb1 and sdb2 from the arrays:
# mdadm --manage /dev/md0 --remove /dev/sdb1
# mdadm --manage /dev/md1 --remove /dev/sdb2
3. power down
4. replace the faulty disk with a new one
5. power up
Is this correct? Should the new disk be partitioned first?
Is it a problem that md0 is RAID1 and md1 is RAID5?
Any help appreciated