As someone who's written books and many articles on Mac troubleshooting, one of my favorite utilities has long been The Apotek's AppleJack, a clever utility that lets you perform a number of troubleshooting procedures at startup--without requiring a Mac OS X or third-party CD or DVD. Unfortunately, Leopard rendered the previous version of AppleJack inoperable, so I've done without for nearly a year.
With the recent release of AppleJack 1.5, you can now install and use the utility on Macs running Leopard (OS X 10.5), so today's as good a time as any to revisit this essential troubleshooting tool.
Installing AppleJack requires an admin-level user account, as it modifies OS X's startup process and makes a minor (and safe) tweak to the root account. Once installed, AppleJack is available in OS X's single-user mode, accessed by holding down Command+S at startup. Just below the standard "If you want to make modifications to files" message, you see a new message instructing you to type applejack for troubleshooting assistance. Doing so brings up a textual menu of options; you simply type the desired number or letter and press return to perform that task.
Repair Disks uses OS X's built in fsck program--the same one used by Disk Utility--to examine and, if necessary, repair minor damage to your startup drive's directory. Repair Permissions is identical to using Disk Utility's Repair Disk Permissions function (except it takes a bit longer in single-user mode). Cleanup Cache Files removes temporary cache files in case a corrupt cache is the cause of your problems. Validate Preference Files checks preference files for possible corruption; those that don't pass muster are moved to a new "Preferences (Corrupt)" folder in the same parent Library folder as the originals. Finally, Clean Up Virtual Memory manually deletes any virtual-memory swap files that weren't cleaned up automatically by the OS.
You can choose to run all these tasks in one fell swoop, in order, by typing auto (all lowercase) and pressing return. If you instead type AUTO (all uppercase), AppleJack goes into "deep clean" mode, which means it deletes all system cache files, including the LaunchServices database. The developer recommends this mode only if the standard auto procedure doesn't fix enough problems to let your Mac boot properly.
Although auto mode can be convenient, I rarely use it, for a few reasons. First, as I noted in my Five Mac Maintenance Myths article, performing all of these tasks is usually overkill; a better approach, in my opinion, is to perform them in order, restarting after each to see if it fixed the problem. Second, and perhaps more important, fsck--used by the Repair Disks task--may need to be run multiple times to fully repair your drive. Running the Repair Disks task separately lets you repeat the procedure until you no longer see the "Your disk was modified" message. Finally, when you perform tasks separately, you get additional options; for example, the Cleanup Cache Files and Validate Preference Files tasks let you perform their actions on particular user accounts.
Of course, many of AppleJack's tasks can be performed when your Mac is booted normally, either manually, using Disk Utility, or using a third-party utility. The beauty of AppleJack is that it lets you easily perform such troubleshooting tasks when a problem is preventing your Mac from booting into Mac OS X, even if you don't have an OS X Install disc or a third-party bootable disc handy. AppleJack is especially useful for MacBook Air owners, given that Apple's slimmest portable doesn't have a built-in optical drive.
I highly recommend reading the ReadMe file included with the AppleJack installer, as it contains lots of useful--and important--information, including known issues and explanations of confusing messages produced by single-user mode. In fact, it's a good idea to print out the ReadMe and keep it on hand for troubleshooting emergencies. The ReadMe also includes some great tips. For example, when installing AppleJack, clicking on the Customize button lets you also install memtest 4.14, a command-line program that tests your Mac's RAM more-thoroughly that Apple's own Hardware Test. You can then use memtest from within AppleJack's Expert mode. (AppleJack also provides its own man [manual] file, accessible by typing man applejack in single-user mode.)
New in version 1.5 is an experimental Expert mode, accessible by typing x in AppleJack's main menu screen. As the developer notes clearly in the ReadMe, "not all the tasks have been fully implemented," which also means they aren't documented and you should use them with caution. Still, Expert mode's menu gives you a look at some of the promising options that are in the works, including the ability to disable auto-login, disable login items for a particular user, disable system configuration file, and force OS X's "new computer" setup procedure. But my favorite, and one that does appear to be fully implemented, is the ability to more-easily use memtest in single-user mode to test your Mac's RAM.
Also new in version 1.5 is an uninstall script, located at /private/var/root/Library/Scripts/applejack.sh uninstall, that will completely remove AppleJack from your system. (If you installed memtest, that will remain, as it's technically a separate program and the uninstall script has no way of knowing if you installed it via AppleJack or on your own.)
I'm a big fan of AppleJack, but you don't have to be a troubleshooting expert to appreciate it. In fact, it's just as useful for computer novices: If you've ever had to explain to a tech-phobic friend or family member, over the phone, how to run fsck in single-user mode, you know it can be frustrating for you and scary for them. With AppleJack installed, you just tell them to hold down Command-S, type applejack, and then press 1. In fact, the biggest downside to AppleJack may be that it makes some tasks too easy to perform; use it with caution.
AppleJack v 1.5 requires Mac OS X 10.4 or later.
This story, "AppleJack 1.5" was originally published by Macworld.