4 ms·
everyone seems to be using this to push their favourite file system, which is fine and all, but if you're using software raid on linux this is the kind of thing
by andrewcooke 13y ago
everyone seems to be using this to push their favourite file system, which is fine and all, but if you're using software raid on linux this is the kind of thing you need:
#!/bin/bash
#
# This script checks all RAID devices on the system
# http://en.gentoo-wiki.com/wiki/Software_RAID_Install#Data_Scrubbing
for raid in /sys/block/md*/md/sync_action; do
echo "check" >> ${raid}
done
(the link referred to seems to be down for me at the moment - i just took this from my main machine).
then add a crontab entry to run it once a week or so:
0 0 * * 0 /root/bin/scrub-raid.sh &
you can check the script by running it by hand and then doing
cat /proc/mdstat
where you'll see something like:
Personalities : [raid1] [raid0] [raid10] [raid6] [raid5] [raid4] [linear]
md1 : active raid1 sdb1[0] sdc1[1]
976760640 blocks super 1.0 [2/2] [UU]
[=>...................] check = 6.0% (59419520/976760640) finish=191.3min speed=79902K/sec
bitmap: 0/8 pages [0KB], 65536KB chunk
finally, my notes on this - http://www.acooke.org/cute/ScrubbingR0.html http://www.acooke.org/cute/ScrubbingR0.html