Troubleshooting the Startup Sequence
To troubleshoot issues during startup, try the following techniques.
Start the Computer in Verbose Mode
Start the computer in verbose mode (press Command-V at startup) to get more details on startup issues.
Start the Computer in Open Firmware Mode
You can boot into Open Firmware by pressing Command-Option-O-F during startup. The Open Firmware environment can be intimidating, because even the user prompt is simplified. The following five commands are useful in Open Firmware mode:
- mac-boot (starts loginwindow and completes startup normally)
- shut-down (shuts down the computer)
- reset-all (resets the NVRAM, all ports, and the processor)
- reset-nvram (resets the NVRAM)
- eject cd (ejects the optical drive tray, or optical media in a slot-loading drive)
Start the Computer in Safe Mode
Safe mode is the state Mac OS X is in after a Safe Boot (press Shift at startup)a special way to start Mac OS X when troubleshooting. Starting up into Safe Mode simplifies the startup and operation of your computer in the following ways:
- It forces a directory check of the startup volume and runs fsck. Running fsck in this way takes extra time because it performs more extensive checks.
- It loads only required kernel extensions (some of the items in /System/Library/Extensions).
- It loads only launchd items located in /System/Library/LaunchDaemons and /System/Library/LaunchAgents.
- None of the items in /System/Library/StartupItems or /Library/StartupItems are run.
Starting in Safe mode is useful when you are trying to isolate the cause of a problem that may be caused by third-party kernel extension conflicts or startup items that cause the machine to act erratically. If the problem goes away, then you can narrow your troubleshooting focus to find out which startup item could be causing the problem.
Identifying Startup Item Locations
In this exercise, you will view three locations where your computer identifies startup items that are affected by Safe Boot. When you troubleshoot problems, it's important to understand that Safe Boot is simply a way to turn off a number of items. If the computer boots properly in Safe Boot, your understanding of where those items are located is essential for you to perform a split-half search (removing items that might be problematic) to determine what has caused the problem.
Prevent Login Items from Launching
If you suspect that a login item (an application that launches automatically at login, as specified in the Login Items pane of Accounts preferences) is preventing successful login, you can prevent startup items from launching as follows:
1. | Start the computer. |
2. | As soon as you see the blue background followed by the Mac OS X progress window, press and hold the Shift key.By pressing Shift at this point, you prevent Mac OS X from logging in automatically, giving you the option of logging in as any user. |
3. | When the login window appears, release the Shift key, log in, then immediately press the Shift key again. |
4. | Release the Shift key after the Finder's menu bar appears. |
Examine Logs in Single-User Mode
Start your Mac OS X computer in single-user mode (press Command-S at startup), and when the command-line prompt appears, examine the system log by enteringless /var/log/system.log If the startup sequence is hanging, the system log shows where the process stops.
Remove Corrupted Preferences in Single-User Mode
Corrupted system, loginwindow, or directory services preferences can cause long delays and possibly stop the machine from completely starting up. Delete these preferences by starting your computer in single-user mode, moving them to a temporary location, and restarting. These preferences are located at
- /Library/Preferences/SystemConfiguration/preferences.plist
- /Library/Preferences/com.apple.loginwindow.plist
- /Library/Preferences/DirectoryService
- ~/Library/Preferences
Restore /mach_kernel, /etc, /var if Deleted
If you start in Mac OS 9 (Macintosh models introduced after January 2003 don't boot in Mac OS 9) or another partition that has a version of Mac OS X installed and you delete key files and folders required for Mac OS X to function properly, you will need to repair the system before your drive is able to boot properly. Key files to be aware of are /mach, /mach-sym, and /mach_kernel. Other key files are actually symbolic links to important system folders required for the underlying UNIX subsystem. These symbolic links are /etc, /var, and /tmp, which are all symbolic links to folders of the same name, but located in /private. Note that most of these files and folders are set to be invisible when viewed from the Finder in either Mac OS 9 or Mac OS X.If you deleted the /mach_kernel file, restart the computer from another drive and copy the mach_kernel file from the root level of the Mac OS X Install DVD to the root level of the Mac OS X startup volume.If you deleted the /etc or /var links, start your computer in single-user mode, run fsck (use fsck -f to force fsck to run on journaled systems), mount the file system, and enter the following to re-create the /etc and /var links:ln -s /private/etc etc ln -s /private/var var NOTE
Even though /etc, /var, and /tmp tend to be referred to as folders, they are actually symbolic links to their respective folders in /private.MORE INFORefer to Knowledge Base documents 106908, "Mac OS X: Issues after removing 'etc' and/or 'var' directory alias when started up from Mac OS 9" and 107396, "Mac OS X: Cannot print, use Classic, start file sharing, burn discs, or update software if /tmp missing."
Single-User Mode and Network Troubleshooting
In this exercise, you will enter single-user mode, verify networking, then continue booting to the login window.