Now and then you will still run into problems somehow, a failing disk, software errors, configuration errors... I have had a mysterious error on this one which I think I just solved though. Every time I rebooted the server one of the RAID-partitions would fail, one of the disks was missing. This made me a bit hesitant to reboot it, once it would come up at all and I was afraid I had managed to destroy the RAID. Luckily it wasn't so and I managed to repair it and get it up and running without loosing anything. Anyway, today, when checking /etc/mdadm/mdadm.conf I noticed a typo, might have crept in when I upgraded the Debian-distro when they changed device names in /dev.
Anyway, I'm rambling a bit now. The real point of this post, and others I hope/might make, is to collect a bunch of handy commands, configurations etc. I know I always forget how to do stuff. I spend hours researching things, set them up, get them to work. Only to forget all about it so when I have to redo it or change something I forgot all, the links I had is dead, or I dont find the same source again.
So here will follow a more or less sorted hopefully growing list of handy commands, configurations, tricks etc. regarding software RAID on Debian Linux that is or has been useful to me, but that might also be useful for others.
Lost drive from RAID-1, re-add failed drive /dev/sda8 to raid /dev/md3:
mdadm --manage /dev/md3 -a /dev/sda8
Check status of RAID:
~> cat /proc/mdstat
Personalities : [raid1]
md3 : active raid1 sda8 sdb8
140817600 blocks [2/1] [_U]
[======>..............] recovery = 34.5% (48633344/140817600) finish=47.2min speed=32499K/sec
md4 : active raid1 sda9 sdb9
240832 blocks [2/2] [UU]
md0 : active raid1 sda1 sdb1
272960 blocks [2/2] [UU]
md1 : active raid1 sda5 sdb5
4883648 blocks [2/2] [UU]
md2 : active raid1 sda6 sdb6
9767424 blocks [2/2] [UU]
Showing status with one device rebuilding.