Mac OS X Tip - Repairing Mac OS X Disks

by , 11:00 AM EST, March 26th, 2001

Now that Mac OS X is in the hands of untold thousands, people are going to start putting the new OS through its paces with reckless abandon. While Steve Jobs has said that the goal for Mac OS X is to never crash, that is a bit unrealistic. Users, on occasion, will experience problems with Mac OS X resulting from a damaged volume.

Disks in Unix, and thus OS X, are particularly sensitive to improper shutdowns. If a user is forced to "power out" of an OS X session, or the power goes out, or OS X is not allowed to go through a normal shut down process for any reason users may start to notice strange system behavior. One of the few problems with OS X is that the disk repair application included with the OS, Disk Utility, can not repair an OS X volume if that OS X volume is the start up volume. Users always have the option of booting into OS 9.1 and running the OS 9 version of Disk First Aid on the OS X volume, provided the volume uses HFS+ formatting.

A bit more complicated, but far more robust solution, is posted in an Apple Technical Information Library (TIL) article. Unix includes a powerful file checking function called "fsck" (File System Check). fsck is currently the most complete and powerful solution for checking and repairing OS X disks. New versions of Norton Utilities or Tech Tool Pro, when released, might provide a more simple option for fixing many problems. According to the TIL article:

Under normal circumstances, you should perform disk verification and repair using the Disk Utility application included with Mac OS X. If your computer is started up in Mac OS 9, you may also use Disk First Aid to verify and repair Mac OS Extended (HFS Plus) format disks.

In some situations, file system errors may prevent the computer from starting up to a normal state in which Disk Utility or Disk First Aid can be used. The fsck utility may be able to verify and repair a Mac OS X disk in such a situation. This could occur after improper shutdown, forced restart, or power interruption.

When and How to Enter Single-User Mode

Generally you need to enter single-user mode when these two things happen:

To enter single user mode:

  1. Restart the computer. You may need to perform a forced restart as described in the Emergency Troubleshooting Handbook that came with your computer.
  2. Immediately after the startup tone, press and hold both the Command (Apple) and "s" keys on your keyboard. The computer will displays a series of text messages, at which time you may release these keys. When startup is complete, the computer will display a command line prompt (#).The computer is now in single-user mode.

How to Use fsck From the Command Line

Once you have reached a command line, follow these steps to use fsck:

  1. Type the following at the # prompt: fsck -y
  2. Press Return.

    The fsck utility will go through five "phases" and then return information about the disk's utilization and fragmentation. If fsck alters, repairs, or fixes anything, it will display the message:

    ***** FILE SYSTEM WAS MODIFIED *****

    Important: If this message appears, repeat the "fsck -y" command until this message no longer appears. It is normal for your computer to require several "passes" of fsck, because first-pass repairs may uncover additional errors.

  3. When fsck reports that no problems were found, type the following command at the # prompt: reboot
  4. Press Return.

The computer should start up normally and allow you to log in.

Before undertaking this chore, we suggest you read the full article at the Apple Web site.