I have a raid with two USB drives in a mirroring setup. It works pretty well, but the USB bus is pretty flaky and about once a week, for reasons unknown to me (apparently nothing relevant in the logs) a drive will disappear and come back on a different /dev path. Now, mdadm does a great job of recognizing the drives by serial number, so I don't fret over the drive letters much.
The really irritating part for me is that when the drive comes back, it doesn't go into the raid.
Update Time : Fri Jul 16 12:05:02 2010 State : clean, degraded Active Devices : 1 Working Devices : 1 Failed Devices : 1 Spare Devices : 0 UUID : eac43993:c6a05923:74746b96:dfc4670c (local to host razor) Events : 0.468176 Number Major Minor RaidDevice State 0 0 0 0 removed 1 8 81 1 active sync /dev/sdf1 2 8 65 - faulty spare
I can usually get the drive added back with an mdadm --stop /dev/md_d0, and mdadm --assemble /dev/md_d0; sometimes with an mdadm --add /dev/md_d0 /dev/sd1.
If things were written to the disk while the drive was "faulty" though, I get this afterwords.
Number Major Minor RaidDevice State 2 8 33 0 spare rebuilding /dev/sdc1 1 8 49 1 active sync /dev/sdd1
This is all fine, but rebuilding your raid once a week probably isn't very good for the disks.
What I'm looking for here is either some way to fix this (which I don't think is likely, short of getting it off the USB bus) or some way to turn the raid read-only when a drive disappears. Then I could add it back without having to rebuild. It'd still be flaky, but at least it wouldn't have to rebuild.
I was thinking of using --scan (monitor?) and an event program, but I think it would take quite a while to get right even if I didn't make mistakes.
Any ideas are welcome.