TITLE
    Mac OS X Public Beta: Why, When, and How to Run fsck for File System Maintenance
Article ID:
Created:
Modified:
106029
10/9/00
10/9/00

TOPIC

    You may need to run the fsck (file system check) utility in some situations, presented in this article with instructions.


DISCUSSION

    Under normal circumstances, you should perform disk verification and repair using the Disk Utility application included with Mac OS X Public Beta. 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.

    One of Two Symptoms May Indicate a Need to Use fsck

    1. Partial start with command line

    The computer starts up partially then pauses in a command-line (text only) environment. A message such as "file system dirty, run fsck," may appear. Below the message, there is a command line, indicated by a pound-sign prompt (#). Commands you type in this environment appear next to the prompt. When this happens, you should run fsck from the command line.

    2. Partial start without command line

    The system starts up partially but does not display a command-line prompt. It may fail to reach the login screen, or it may reach the login screen but fail to reach the Desktop after the user name and password are entered. In this case, you must start up in single-user mode.

    When and How to Enter Single-User Mode

    Generally you need to enter single-user mode when these two things happen:
    • The computer fails to start up normally.
    • The command line prompt (#) does not appear.

    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 the "s" key. The computer displays a series of text messages followed by 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.

    Syntax

    This extra information is provided for users interested in UNIX-style command-line syntax.

    The -y flag:

    This tells fsck that you want to answer "yes" to all questions about fixing, repairing, or salvaging information. This is the optimal approach, as answering "no" to any question causes fsck to stop. You cannot determine that all necessary repairs have been made until fsck completes and gives its final report.


Document Information
Product Area: Mac OS System Software
Category: Mac OS X
Sub Category: General Topics
Keywords: kmosX

Copyright © 2000 Apple Computer, Inc. All rights reserved.