installation stuck in a loop due to damaged HD

Solution 1:

If you haven't already made backups, you can start up from the recovery partition and save a disk image of the main OS X volume (or other volumes you use) to a different drive in Disk Utility.

The first thing I'd try would be to do an upgrade install of 10.7 by choosing Reinstall OS X without erasing anything first. If that wouldn't work, I'd do a clean reinstall and restore files manually.

See these Apple KB articles:

  • Mac OS X v10.5, v10.6: How to back up and restore your files
  • OS X Mountain Lion: Reinstall OS X
  • OS X Mountain Lion: Erase and reinstall OS X

Solution 2:

Since your install didn't complete, it's entirely likely you still have a Mountain Lion recovery HD and can simply wipe the entire drive and start over with Mountain Lion to ensure it's really a hardware issue (or rule out a hardware issue).

  • OS X Mountain Lion: Erase and reinstall OS X - http://support.apple.com/kb/ph11273

Just power it off, press the power button and hold the option key to boot into Recovery HD. From there you use Disk Utility to erase the entire drive (repartition it if needed). You could also connect the Mac to another computer in target disk mode and repair / erase the volume and then go back to recovery HD (or run Mountain Lion installer from a second Mac with yours still in target mode).