Intro
For the most part, Macs don’t crash as much as other computers. One reason for that is that the Mac doesn’t have to contend with an unpredictable mix of hardware and software: OS X is highly optimised for the machines that it runs on. In addition to that, OS X does a pretty good job of cleaning up after itself.
Still, occasionally, things do go wrong with a local disk drive and you’ll need to repair it to get your machine back in showroom condition. Here, we’ll show you a few ways to diagnose and repair corrupt and ailing drives, mainly using tools that are baked right into Mac OS X.
1. Using Disk Utility

OS X has built-in troubleshooting tools for disks that aren’t performing well. If your drive is slow or spontaneously rebooting, the first port of call should be Disk Utility. You’ll find it in Applications/Utilities. It’s easy to spot. The icon is a bare disk drive with a stethoscope.
2. Verify

The first thing to do when faced with a potentially corrupt or glitchy disk, is to verify the startup volume. When you run Disk Utility direct from the startup volume, this is called Live Verification. If Disk Utility finds problems, you’ll need to reboot and repair the volume in one of the ways we suggest below.
3. Repair permissions

Incorrect disk permissions can cause a host of issues, from misbehaving software to a disk that won’t start up. Disk permissions should be repaired from your Mac’s startup volume, not your installer – as Disk Utility compares the actual permissions in memory with those stored on disk.
4. Repair permissions

Free utility IceClean (www.macdentro.com) is worth a look as a Disk Utility alternative; hit Cmd-F3 to repair permissions on your Mac’s active volume. IceClean can also perform other maintenance jobs that can help your disks run more effectively, such as repairing launch services.
5. Start in Safe Mode

Booting in Safe Mode can sometimes be enough to fix issues with a machine that’s causing problems. Safe Mode forces a directory check, clears the loader cache and trashes the font cache. To invoke it, hold down the Shift key as your Mac starts, then restart after you’ve safely booted into OS X.
6. Boot with Install CD

If your boot volume needs to be repaired, use Disk Utility. You’ll need to boot from your original installation disc. Insert the disc and reboot holding down the “Cmd” key. After choosing your language, choose Disk Utility from the Installer menu. Click the First Aid tab to find repair options.
7. FSCK 1

If your disk won’t boot into OS X and you can’t boot into Safe Mode, then the last resort is the built-in disk repair tool FSCK – though strictly speaking, this is targeted at machines running OS X 10.3 or earlier. To use it, start the machine in single-user mode, holding down “S” as you reboot.
8. FSCK 2

Your machine will boot into the Darwin command line. Type /sbin/fsck -fy this launches FSCK and takes your disk through a five-phase repair process. At the end of the process, FSCK should report that your volume is OK. If not, run it again. FSCK can also be used to check disk integrity from the Terminal.
9. AppleJack 1

For GUI access to disk repair tools, you can install AppleJack. It runs from the same single user mode command line interface as FSCK, but is much easier to use. Make it a habit to install the program on new machines, so it’s ready to use and available if you do run into disk trouble.
10. AppleJack 2

AppleJack enables you to run most of the same repair routines as Disk Utility – along with a couple of extras. So, in addition to repairing permissions and disks, you can remove swap files, clean up disk caches and validate your preferences files.
11. Create a troubleshooting account

Some Mac problems aren’t caused by your machine, but by your user preferences. You can troubleshoot this by adding a second user account with Admin rights. Go to the Accounts preference pane and click the lock to make changes. Click the Add icon to add a new account.
12. Maintenance

Choose Administrator from the New Account drop-down and give the account a memorable long name and short name, like ‘Maintenance Account’ and ‘cleanup’. Add a password then click Create Account. If you have more problems with your main account, switch to this one to run diagnostics and fixes.
13. Mounting volumes

External drive didn’t mount when your machine booted up? Time to dig out Disk Utility again. Launch it from the Applications/Utilities folder in Finder. You should see all connected drives in the left-hand pane. Select the unmounted drive and click the Mount button in the tool bar.
14. Unmount volume or partition

You’ll notice that the Mount button is a toggle – you use the same button to mount or umount drives. So, if an external drive refuses to eject, open Disk Utility and try unmounting it instead. Unmounting kills all system activity in process – so it should work. Same goes for unruly disk partitions.
15. Restart your machine

When you’ve finished repairing your Mac’s drive, whether it’s been an intensive series of command line tweaks or a quick session in Disk Utility, you should reboot so any changes are applied. This applies particularly if you’ve had to remove programs and repair permissions during the process.