In case that your hard disk repeatedly resets itself, immediately do a backup as long as you can, as it will become very hard to get at it when even the initialization on computer power-up fails! (I actually did a backup, but decided to reformat the destination HD and copy it file-wise over to have no defragmentation. I actually left out the copying since I wanted to wait until the resetting comes really hard. When it did, it was too late.)
The reason for such resets or a total init failure is most likely a mechanical one. This does not necessarily include a head crash (but also possible), but maybe the inability to make the head arms seek. In my case, I was able to rescue data off an already failed hard disk with the following technique. Do not expect this to work all times; it took me four more tries to get it running as it initially looked.
NOTE: If at any point, the hard disk has initialized fine, skip all further steps and get the hell your data off! (See even further below.)
Most enterprise servers have their harddisks lying on the side, i.e. the disk is perpendicular to the floor. This is a very good setup, because the heads between the metallic disks always(*) stay in the middle. This however is not the case for personal computers (PCs) which have their harddisks usually laying normal to the gravitational source, like a flat CD on a table. And that's where the problem is. Preceding a head crash is a mechanical failure which leads to the head being lower than it should.
Turn the hard disk by 180 degrees so that it lays top down (unpowered and unconnected). Leave it in that position for at least 6 hours. (In my case it was 12 hrs, since there was a night in between. After that, connect the power cable, but not any data transfer (IDE, etc.) cables.
Remember to turn off your computer unless you have some equipment that allows secure power hotplugging. Not doing so, that is, manually plugging it in, can badly damage the files, and even the hard disk. Yes, it was this hard disk that I manually plugged in once, about 1.5 years ago from now (April 2004). The heads went weird and erased many bytes here and there. (Like a wonder, the most important files were undamaged.)
Keep the hard disk in the top-down powered-on state for at least another 4 hours, even if the initialization process fails and the disk is not spinning itself. Finally, power off the disk for 5 seconds. In these five seconds, attach the IDE data cable and quickly repower it. You will definitely need to reboot (no hotplugging possible), as the BIOS will need to rescan it. (If you use something else than IDE, the procedure might be different.)
Should the hard disk be recognized as of this reboot and should it have initialized properly (finally), skip over to the data rescue. If not, reboot via the reset button. Doing so keeps the current voltage level, or if this is not the case by your motherboard, condensators will compensate for the few microseconds it is turned off. Or use any other means to let the drive reinitialize itself (do not power-plug!).
If the disk is still struggling with itself, try various rolls (i.e. perpendicular AKA 90 degrees) in all directions. For my case, it helped to shake the disk a few times slightly.
If you are sure that nothing helps, the only way will be to hand it over to a commercial data rescue organization who has specialized on opening hard drives, replacing defect stuff and reading the mirrory discs inside bit by bit. But that costs as much as the stairway to heaven is high. Expect to start at $150 and go way up to $2000 and more.
If you have succeeded to get through the hard disk's
initialization phase, boot your favorite OS. It would be best to do so in
Single User mode, or just anything that does not take too long and accesses the
affected disk as few as pssible. Do not try to copy
/dev/hdXY, as doing so will iterate over all blocks. Copying by
cp takes less time, less space and also
does not unnecessarily access areas. Do not run multiple
processes at once; try to copy off as incremental as a mounted filesystem
allows, yet keep in mind to get the most important stuff first.
Ah well, and before you finally disconnect it and dig a grave
for that old disk, erase it, if possible. For this you can use
dd_rescue, in hope that writing to the disk (and/or bad
sectors) will not block that much as reading would do (choose one command):
# dd_rescue /dev/zero /dev/hdX
# cat /dev/zero >/dev/hdX
dd_rescue is preferred because it does not
stop when an error (like