Thursday, March 5, 2009

Raid Write Intent Bitmaps

During my last raid crash, I couldn't seem to get the damn thing to resync. I tried multiple times, but it would always lock up. I almost took the drastic step of borrowing a raid array to back things up as much as possible and then rebuild from scratch! However, in my many hours of research into potential solutions, I found that most people prevented the problem using a little thing called write intent bitmaps.

As far as I know, they are not available with hardware raid solutions, such as dedicated cards or those built into motherboards. Linux software raid, however, makes it ridiculously easy. Once I finally did get things resync'd (dumb luck, really. I didn't try anything new - it just started working), I immediately turned on the write intent bitmap feature.

mdadm --grow --bitmap=internal /dev/md0

This may reduce write performance slightly (up to 10%), but given that something is funky with my machine and it crashes during most full resyncs, I'm all for the saved resync time. Since I've turned this on, I haven't had a single problem with the array or the machine. There have been a couple blown fuses due to a space heater on the same circuit, but the machine came up and stayed up just fine, barely requiring a few seconds to resync. I can't tell you how happy I was.

So, switch on over to mdadm, add an internal bitmap, and rejoice in the short resync times.

No comments: