I have a raid system on debian:
Disk /dev/sda: 320.1 GB,...
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2432 19535008+ fd Linux raid autodetect
/dev/sda2 2433 2918 3903795 fd Linux raid autodetect
/dev/sda3 2919 38913 289129837+ fd Linux raid autodetect
Disk /dev/sdb: 320.1 GB, ...
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 2432 19535008+ fd Linux raid autodetect
/dev/sdb2 2433 2918 3903795 fd Linux raid autodetect
/dev/sdb3 2919 38913 289129837+ fd Linux raid autodetect
# df -h
/dev/md0 19G 12G 6,0G 66% / type ext3 (rw)
/dev/md2 272G 245G 25G 91% /var type ext3 (rw)
I would like to check if everything is running fine and configure it, so I will get an email if any error occurs.
the only line in my /etc/smartd.conf
is:
DEVICESCAN -d removable -n standby -m root -M exec /usr/share/smartmontools/smartd-runner
will that scan those 2 raid devices?
And in my /etc/cron.d/mdadm
there is this line:
57 0 * * 0 root if [ -x /usr/share/mdadm/checkarray ] && [ $(date +\%d) -le 7 ]; then /usr/share/mdadm/checkarray --cron --all --idle --quiet; fi
in /usr/share/mdadm/checkarray
it sais: it initiates a check run of an MD array's redundancy information
If you want to monitor reliability of hard disks install
smartmontools
package which provides utilities to check hard disks for disk degradation and failure, using the Self-Monitoring, Analysis and Reporting Technology System (SMART) built into most modern ATA and SCSI hard disks.The package contains
smartctl
tool which is useful for checking hard disks from command line andsmartd
daemon that checks hard disks at a specified interval and logs warnings/errors to the syslog and can also send warnings and errors to a specified email address.To enable the daemon, you have to uncomment the line
start_smart
in the file/etc/default/smartmontools
. Then, you have to define in the file/etc/smartd.conf
what hard disks do you want to monitor and start the servicesmartmontools
(check man smartd and man smartd.conf for detailed instructions, further, there are many examples in this file):You can monitor your md devices with
mdadm
tool. If you want to receive emails with alerts define a mail recipient in the file/etc/mdadm.conf
(details in man mdadm.conf and man mdadm):Then, schedule via cron this command (the schedule period is up to you):