Your Mac has begun showing signs of trouble. Perhaps you frequently get errors when trying to open or save files. You suspect a problem with the hard drive. Before panic sets in, you want to launch Apple's Disk Utility and select Repair Disk from the First Aid tab. Hopefully, that will remedy the situation. One problem though: Repair Disk is dimmed and you can't select it. Why? Because OS X cannot attempt repairs on an active startup drive. You can still use Repair Permissions, which may help in certain situations. But let's assume it doesn't.
So what do you do instead? That depends on what Macs you own, how you have set them up, and what other precautions you may have taken prior to the start of the trouble.
First things first, if you don't have a recent backup, make one now. But be careful. At this point, you don't want to overwrite an existing backup--lest you replace valid data with corrupted data. Instead, back up to a separate drive. When you're done backing up, here are the things to try. You can try each method until you find one that works:
Boot from the startup drive's Recovery HD partition
The startup drives of Macs formatted with OS X 10.7 (Lion) or 10.8 (Mountain Lion) typically have a hidden partition designed just for moments like this. This 650MB partition is called Recovery HD. Boot your Mac from Recovery HD by holding down Command-R at startup (or by choosing it from within Startup Manager, which you access by holding down Option at startup).
If you are able to boot from Recovery HD, Disk Utility will be one of its four main options. Open Disk Utility and locate the name of your startup drive. You should now be able to select Repair Disk for that drive. From Recovery HD, you can also browse the Web for troubleshooting info using Safari as well as erase your startup drive and restore its contents from a Time Machine backup.
If you are unable to boot Recovery HD via either of these methods, it means there is no Recovery HD partition on your drive or your drive is too damaged to allow successful booting from the partition. In either case, it's time to move on to the next repair attempts.
Boot from your emergency drive
If you previously created an emergency drive (see "Mac troubleshooting: Be prepared for hard-drive failure"), now is the time to use it. Restart while holding down the Option key. From the screen that appears, select the emergency drive. Once booted, things should work nearly identically to starting up from the Recovery HD partition. Launch Disk Utility, choose your startup drive in the list, and select Repair Disk.
Sign up for CIO Asia eNewsletters.