LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-08-2013, 01:58 AM   #1
chicken76
Member
 
Registered: Mar 2009
Distribution: Slackware
Posts: 121

Rep: Reputation: 2
Question automatic scrubbing of software raid arrays


Does Slackware have automatic scrubbing of software RAID arrays implemented? I don't think it does, but it can't hurt to ask here and get a definitive answer.

Related question: how can one tell when the last scrubbing was performed on a particular array?
 
Old 07-08-2013, 02:47 AM   #2
Mark Pettit
Member
 
Registered: Dec 2008
Location: Cape Town, South Africa
Distribution: Slackware 15.0
Posts: 619

Rep: Reputation: 299Reputation: 299Reputation: 299
Reading your first sentence, I understood "scrubbing" to simply mean wiping with extreme prejudice. For that I would have used "dd if=/dev/zero of=raiddevice bs=5120 count=a_gazillion". But then your second sentence has confused me, as after a scrubbing you would essentially not have an array anymore. Can you be a bit more clear by what you mean by 'scrubbing", or describe the after-effects of "scrubbing".
 
Old 07-08-2013, 02:55 AM   #3
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
Scrubbing of md arrays has to be done by a cron job, and Slackware has no such job configured by default (I'm not aware of any distribution that has).

As for your second question, it seems (I'm hoping someone will prove me wrong) there's no field in the md metadata that keeps track of scrubbing once the job is completed. In other words, you can't tell from the metadata when (if ever) an array was last scrubbed; you'll have to check the logs.

Last edited by Ser Olmy; 07-08-2013 at 03:05 AM.
 
Old 07-08-2013, 03:14 AM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
Quote:
Originally Posted by Mark Pettit View Post
Can you be a bit more clear by what you mean by 'scrubbing", or describe the after-effects of "scrubbing".
The term "Scrubbing" means verifying every sector on every RAID member. It's also called "verifying" by some vendors. AMD calls it "synchronization", which is misleading to say the least.

The point is to detect and possibly correct errors before they become critical. Given the size of modern hard drives and the increasing popularity of delta backup schemes, large parts of an array can sit idle for very long periods. Should a sector in such a part of an array suffer silent corruption ("bit rot"), the sysadmin will be in for a nasty surprise when another drive eventually fails and is replaced, and the rebuild job runs into the bad sector.

Scrubbing/verifying means that any bad sector will be detected and, since the array is still redundant, possibly fixed if the affected drive can perform a sector remapping.
 
4 members found this post helpful.
Old 07-08-2013, 03:31 AM   #5
Mark Pettit
Member
 
Registered: Dec 2008
Location: Cape Town, South Africa
Distribution: Slackware 15.0
Posts: 619

Rep: Reputation: 299Reputation: 299Reputation: 299
Thank you @Ser. To be honest, it is a rather poor name, as the connotation of "wiping clean" lurks. The other two you mention are far better. I would have have possibly preferred "repair", or even "preventative maintained".
 
Old 07-08-2013, 03:35 AM   #6
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
Quote:
Originally Posted by Mark Pettit View Post
To be honest, it is a rather poor name, as the connotation of "wiping clean" lurks.
True, but the same term, "scrubbing", is used to describe basically the same function on systems with ECC RAM. It may not be very descriptive of the process, but at least it's consistently used.
 
Old 07-08-2013, 06:19 PM   #7
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
Not sure if you'll find this helpful but I wrote an rc.mdadm that has a "check" function. It could be set up to run on a cronjob if you wish.

It "Works for me(TM)" but could probably do with some wider testing.

http://slackware.com/~mrgoblin/files/rc.mdadm
 
1 members found this post helpful.
Old 07-09-2013, 01:31 PM   #8
chicken76
Member
 
Registered: Mar 2009
Distribution: Slackware
Posts: 121

Original Poster
Rep: Reputation: 2
Thanks mRgOBLIN. I was thinking of writing something myself, but now that I see the awk/sed magic that you put into it, I realize I can't possibly come up with something better.

Just one question about your script: why did you choose to make it an always-running process, with a PID file etc? Are there any advantages of doing it this way, that are not immediately evident?
 
Old 07-09-2013, 07:00 PM   #9
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
The monitor function should run all the time to, umm, monitor. That's what the pid is for.

The scrubbing stuff doesn't use the pid.
 
Old 07-09-2013, 09:03 PM   #10
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
As Mr Cranium alluded, having the monitor process running is a good idea. If you have put your email (e.g. MAILADDR root@mydomain.tld) into the mdadm.conf (as suggested by the comments in that file) you will get an email alert with any failures or other events that may need your attention.
 
Old 07-10-2013, 01:10 PM   #11
granth
Member
 
Registered: Jul 2004
Location: USA
Distribution: Slackware64
Posts: 212

Rep: Reputation: 55
Just add a line like this to your root crontab:

Code:
30 8 7,21 * * (echo check > /sys/block/md0/md/sync_action)
You'll see log activity when it runs:

Code:
[4821916.745073] md: data-check of RAID array md0
[4821916.745076] md: minimum _guaranteed_  speed: 1000 KB/sec/disk.
[4821916.745077] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for data-check.
[4821916.745081] md: using 128k window, over a total of 976559104 blocks.
[4833410.755520] md: md0: data-check done.
While the scan is running, you can use "cat /proc/mdstat" to monitor the progress.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Software RAID 1 with multiple arrays: mounts not honoured after reboot Gerard Lally Slackware 4 02-19-2012 09:01 AM
help with mounted RAID arrays captainentropy Linux - General 3 12-06-2011 07:54 AM
ICP raid controller, no automatic rebuild of raid 5 after replacing bad disk auclark@wsu.edu Linux - Newbie 3 12-14-2009 10:54 AM
reiserfs slight occasional corruption on software RAID-5 arrays Cairan Linux - Software 3 07-11-2006 04:11 PM
Transferring two RAID arrays Dee-ehn Linux - Software 2 09-01-2004 12:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration