Mac OS X is not renowned for experiencing errors in the operating system's filesystem. But a crash caused by sudden power failure, for example, can corrupt important system files.

There are two principle ways to check and correct these errors. The slower but less daunting method relies on using the Recovery Partition included with all recent Macs. The faster way is more intimidating initially but equally effective.

Graphical interface

Included with OS X in the /Application/Utilities folder is the Disk Utility application. This can check and correct some errors – but not when it’s running from the system boot drive.

So use the version included in the Recovery Partition. Simply restart the computer and hold down the Alt key as it starts.

This presents the EFI graphical bootloader with the different available boot volumes. For most Macs, you’ll see a silver-coloured hard disk called Macintosh HD on the left, and another labelled Recovery on the right.

Use your mouse or the arrow keys to highlight the latter, and click – or just press Return.

OS X errorcheck

After a few more seconds, you’ll see a list of options such as Reinstall OS X and Restore From Time Machine Backup.

OS X errorcheck2

Select Disk Utility, and from here, select the Macintosh HD in the left-hand sidebar. Then click on Repair Disk option in the lower-right corner.

OS X errorcheck3

Any small errors will be fixed. Bigger issues will result in a message that says the volume cannot repaired.

If that’s the case, you’ll need to reinstall from a Time Machine backup, or use the Reinstall OS X option to start the automated process for a clean install. This requires an internet connection, the faster the better, in order to download the OS X installer afresh from Apple.

With a broadband connection of around 20 Mbit/s, this will take up to an hour.

OS X errorcheck4

Command line

The faster way to check OS X for errors is from the UNIX single-user mode screen.

To access this, reboot the computer, this time holding down the Cmd and S keys together.

A stream of white text on a black background will briefly pour down your screen. When it’s settled a few seconds later, carefully type the following:

fsck -yf

This invokes the 'filesystem check' command, the same command that is normally hidden behind Disk Utility’s graphical interface.

os x errorcheck5

After a minute or two, you’ll see a message saying ‘The volume Macintosh HD appears to be okay’. Or not.

If it simply says *File system was modified*, repeat the process with the fsck -yf command, until you see a message that your boot HD appears to be okay.

Then, type 'reboot' without the quotes to reboot your computer normally.

If the disk cannot be repaired, you will need to restore from backup or make a clean install of the OS X operating system.