[sclug] Setting up SATA RAID for /home not / (Debian Lenny)

Alex Butcher lug at assursys.co.uk
Wed May 20 15:20:04 UTC 2009


On Wed, 20 May 2009, John Stumbles wrote:

> Bonus Q for another 10 points: I strikes me it would be kewl to know when the 
> first HDD failure occurs, rather than waiting for the second ;-). Presumably 
> it'll be noted in the logs, but is there any more prominent way of getting 
> notification?

1) Run the mdadmd daemon and configure it to mail you when a drive drops out of
the array.

2) Regularly perform a read test on the array, which if you're running a
kernel newer than 2.6.15 or so, will force failed blocks to be re-written
with a copy of the data from the other drive in the array.

>From /etc/crontab:

# scrub RAID1 arrays at 8.30AM Mon-Fri
30 8 * * 1-5 root echo check >/sys/block/md3/md/sync_action
30 8 * * 1-5 root echo check >/sys/block/md0/md/sync_action
30 8 * * 1-5 root echo check >/sys/block/md1/md/sync_action

3) Run SMART long self tests regularly, and have smartd running and configured
to mail you if a critical attribute changes. If the discs are large and
supports spanned selective self-tests, consider splitting the tests up so
that only part of each drive is tested each day.

>From /etc/crontab:

# S.M.A.R.T. tests from Monday, spanned, weighted towards rim starting at
# 12pm
01 12 * * 1 root /usr/sbin/smartctl -t select,0-420000000 /dev/sda
01 12 * * 1 root /usr/sbin/smartctl -t select,420000001-810000000 /dev/sdb
01 12 * * 2 root /usr/sbin/smartctl -t select,420000001-810000000 /dev/sda
01 12 * * 2 root /usr/sbin/smartctl -t select,810000001-1150000000 /dev/sdb
01 12 * * 3 root /usr/sbin/smartctl -t select,810000001-1150000000 /dev/sda
01 12 * * 3 root /usr/sbin/smartctl -t select,1150000001-1450000000 /dev/sdb
01 12 * * 4 root /usr/sbin/smartctl -t select,1150000001-1450000000 /dev/sda
01 12 * * 4 root /usr/sbin/smartctl -t select,1450000001-1690000000 /dev/sdb
01 12 * * 5 root /usr/sbin/smartctl -t select,1450000001-1690000000 /dev/sda
01 12 * * 5 root /usr/sbin/smartctl -t select,1690000001-1820000000 /dev/sdb
01 12 * * 6 root /usr/sbin/smartctl -t select,1690000001-1820000000 /dev/sda
01 12 * * 6 root /usr/sbin/smartctl -t select,1820000001-max /dev/sdb
01 12 * * 7 root /usr/sbin/smartctl -t select,1820000000-max /dev/sda
01 12 * * 7 root /usr/sbin/smartctl -t select,0-420000000 /dev/sdb

HTH,
Alex



More information about the Sclug mailing list