How to use smartmontools to monitor hard drives
From ArticleWorld
SMART is one of the newer and most appreciated technologies involved in hard drive manufacturing. SMART is like an interface, allowing the hard disks to be monitored for any problems or anomalies in their functioning.
If you consider you need this kind of functionality, follow the steps bellow to install and configure smartmontools. This is a set of Linux utils which can be used for monitoring hard drives which support SMART (this is the case with most disks newer than one or two years).
Procedure
1. Try to enable the SMART support from your BIOS settings. You should consult the motherboard's documentation for details, but do not panic if the BIOS does not show any option about enabling or disabling SMART. Your hard disk may still have this capability.
2. Install smartmontools, either from your distribution's package repository, or manually, from sources.
3. Test if your disk has SMART support:
smartctl -i (-d ata) [device]
You should use -d ata only for SATA disks. Replace [device] with the actual device (/dev/hda, /dev/sda or whatever your case is).
4. Enable SMART on the disk:
smartctl -s on [device]
again replacing [device] with the actual device. If you get any message about SMART already being active for that disk, you can safely ignore it.
Some smartctl tricks
1. To run a quick test of your hard drive, use
smartctl -H [device]
if you get FAILED, you should start backing up your data and browsing adds for a new hard drive.
2. To check past problems of your drive, use:
smartctl -l error [device]
Notes
SMART is by no means a replacement for backups. Use it to anticipate potential problems and schedule replacements, but keep backing up your data.
smartctl is a hugely powerful tool, with too many facilities to describe here. You should refer to its documentation, and maybe consider using (or writing) a smartctl GUI front-end.