Fixing the Disk
What happens if something goes wrong with the complex software that operates the hard drive itself?
Fortunately, Mac OS X comes with its own disk-repair program. In the familiar Mac universe of icons and menus, it takes the form of a program in Applications→Utilities called Disk Utility. In the barren world of Terminal and the command-line interface, there’s a utility that works just as well but bears a different name: fsck (for file system check).
In any case, running Disk Utility or its alter ego fsck is a powerful and useful troubleshooting tool that can cure all kinds of strange ills, including these problems, among others:
Your Mac freezes during startup, either before or after the login screen.
The startup process interrupts itself with the appearance of the text-only command line.
You get the “applications showing up as folders” problem.
Method 1: Disk Utility
The easiest way to check your disk is to use the Disk Utility program. Use this method if your Mac can, indeed, start up. (See Method 2 if you can’t even get that far.)
Disk Utility can’t fix the disk it’s on (except for permissions repairs, described at the beginning of this appendix). That’s why you have to restart the Mac into Recovery Mode and run Disk Utility from there. The process goes like this:
Start up the Mac from the Recovery HD, or a recovery flash drive.
They’re both described earlier in this appendix. You wind up, after some time, at the Utilities screen.
Click “Disk Utility: Repair or erase a disk ...