One of my professors observed that EEs, regardless of whether they specialize in microcircuits or power generation, inevitably have relatives who ask them to fix televisions, so we might as well get some practical knowledge to show we hadn't wasted the last four years. He then devoted a spring-semester week to explaining how to diagnose and fix typical TV problems, a pleasant change from the usual theoretical rigor.
With that lesson in mind, here are some handy hard-drive rescue techniques. I'll start with a motivational tale, show how to impress your friends, then demonstrate why this is more relevant to embedded systems work than you might think.
Simple Recovery
Although I run SuSE Linux on my desktop systems, I still maintain two Windows boxes. One, a triple-boot desktop, normally runs a Debian-based distro with the RTAI real-time kernel for my CNC milling machine. During tax season, it boots Windows XP for TurboTax and streams Internet radio into my basement shop with SuSE Linux.
One day, the CNC controller didn't start up correctly. Linux records nearly every event somewhere and it seemed several sectors had gone bad on that ancient 40-GB drive. Yes, three operating systems can fit in 40 GB.
A separate file server provides NFS and SAMBA shares for all our data files, so the desktop boxes don't store any vital data and all systems have access to the same files. Backup is fairly simple, with not much to save beyond /etc and /home. Reinstalling Windows and its programs, though, remains a chore.
Rather than fiddle with the details, I simply store image copies of the disk partitions on the file server and update them every now and then. Restoring a drive requires nothing more than recreating the partitions and copying the images. Although there are many Windows hard-drive utilities available, the Linux alternatives provide fine-grained control, plus they're both free as in beer and free as in speech.
Many of the instructions for full-drive restoration assume you'll restore the image to an identical drive, but that's applicable only when you buy drives in bulk. The last time I checked, no two drives in my heap were identical. I swapped in a slightly newer 80-GB drive and started the restoration process by booting SystemRescueCd.