In addition to the ways you can customize the boot and login processes, a few special startup options are available. They all do slightly different things, but because they don't fit neatly into any particular category of functionality, I'm grouping them here.
User level: |
any, unless restricted by Open Firmware |
Affects: |
all users |
Terminal: |
yes |
If you hold down command+S at startup, you'll be presented with a bunch of code (white or yellow text on a black screen) in what looks like Terminal. What you're seeing here is called single-user mode, and the text you're seeing is basically BootX (discussed earlier in this chapter) in all its glory. After it's done its thing, you're presented with a command-line prompt. At this point you can run fsck, the built-in disk utility (discussed more in Chapter 14) or work directly with Terminal commands (and thus files on your hard drive).
Warning |
Single-user mode gives anyone with command-line experience pretty much unlimited access to your system. For this reason it's definitely a security risk. If you want to be super-safe, I'll show you how to prevent unauthorized single-user mode access when I discuss Open Firmware protection in Chapter 13. (I mention Open Firmware later in this chapter, as well.) |
To exit single-user mode, type exit <RETURN> to continue the startup process and proceed to the login screen, reboot <RETURN> or shutdown -r now <RETURN> to restart your Mac and start up normally, or shutdown -h now <RETURN> to shut down your computer.
User level: |
any, unless restricted by Open Firmware |
Affects: |
NA |
Terminal: |
no |
Holding down command+V at startup puts you into what is called verbose mode. During BootX, verbose mode is identical to single-user mode; however, instead of stopping when BootX finishes and presenting you with a command-line prompt, verbose mode continues through the boot process until the login screen appears. Basically, you skip the boot panel and its status messages (in fact, if you watch the text that goes by in verbose mode, you'll see the same messages).
Verbose mode lasts until the next shutdown or restart; if it is invoked at startup, the next time you shut down, you'll see a textual report of the shutdown processes.
User level: |
any, unless restricted by Open Firmware |
Affects: |
all users or individual |
Terminal: |
no |
Former Mac OS 9 users will remember that if you held the shift key down at startup, your Mac would boot using a bare-bones system with no extensions, control panels, or other startup files loaded (including items in the Startup Items folder). The shift key in Mac OS X performs a similar trick; however, it does so in three parts, each independent of the others.
If you hold down the shift key immediately after the boot process starts and release it after you see the gray screen with the dark gray Apple (hold it until the "spinning" progress indicator appears), you'll enter what Apple calls safe mode. In safe mode, your Mac starts up with only essential kernel extensions and services, and ignores the kernel extension cache it normally uses to speed up the startup process. As a bonus, this procedure also automatically runs OS X's built-in disk check/repair utility, fsck, to ensure that your boot volume is free of problems. Safe mode can be a very effective tool for troubleshooting major startup issues, especially those caused by kernel extension problems.
Note |
How does OS X know if a kernel extension is "essential" or not? Inside every kernel extension package (viewable by control-clicking on the kernel extension and selecting "Show Package Contents" from the resulting menu) is a text file at /Contents/Info.plist. Essential files have a "key" variable called OSBundleRequired included in the text of this file. (I'll talk more about packages in Chapter 4.) |
If you have your Mac set to auto-login, holding down the shift key after you see the boot progress panel (the white panel that shows which services are loading—I showed you how to modify this earlier in the chapter) until you see the standard login window prevents auto-login. You'll have the opportunity to login normally, or to allow another user to login.
Finally, if you hold down the shift key from the login screen until you are completely logged in (until you can actually start using the Finder), no personal login items (those listed in the Login Items pane of System Preferences) will load, and any Finder windows that were left open during your previous session will be closed. This "safe login" affects only the user currently logging in, and is a nice trick to figure out if one of your Login Items is causing problems.
These three procedures are independent of one another: you can do one, two, or all three, in any combination. The only caveat is that if you don't want to take advantage of all three, the timing is a bit tricky. For example, if you want to permit auto-login, but suppress login items, you have to wait until the instant you see your Desktop appear on the screen, and then press the shift key. If you want to use safe mode, but allow auto-login, you need to release the shift key as soon as you see the gray boot screen.
Once you've used safe mode and/or safe login to isolate a problem, you should restart and let your Mac start up normally to ensure that all necessary kernel extensions and services are loaded.
User level: |
any, unless restricted by Open Firmware |
Affects: |
NA |
Terminal: |
yes |
There are times when you need or want to use Terminal to work with files or to fix a problem. However, what if the problem you're trying to fix prevents you from logging in? Or what if you you're not logged in, and you want to quickly use Terminal without having to log in, launch Terminal, complete your task, and then log out again? The solution to both of these problems is to log in as "console."
Note |
Logging into console is different than entering single-user mode at startup. Single-user mode is accessible to anyone, and no startup services are loaded; whereas console login requires a valid OS X user account and, since it occurs after the boot process, includes all of OS X's startup services. |
If your Mac is currently shut down, press the power button to start up.
If you had your login set to show "Name and password," skip to the next step. If you have your login window set to display the "List of users" (login pictures and usernames), click the Others… user—it should be the last icon listed—and press return to bring up the name and password dialog. If Others… is not an option, press option+escape, then click on any user. This should present you with the Name and Password fields.
In the Name field, type >console (including the > character) and press return (you don't need to enter a password). You'll be presented with what looks like a Terminal window, but it will have taken over the entire screen. You're now working directly with the command-line.
At the login prompt, enter your username and press return.
Enter your account password when prompted.
You're now logged into your computer, but without the user interface. You have the same access as if you had booted into OS X normally. When you're done doing what you need to do, type exit and press return; you'll be logged out and the login window will reappear. You can use console login as often as you like, and in fact I frequently use it to do quick things that don't require a full login.
Note |
The "console" you use for login is different from Mac OS X's Console application. "Terminal" would probably have been a better name for Apple to choose for login (or "Console" a better name for Terminal), since console login is very similar to working in Terminal. |
User level: |
admin |
Affects: |
all users |
Terminal: |
yes |
Open Firmware is part of your Mac's BootROM, discussed at the beginning of this chapter. It controls your computer for the short period between hardware initialization and the processes controlled by BootX. As such, it is in the unique position of controlling all access to your Mac. There are two situations where Open Firmware can come in handy for the average user. First, if you have a CD or DVD that simply won't eject no matter what you do, typing eject cd in Open Firmware will force your Mac's built-in CD or DVD drive to eject. Second, and more significant, Open Firmware allows you to prevent access to any of the special startup options discussed above, as well as any of the methods of choosing a startup volume or system discussed earlier in this chapter. By setting an Open Firmware password, only a user (presumably you) with that password will be able to access any of these functions, thus closing a good number of Mac OS X security loopholes (booting into OS 9, booting off of a CD, accessing single-user mode, etc.). I'll explain how to set up an Open Firmware password in Chapter 13.
Note |
You can invoke Open Firmware at startup by pressing command+option+O+F; however, unless you have a very specific reason to access Open Firmware, there's not much to do or see. Simply type mac-boot and press return to continue booting up, or type shut-down and then return to shutdown. |