S.M.A.R.T. is a mechanism to find and notify harddisk failures, before the harddisk dies.
In the year 2006 Google published a report about 100,000 failed harddisks in their operation. Just in 64% of all cases S.M.A.R.T. did notify the problem, so you could react to keep the problem small.
Even so, the learning of the mechanism of harddisk failure types in setting up Smartmontools is helpful to take more care about your data on a harddisk.
The used Ubuntu version was 12.04 LTS.
The Smartmontools are available in the repository of Ubuntu, and can be installed from there (Version 5.41).
If a mail system is not already installed, the mail program heirloom-mailx (Version 12.5-1build1) will be installed too.
As installed, the system is just passive, unless you edit /etc/default/smartmontools for to send an Email, if there was a drive error.
# uncomment the following line for periodic checking! start_smartd=yes # uncomment the following line to have an automatic check every 30 minutes smartd_opts="--interval=1800" # start the smartmon daemon "smartd" $ sudo /etc/init.d/smartmontools restart
I you want to check the notification system, edit file /etc/smartd.conf
# add the option "-M test" to the following line and save the file: DEVICESCAN -d removable -n standby -m root -M test -M exec /usr/share/smartmontools/smartd-runner # make to work: $ sudo /etc/init.d/smartmontools restart # a test Email is send to root (postmaster) # if the test was OK, remove the option "-M test" from the file # for details please see: $ man smartd.conf
For more details, please see the reference in the links.
Gsmartcontrol is the GUI for the tool smartmontools, to check manually. It needs root rights to work.
When you start the program, you will see the found drives which have S.M.A.R.T. control enabled as icon. Double clock the icon you want. A window opens with 6 tabs.
Tab number 2 Attributes shows the read out S.M.A.R.T. values in a table form. When you stay about 2 seconds with the mouse pointer over a line it will show a box with some explanation about this parameter and, more important, give some hint when to worry about the drive. If a parameter is critical, its line will have a light red background color.
More important is tab number 4 Error log. If the letter color is in red you will have a drive error. Then it makes sense to click on that tab, in order so see the kind of error.
In case the Smartmontools daemon is running, it will send an Email to user root. That is nice, but usually you are logged in as a normal user.
In order to get those notification Emails as a normal user, you have to setup an alias:
# Edit file /etc/aliases # append the line: root: <user name> # make it to work: $ sudo newaliases
Smart-notifer is a Python program to show in a graphic window the smartd notification.
In order to work the daemon smartd must run.
After installation you have to log-off and log-on, in order to start the daemon smart-notifier, or do an Ubuntu restart.
Check this with:
$ ps -Af | grep notifier ... /usr/bin/python /usr/bin/smart-notifier
How to test the notification is described above under chapter #smartmontools.