Ciro Iriarte wrote:
2007/10/26, Greg Freemyer <greg.freemyer@gmail.com>:
On 10/25/07, Ciro Iriarte <cyruspy@gmail.com> wrote:
Anybody has experience with linux Raid5 and power outages?, i currently have two 250GB disks in a RAID1 array in my main workstation. When there's any power outage the array is rebuilt but given it's a mirror it's not a major issue.
Now i would like to add 4 500GB disks in a secondary array with raid5 but i'm afraid i would lose the array if there's any outage (have to mention a UPS in my letter to Santa....)
Anybody knows if the raid5 (md) would survive this scenario?
The raid should definately survive, but the portion you are writing at the time could easily be corrupt.
I thought that that kind of corruption would trigger the array rebuild or logical fail...
Raid5 typically has a 64k per disk data unit, but your issues are going to really be at the 4k page level I think.
In particular, when you write/overwrite a page the kernel has to read the original page of data and the checksum page of data. Update both and write them both back out. There is really no way the OS can ensure that both writes actually make it to disk simultaneously.
So if you have a power outage while writing to a raid5 the odds are high that one of the 2 updates failed to make it to disk. The good news, is the array itself should be fine. It just the single raid5 stripe that is corrupted. You likely won't find out about the problem until you lose a disk. But even then it will just be a few pages that are impacted.
So?, i will just heal itself?, continue to work with some corrupted files (corrupted stripe effect)?
Hi Ciro, Try to think of a RAID Array as a single partition. You put a filesystem "on top" of a partition or a RAID Array. If the power fails, the -partition- DOES "survive". The filesystem may have inconsistencies but it is probably recoverable. It is the same principle ( almost ) with a Soft-RAID array. If you have frequent power loss, IMHO, you should activate RAID write-intent bitmapping. The command is mdadm /dev/mdX -Gb internal If you are afraid about a RAID's inconsistency by issuing "echo check >> /sys/block/mdX/md/sync_action" and check for failures wiht "cat /sys/block/mdX/md/mismatch_cnt". If there are failures, correct it with "echo repair >> /sys/block/mdX/md/sync_action" You can also put it on a cron script... Hope it helps, Rui
Greg
Regards, Ciro
-- Rui Santos http://www.ruisantos.com/ Veni, vidi, Linux! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org