How to check the health of a hard drive
sudo smartctl -a /dev/sda | less
This will give you an abundance of information about your hard drive's health. The tool also permits you to start and monitor self tests of the drive.
If you want to do benchmarks / check all of the sectors to find one that is bad, you can find other tools for that, but smartctl is the first place to go for drive health status.
badblocks is one more useful utility; it shows the amount and location of bad blocks on your drive:
sudo badblocks -v /dev/sda
If a HD starts to give you physical hints about an upcoming failure, no software will help. Yes, SMART exists and things like smartctl can read its results for you, but you shouldn't bet on it. SMART can be useful for detecting things like high temperatures or bad sectors, but if your HD starts to click or does not start up during the first try, it's time to
- make sure you have backups
- rush to nearest computer dealer, buy a new HD and copy everything there
When HD decides to fail, it will do it without a previous warning and Murphy's law says that the failure will happen during the most unwanted moment. So be prepared and backup & replace the disk NOW rather than waiting for the catastrophe.