An error may occur if the sda or sdb for the specific md# you are trying to rebuild is in Failed (F) status. In such a case, you would need to run 'mdadm remove' and then run 'mdadm add'Here is an example output of 'cat /proc/mdstat' showing the RAID status:
-------------
[[email protected] admin]# cat /proc/mdstat
Personalities : [raid0] [raid1]
md1 : active raid1 sdb1[1] sda1[0]
104320 blocks [2/2] [UU]
md5 : active raid1 sdb5[2](F) sda5[0]
8008256 blocks [2/1] [U_]
md6 : active raid1 sdb6[1] sda6[0]
236002752 blocks [2/2] [UU]########
Notice the (F) against sdb for md5 in the output above.