TOPIC
This article details common reasons an administrator might need to run the fsck ('file system check') utility, and describes the means of so doing, from the single-user shell, when booted from the default system drive, or from the system software installer CD.
DISCUSSION The fsck utility is used to perform routine maintenance and recovery on a Mac OS X system hard disk that has either become unbootable or will not start to multi-user mode due to events or occurrences such as improper shutdown, forced restart, power outage, an accidentally disconnected power cord, and so forth. There are several possible situations that may cause a Mac OS X system drive to fail to boot properly into the full Mach/BSD environment. Common causes of this issue include improper shutdown, power outage, pilot or visitor error such as kicking a power cord, UPS failure, improper use of front-panel buttons, or a full system disk. Yes, Mac OS X does permit the command-control-Power key restart, but don't do it! Improper shutdown or a forced power cycle are always valid reasons to run the fsck utility to repair the system drive. There are two environments from which fsck may be run. Normally, after an improper shutdown, workspace manager stops responding, or other untoward event, the system will do a partial boot, and pause in a command line environment following basic hardware initialization. Under these circumstances, there will usually be an error message, such as 'file system dirty, run fsck', followed by a new line with a # (pound-sign) prompt. In this event, fsck can be run directly, with no other maneuvering required. In severe situations, the system information may be sufficiently unusable that the system will not get as far as the # prompt. Under these circumstances, it is necessary to boot from some other Unix-style system and manually specify the system drive as the target for fsck. Usually, you'll know you need to do this, because when you started your system, it would only go as far as the single-user shell (the # <pound sign> prompt, as detailed above). If the system realizes that the file system is dirty, there will be a message saying so, and what to do about it. If the system doesn't boot up as far as the # prompt, then it will be necessary to start from some other volume, such as the Mac OS X Server Installer CD, in single-user mode. If this is your plight, skip down to the section "How To Run fsck From The Mac OS X Installer CD" below.
How To Run fsck Fro m The Startup Disk1. Using the System Disks application, select the Mac OS X Server partition of the hard disk as the boot device.
2. Check the "Show Diagnostic Info During Boot" option (this adds the -v flag to your Open Firmware boot command), and in the 'Other Options' field, add 's', for single-user mode. (Do
not
put quotes around the letter s in the 'Other Options' field.)
3. Restart the system, holding down just the letter 's' to force single-user mode (if you didn't add it to the boot options).
4. Start (or restart) the machine in single-user mode. At the # prompt, type:
How To Run fsck From The Mac OS X Installer CDMaintenance can be done on a Mac OS X formatted hard drive that won't start up by performing the following steps: 1. Boot system under Mac OS with the Mac OS X Installation CD in the CD-ROM drive. Booting from the CD is acceptable. 2. Using the System Disks application, select the Mac OS X Server partition of the Installation CD as the boot device.
3. Check the "Show Diagnostic Info During Boot" option (this adds the -v flag to your Open Firmware boot command), and in the 'Other Options' field, add 's' (for single-user mode).
4. Restart the system, holding down just the letter 's' to force single-user mode (if you didn't add it to the boot options).
5. The Mac OS X Server system should start up from CD, and after registering the attached hardware, will give a short warning and stop at the root # prompt. At the # prompt type:
What To Do If fsck Doesn't Execute As ExpectedThere are two relatively common reasons why fsck might not run, even if you follow the above directions. 1. If fsck Cannot Determine The File System Type Of The Target Disk The fsck utility may not be able to determine the filesystem type (UFS) if the directory structure is unusable, or if Mach/BSD isn't sure where the disk is located in your system. Directory issues are not necessarily a big problem, as Mach/BSD maintains multiple copies on disk of critical directory information (called "mirrors" of the master superblocks. For more information, see the man pages for the 'disk' command by entering ' man disk ' at the command line prompt, or in a terminal window.) This sort of directory issue is most often encountered after a sudden loss of power, a front-panel or keyboard forced restart, or kicked power plug. Adding the -b16 flag, followed by an argument indicating a location of a superblock mirror, will probably do the trick. Try: fsck -y -b16 where -y means "answer all the questions with 'yes'" and the -b16 indicates that fsck should use the superblock image at block 16. Note that use of the -b flag will always modify the file system (because you have told it to do so by using a mirror of the master superblocks). Since fsck must be run repeatedly until the system appears to be clean and no repairs are made, using -b16 will always require at least one additional run of fsck, even if no repairs were made (other than moving in the mirror superblocks).
2. If fsck Says "Filesystem Clean; Skipping Checks"
Other Possible Reasons fsck Might Not RunMach/BSD Doesn't Know Path To Device Driver
If for some reason Mach/BSD isn't sure on which drive the startup software resides, it may help to include the entire path to the command and to the target device driver:
|
Document Information | |
Product Area: | Mac OS System Software |
Category: | Mac OS X Server |
Sub Category: | General Topics; Troubleshooting |
Copyright © 2000 Apple Computer, Inc. All rights reserved.