TMO Quick Tip - Repairing System Problems from the Command Line

by , 7:30 AM EDT, July 31st, 2006

If you suffer a system crash on your Mac, the battery accidentally drops out of your 'Book, or the power cord is unexpectedly yanked from your PowerMac or iBook, your computer may not start up and smoothly return you to your Desktop. Typically, I recommend Alsoft's DiskWarrior to repair any system damage and get you back on your feet. If you don't have a copy of DiskWarrior handy, however, you may need to resort to some Unix command line magic to get up and running.

Here's the disclaimer: Playing around with the Unix command line can be very dangerous if you don't know what you are doing. If you aren't comfortable mucking around in a place where you can delete everything on your hard drive with a simple command, find a friend that knows what they are doing, visit your local Mac User Group, or find a Mac consultant to help you out.

With that in mind, we're going to boot your Mac in single user mode and run the file system check command. Follow along, brave souls:

Many people use the reboot command instead of the shutdown command. That's perfectly fine. It saves you a few keystrokes when restarting your Mac, and you won't have to press the power button, either. I use the shutdown command because that's what I was taught to use when I first started fiddling around with Unix. The theory is that shutting down flushes everything from memory - eliminating any possible memory corruption. Old habits die hard.

If you prefer to use the reboot command, simply type reboot and then press Return.

One more thing: If you use a Bluetooth keyboard, be sure to keep a USB keyboard handy. You can't use a wireless keyboard to invoke special startup commands like Command-S.


if you have ideas for Mac related tips that you think other TMO readers might find helpful.