Download smartmontools (http://smartmontools.sourceforge.net/)
Execute:
smartctl -a /dev/hda # Check the status
smartctl -t long /dev/hda # Conduct a test
smartctl -l selftest /dev/hda # Allow the test to terminate and see the results
If necessary, use debugfs as written in the article here.