A few days ago the iMac wouldn't boot. It had shut down properly so it didn't make sense. I booted up in Recovery Mode by holding down command-R during start up and ran Disk Utility. Disk Utility gave an error where x amount of space should have been written to file but only x-y space had been written. Thus, Disk Utility couldn't repair its own disk.
Disregarding this, I searched for solutions anyway and tried a variety of things for quite a few hours. I thought this was rather comprehensive and thorough but the iMac still wouldn't boot. I even fruitlessly tried to restore the operating system with a few of the latest Time Machine backups. These failures made sense: how was an operating system supposed to repair itself? Ah, Target Disk Mode.
Target Disk Mode was introduced by Apple with the Powerbook 100 in 1991. It's something unique to Macs and it's so handy. By connecting the broken Mac to another machine using a Thunderbolt or Firewire cable and holding down T during start up, you can run your Mac as an external drive to another Mac. In doing so, you can copy files from or run repair protocols on the sick machine from the properly functioning one.
I had read quite a few forum posts lauding the powers of DiskWarrior to repair a Mac but one respected authority mentioned it wasn't a guarantee. Also, there were many Apple diagnostics and respected Mac authorities such as the one linked to in the second paragraph above which don't mention DiskWarrior or any other third party tools. There are, however, posts which mention a Genius Bar recommending or even using DiskWarrior to repair a hard drive.
It was about 11pm so I went ahead and bought DiskWarrior from the Alsoft website. The download was available immediately. (Additionally, they send a bootable flash drive to your home for any future emergencies.) I installed the software on the MBP and ran it. Voilà! The iMac's drive appeared as one of the buildable options. It also rated the directory structure a 5 out of 10 for optimization. I chose the drive and clicked Rebuild. In about 30-45mins, it had an image for me to review before replacing the current, unworkable directory structure. The message said that all the files and data were found. woo hoo! I went through the directory structure of the image to check, hit Replace, and then waited for it to finish.
The directory structure was now rated a 10. I powered down the iMac to take it out of Target Disk Mode and rebooted it. It worked.
So if your partitions or directory structures can't be repaired by Disk Utility, I highly recommend going straight to DiskWarrior. The company makes products for Macs only and was founded by two former Apple employees. Their website provides a helpful list as to when you should use DiskWarrior.
There were many forum posts saying Disk Utilty's failure to repair a hard drive meant the hard drive was about to fail. I'll make a full backup just in case that happens. In the meantime, I'll keep an eye on it, run DiskWarrior monthly, and keep you posted.