This comes standard on Ubuntu and gives you a very comprehensive report on the health of your drives and system.....

It detected and gave a highly detailed report on issues with my failing 1TB HDD days before Dell or Windows 7 even noticed the drive had problems.
Though there are free SMART reporting tools for pretty much every OS. It also never hurts to use the SMART tools on OEM drives from cheap places. Some of these places will try to sell a second hand drive as OEM. The SMART tools will tell you if a drive is new or not.
The lessons here are:
-Data matters, software doesn't.
-Always have a reliable, preferably local (non-internet / cloud), and preferably automated backup system.
-Replace drives on a schedule, not at the point of failure. (I'd suggest every couple of years.)
-If you have the option, don't format the replaced drive but securely store it off site. (That's the 'my place burnt down' failsafe.) Failing that, then consider and internet / cloud backup option, but remember that puts your data at the mercy of a company with a funky 117 page agreement, that can go bankrupt, or have legal troubles, and that you're relying on one or more intermediate networks to get to that data.
-If you can figure it out, use a mirrored RAID. (Trivial under Linux.)
-If you can, set up your permissions so you have to log in as a special user to destroy your data.
-Check what the dive has to say about itself via SMART, but automate it in a manner that you can't miss if you can.
-Don't use spinning disks in bouncy / vibrating places. I don't care if the device has 'jolt protection', just don't.
I'm a data nut since I lost several hundred hours of coding, along with the rest of my files, in the mid-90s. Never again. That song that girlfriend wanted me to download in 2003. Still got it. Still neatly filed. Never delete, never lose data, never surrender.