Sun, 24 Oct 2004

smartmontools

smartd, from the smartmontools package, is one of those things that you don’t really want to think about, but you probably should (at least a little bit). It monitors the health of your computer’s disks using the S.M.A.R.T. system built into most modern ATA and SCSI hard disks. It can give you advanced warning of your disks failing, which can be just enough time to get all of your data off of them.

The Debian default config tells smartd to scan for all possible ATA and SCSI disks, and to monitor the ones that it finds. Despite the comment in the config file that “most users should… explicitly list the devices that they wish to monitor”, smartd seems to do a good job of not getting confused by CD-ROM drives, RAID controllers, etc., so letting it do a device scan just simplifies its configuration.

By default, smartd will just log what it finds into syslog, but it can do more. I like to have it email root if it predicts a drive failure, and to run a set of SMART self tests. The SMART tests are non-intrusive and can be safely run while the system is up.

The configuration file is sadly a bit cryptic, so you can can a copy from here:

The smartmontools package also includes a commandline utility, smartctl. The most useful commandline argument is --all, which will query and display all of the available SMART readouts from a device, like so:

smartctl --all /dev/hda

It will generate a few screens worth of output, so dumping it into a file or less is probably what you want.

[/config/smartmontools] permanent link