If you have used Macs long enough you must have heard of people having problems booting up their machines from time to time. For instance their Macs start up but they either won't reach the OS X login screen or reach it but fail to load the Mac OS X Desktop after logging in.
In other cases the Mac only partially start and then it displays a command line in a text-only environment, such as ”file system dirty, run fsck”.
These problems may appear after a forced restart, an improper shutdown, or power interruption. Because all of these situations may be experienced by any Mac users, you will, eventually, come across one or more of the described boot issues.
If one of the above has also happened to you, you may have to take matters in your own hands and give this step-by-step guide (also detailed by Apple on their support website) a spin.
Here you will find step-by-step instructions on how to use a disk repair utility to fix your Mac’s boot issue. OS X comes with two utilities for this: Disk Utility and fsck (a command-line utility).
These two tools can also be used if you want to just check your Mac’s disk for any errors. You can also use these even when your everything is OK with your Mac, but you just want to check the disk for possible file system issues.
-The Safe Boot solution
-The Disk Utility solution
-The fsck solution
fsck must be run from the command line and these are the steps you will have to follow:
1. Start up your Mac in single-user mode (press the power button and immediately press/hold the Command (Apple) key + the "s" key) to reach the command line.
Note: If you cannot start your machine you will have to perform a forced restart. On a desktop based Mac you will have to hold down the power button for several seconds.
On portable computers, simultaneously press the Command-Control-power keys. If your portable computer does not restart using this method, you may have to reset the Power Manager (use the Apple support guide available here).
2. At the command-line prompt type “/sbin/fsck –fy” and press return. fsck will now go through five "phases" and automatically return information about your disk's fragmentation and use.
Once this process is finished, fsck will display the ** The volume (name_of_volume) appears to be OK message if no issue is found. If fsck has found any issues and has fixed anything on your disk, it will display this message: ***** FILE SYSTEM WAS MODIFIED *****
NOTE: If the second message appears, you will have to repeat the command typed at step 2 until fsck will tell you that your volume appears to be OK (you have to do this because first-pass repairs may uncover additional issues).
3. When fsck reports that your volume is OK, type reboot at the prompt and press Return. Your Mac should now start up normally and allow you to log in.