Back in the Mac OS 9 days, one of the most overused troubleshooting tricks was rebuilding the Desktop Database. Users could be trained to hold down the option + command keys after a reboot (or for us impatient techs, after force quitting the Finder). You could have users run that to their hearts content. They get to feel like they can have control over their computers and an imagined boost in speed afterwards. Unfortunately it only had limited real technical value.
Much like rebuilding the Desktop Database, AppleJack is easy enough for most users to use after a little training. However, AppleJack is quite a bit more useful. In one sitting it can check the boot partition, repair permissions, clear cache file, replace bad preference files and remove swap files which can actually fix a long list of real problems.
After downloading and installing the package from the SourceForge project page, restart your computer and hold down the command + s keys to enter into single user mode. Once in single user mode you will see a helpful little message, as such:
For troubleshooting assistance, just type ‘applejack’ at the prompt
Its just as simple as that! I usually have users run the following:
# applejack AUTO restart
Everything runs automagically, and reboots after it finishes. Users love it because they have to remember very little to run it. Alternately, advanced users and technicians can just run:
# applejack
Which will give you a menu to manually run individual commands:
Enter the associated number or letter to select the next task.
It is strongly recommended you do them in the order listed!
[a] auto pilot. Script will do all tasks in sequence.
[1] repair disks
[2] repair permissions
[3] cleanup cache files
[4] validate preferences files
[5] remove swap files
Your choice (Just hit return to quit):
Most usefully when working in this mode are options [3] and [4] which give you the ability to not only clean and check the System but will also allow you to check on individual users on the system.
After going through all of the options, follow the prompts and reboot the computer, letting it boot up normally. You may notice that it takes a bit longer to go through the startup process as it recreates any cache files that may have been removed that the system uses. Overall, though, you should see an improvement in speed and stability.
Occasionally I will come across a Mac that has been upgraded to Tiger which is stuck on a desktop with no icons or menu bar, but the Spotlight icon is in the upper right corner. If left like that, it will just sit there indefinitely. AppleJack will fix this issue, though you may have to clear out the individual user’s cache files. But what do you do if you haven’t already loaded AppleJack?
My first thought was to boot into Target Disk Mode by holding down the T key during a reboot, but the AppleJack installer must be run from a working system. So I used to copy my laptop’s AppleJack installation (at least partially) to the TDM’d computer as such:
# sudo ditto -V /private/var/root/Library/Scripts
# sudo ditto -V /private/var/root/.profile
This is fine, but… I’m usually in too much of a hurry to copy the man pages, which users may want later. Plus, there is no receipt in the /System/Reciepts folder so Repair Permissions will not fix issues if there are any.
My next trick was to boot into Single User Mode and mount a USB pen drive. On another computer, copy the AppleJack.pkg file from the AppleJack-1.4.x.dmg onto a pen drive. Then run the following:
# /sbin/fsck -y
# mount -uw /
# mkdir /Volumes/pendrive
# mount -t hfs /dev/disk[x]s[x] /Volumes/pendrive
In the above, replace disk[x]s[x] with the device label of your pen drive. (ex. disk1s1) You may have to ls the /dev directory before and after you insert the pen drive to find the label.
Once the pen drive is mounted run the following:
# /usr/sbin/installer -target / -pkg /Volumes/pendrive/AppleJack.pkg
Now, Applejack should be fully installed. Reboot the system and enter back into Single User Mode to run AppleJack.
Users often ask me how often they should run AppleJack on their systems. I try to be a little vague, telling them that they should run it whenever they feel like the system is dragging or it just seems to have a general malaise. Once a month should be plenty. If you are running it too often, it may indicate a problem.
Lately, I have been installing it every Mac I sit down in front of. It has gained high rankings in my personal set of software tools and I encourage you to try it out.
Developer Page: AppleJack Project Page
Download: SourceForge