raid5: cannot start dirty degraded array for mdN

rebuilding a software raid array and stuck with this error? for example, I was rebuilding on a live array and the server took a dive.

try tricking the array into believing its clean, then try to add a new drive or start the array again.


echo "clean" > /sys/block/md0/md/array_state
mdadm /dev/mdN -a /dev/sdXN
or
mdadm --manage /dev/md0 --run

then do a cat /proc/mdstat

raid should be rebuilding!