LWN.net Logo

The 2006 Linux File Systems Workshop

The 2006 Linux File Systems Workshop

Posted Jul 6, 2006 14:06 UTC (Thu) by nix (subscriber, #2304)
In reply to: The 2006 Linux File Systems Workshop by hmh
Parent article: The 2006 Linux File Systems Workshop

md-raid can already do this.

Just stick in cron something like

2 5 15 * * echo check > /sys/block/md-$blah/md/sync_action

to check parity on array md-${blah} (which of course reads every block on every disk in the array).

(OK, so you might want something a bit more elaborate to prevent checking if sync_action for the array is not 'idle' so as not to interrupt a real resync.)

This will proceed in the background and respect other accesses to the block device by slowing down, just like md resyncs always have.


(Log in to post comments)

The 2006 Linux File Systems Workshop

Posted Jul 6, 2006 14:29 UTC (Thu) by hmh (subscriber, #3838) [Link]

Thanks! That does half the job already, and will at least find errors that have already happened and attempt to fix them.

It would be nice to have a "scrub" action that actually writes the entire array (all member devices, all sectors) to refresh aged sectors, though. "check" won't help there, and forcing a resync on every member device in turn is a very awkward (not to mention suboptimal) way to do it.

The 2006 Linux File Systems Workshop

Posted Jul 6, 2006 15:23 UTC (Thu) by nix (subscriber, #2304) [Link]

Forcing a resync won't rewrite everything, in any case, only the parity stripes: the non-parity stripes will only be read (unless you hit a write error in the parity stripe, of course).

The 2006 Linux File Systems Workshop

Posted Jul 6, 2006 15:54 UTC (Thu) by hmh (subscriber, #3838) [Link]

You have to set the member device to be "refreshed" to faulty, hot-remove and hot-add it back. This is, of course, dangerous depending on your array configuration.

As I said, it is very awkward, and thus a scrub function would be welcome.

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds
Powered by Rackspace Managed Hosting.