Linux has a fairly robust tool for detecting SMART hard drive failures – the smartmontools suite. I have used this suite on my server for a number of years, having caught 3-4 failures before they were able to cause an issue. On the server, I have a mail server running that emails me about any imminent failures. But, for whatever reason, I have never set up SMART monitoring on my laptop. One reason may have been that I didn’t want to go through the hassle of setting up a mail server.
The combination of smartmontools and smart-notifier provide an alternative, with smartmontools doing the heavy lifting and smart-notifier providing an on-screen cue should anything go awry. First, install packages:
sudo apt-get install smartmontools smart-notifier
Second, setup smartmontools. First, you must edit /etc/default/smartmontools by uncommenting the line: start_smartd=yes, as well as editing the line: enable_smart=”/dev/sda”, to include your drive(s). Third, you must edit /etc/smartd.conf. Make sure that all of the lines in the file are commented, then add the following line at the bottom of the file:
DEVICESCAN -m root -M test -M exec /usr/share/smartmontools/smartd-runner
This line tells smartd to post a test alert when it is started and to execute the smartd-runner program. That program is what notifies smart-notifier to display a message.
Fourth, restart your computer. When you are back in Gnome, open a terminal window and enter the following command:
sudo /./etc/init.d/smartmontools restart
You should see the following:

If this worked, you have one last step, modifying your smartd.conf file to remove the test. Change the last line to the following:
DEVICESCAN -m root -M exec /usr/share/smartmontools/smartd-runner
If the notification does not show up, make sure that smart-notifier is running.