All of lore.kernel.org
 help / color / mirror / Atom feed
* Periodically scanning RAID arrays for inconsistencies
@ 2013-03-01 21:50 Brassow Jonathan
  2013-03-01 22:10 ` Tregaron Bayly
  2013-03-04  5:42 ` NeilBrown
  0 siblings, 2 replies; 4+ messages in thread
From: Brassow Jonathan @ 2013-03-01 21:50 UTC (permalink / raw)
  To: linux-raid@vger.kernel.org Raid; +Cc: NeilBrown, Jonathan Brassow

Is there a way to periodically scan a RAID array to report any discrepancies?  This would be something like the initial synchronization, but would do nothing but report anomalies.  For example, it is possible for tracks to be altered when adjacent tracks are repeatedly written.  It might happen rarely, but without a periodic scan, you would never know about it.  Leaving aside the question of /what/ to do when an anomaly is found, I haven't seen any code or indication in the man page for 'mdadm' that would suggest this is currently possible.  Am I wrong?  Is there a way to do this?

 brassow


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Periodically scanning RAID arrays for inconsistencies
  2013-03-01 21:50 Periodically scanning RAID arrays for inconsistencies Brassow Jonathan
@ 2013-03-01 22:10 ` Tregaron Bayly
  2013-03-02 16:24   ` Phil Turmel
  2013-03-04  5:42 ` NeilBrown
  1 sibling, 1 reply; 4+ messages in thread
From: Tregaron Bayly @ 2013-03-01 22:10 UTC (permalink / raw)
  To: Brassow Jonathan; +Cc: linux-raid@vger.kernel.org Raid

On Fri, 2013-03-01 at 15:50 -0600, Brassow Jonathan wrote:
> Is there a way to periodically scan a RAID array to report any discrepancies?

Yes, it's possible - Redhat distributes a script called raid-check that
is a good example of this very thing.

Documentation/md.txt talks about 'check' and 'repair' as valid words for
sync_action in sysfs.  The number of errors found will be reported to
mismatch_cnt.  These can be found at /sys/block/md#/md for your array.

hth,

Tregaron


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Periodically scanning RAID arrays for inconsistencies
  2013-03-01 22:10 ` Tregaron Bayly
@ 2013-03-02 16:24   ` Phil Turmel
  0 siblings, 0 replies; 4+ messages in thread
From: Phil Turmel @ 2013-03-02 16:24 UTC (permalink / raw)
  To: tbayly; +Cc: Brassow Jonathan, linux-raid@vger.kernel.org Raid

On 03/01/2013 05:10 PM, Tregaron Bayly wrote:
> On Fri, 2013-03-01 at 15:50 -0600, Brassow Jonathan wrote:
>> Is there a way to periodically scan a RAID array to report any discrepancies?
> 
> Yes, it's possible - Redhat distributes a script called raid-check that
> is a good example of this very thing.
> 
> Documentation/md.txt talks about 'check' and 'repair' as valid words for
> sync_action in sysfs.  The number of errors found will be reported to
> mismatch_cnt.  These can be found at /sys/block/md#/md for your array.

In general, this is called "scrubbing" your array, and it is *vital* to
do this on a regular basis.  Weekly is good.  You should only use
"check" to find mismatches (and it will fix UREs).  If any mismatches
are found, use "repair" to synchronize the devices, then fsck to fix any
resulting errors.

There's lots of history on this in the archives...

Phil


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Periodically scanning RAID arrays for inconsistencies
  2013-03-01 21:50 Periodically scanning RAID arrays for inconsistencies Brassow Jonathan
  2013-03-01 22:10 ` Tregaron Bayly
@ 2013-03-04  5:42 ` NeilBrown
  1 sibling, 0 replies; 4+ messages in thread
From: NeilBrown @ 2013-03-04  5:42 UTC (permalink / raw)
  To: Brassow Jonathan; +Cc: linux-raid@vger.kernel.org Raid

[-- Attachment #1: Type: text/plain, Size: 943 bytes --]

On Fri, 1 Mar 2013 15:50:05 -0600 Brassow Jonathan <jbrassow@redhat.com>
wrote:

> Is there a way to periodically scan a RAID array to report any discrepancies?  This would be something like the initial synchronization, but would do nothing but report anomalies.  For example, it is possible for tracks to be altered when adjacent tracks are repeatedly written.  It might happen rarely, but without a periodic scan, you would never know about it.  Leaving aside the question of /what/ to do when an anomaly is found, I haven't seen any code or indication in the man page for 'mdadm' that would suggest this is currently possible.  Am I wrong?  Is there a way to do this?
> 
>  brassow

echo check > /sys/block/mdX/md/sync_action

look for results in /sys/block/mdX/md/mismatch_cnt

See "SCRUBBING AND MISMATCHES" in "man 4 md".

Yes it would be nice if mdadm provided a nicer interface to this.  Patches
welcome:-)

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-04  5:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-01 21:50 Periodically scanning RAID arrays for inconsistencies Brassow Jonathan
2013-03-01 22:10 ` Tregaron Bayly
2013-03-02 16:24   ` Phil Turmel
2013-03-04  5:42 ` NeilBrown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.