power loss/system interruption during linux software raid initalization

HDClown

Limp Gawd
Joined
Nov 30, 2004
Messages
223
2 scenarions I have questions for, same question in both cases for each scenario:

1) If there is a linux software raid initailization occuring on a set of disks in a RAID6 array, and power is lost during this process (hard power loss, systems shuts down improperly)
- would the initailization be damaged and start over from scratch on boot up, or would it pick up where it left off?
- If it's not damaged, would it be safest to re-start anyway.

2) If there is a linux software raid intialization occuring on a set a disk in a RAID6 array, and the system is gracefully shut down
- would the initailization be halted and start over from scratch on boot up, or would it pick up where it left off?
- If it's not damaged, would it be safest to re-start anyway.
 
I believe it picks up where it left off. That is if you have enabled a write-intent bitmap.
 
1) It will restart from scratch by default. If you specify a write-intent bitmap it should restart. It's supposed to be safe, but I'm not sure of the exact algorithm used.

2) Been a while since I've done it, but I'm pretty sure it saves its position in the array metadata and restarts.

I'd just avoid these situations...
 
Losing power / shutting down is not a problem. I've tried it during rebuilds and expands without issue. During a rebuild it will just resume from where it left off, during an expand it will undo the partial expand-- at least it did when I tried it, not sure if that ever changed. You can try testing some of this stuff out.. pretty easy to do so if you have a new system before you put any real data on it.

If you don't want it to resume, you could use mdadm to mark the new drive as bad, the array will again go degraded, then you can readd it and the rebuild will start over. Alternatively you could not do anything, let the rebuild resume and soon as it finishes tell it to check the array for errors:
echo check » /sys/block/md3/md/sync_action

Overall time of having a degraded array would be lower.
 
Back
Top