Meeting Topics

7:00pm – 9pm

Subscribe to calendar in iCal

Archives

search

view by category

view by month

etc.

rss feeds

admin stuff


How To: Perform a Disk Check/Repair

This Guide explains how to use Apple’s standard Disk Utility application to check for and repair errors on your Mac’s disk drives. Disk Utility can find and correct many common problems but you may run into some that it simply can’t handle (it will tell you it can’t fix them) and in those cases you’ll have to resort to a commercial disk recovery utility such as DiskWarrior but Disk Utility is free and you should already have it so give it a try first.

This Guide was written for Mac OS X 10.4 but should be generally applicable to Mac OS X 10.3 through at least 10.5 with a few caveats mentioned in the text.

The Easy Way: When Your Mac Still Works

This method is easy to do but assumes your Mac is basically up and running and you can still launch applications. If that’s not the case or if you are using Mac OS X 10.3 skip ahead to either the Somewhat Less Easy Way or the Super Secret Slightly Scary Single User (Some Typing Required) Way that follow.

The Easy Way is great as a monthly health check or when odd things are happening and you just want to make sure evil little bugs haven’t started to creep into your hard disk data structures.

  1. Click anywhere on the blank Desktop to make sure that you are in the Finder (the application name to the right of the apple menu at the left end of the menu bar should say Finder.) Close any open Finder windows to get them out of your way.
  2. From the Go menu chose Utilities to open the utility applications folder. Find the application named Disk Utility and double click it to launch it.
  3. The column at the left side of the Disk Utility window lists the available disk drives with the volumes they contain indented below each. Click on the indented volume with the name of the disk you want to check. Odds are you’ll only have one choice, a volume named “Macintosh HD”, unless you partitioned the Mac’s drive or added extra drives.
  4. The right side of the window should already be showing you the First Aid tab, otherwise select it yourself.
  5. Click the Verify Disk button at the lower right corner of the window to check the volume for errors. If no problems are found then congratulations, you’re half way home! If problems are found and the Repair Disk button is enabled click it and keep your fingers crossed that Disk Utility can tidy things up for you. If that button is dimmed you are probably checking the Mac OS X startup disk which, unfortunately, can’t be repaired while you’re running from it so you’ll have to use one of the other methods that follow to attempt a fix.
  6. Assuming you passed the first test you can now click the Repair Disk Permissions button to find and fix problems with file ownership and access rights. It’s somewhat normal to see a few errors here especially after a software update and with printer drivers and internet plug-ins. Problems here are generally not critical but repairing permissions has been known to fix a few obscure issues from time to time.
  7. You’re done! Press COMMAND + Q or choose Quit Disk Utility from the Disk Utility menu to exit the application and sleep well with the knowledge that your Mac’s hard drive has no unsightly warts or blemishes.

And that’s The Easy Way. It generally just takes a few minutes so run through it every month or two and you stand a good chance of catching little problems before they become bigger ones.

The Somewhat Less Easy Way: Using a Mac OS X Install Disk

This is the method to try if The Easy Way found problems on the startup volume or if your Mac can’t find the startup volume and you see the infamous blinking question mark when you turn it on, or if your Mac tries to boot but never quite makes it to the Desktop, or if it actually does start up but is too unstable for you to launch applications.

We’re still using Disk Utility for the repairs but this time we’ll launch it after starting up from a Mac OS X Install or Restore disk so you’ll need one of those. Use the disks that originally came with your Mac or, if you’ve upgraded to a new version of Mac OS X use those instead. If you don’t have Mac OS X Install disks handy you’ll have to resort to the Super Secret Slightly Scary Single User (Some Typing Required) Way.

  1. Shut down your Mac if it isn’t already. If your Mac has a slot loading drive then insert the Install disk part way into the drive, press the power button, immediately press and keep pressing the (letter) C key and insert the Install disk the rest of the way into the drive slot. Keep holding down the C key until you see the grey screen with an Apple logo in the center. The Mac should now be booting from the Install Disk which will take a few minutes so be patient and you will eventually be rewarded with the Install Disk’s Language Selection screen. Choose the appropriate language then continue to the next screen.

    If you have a tray loading CD/DVD drive the procedure is a little more complicated. Press the Mac’s power button then immediately press and keep pressing the OPTION key until you see the dark blue boot disk selection screen. If you have an older non-Intel processor Mac be patient because it may take a couple of minutes for it to finish looking for bootable disks. You’ll know it’s ready when the cursor changes from a watch to the standard arrow. Press the eject key (towards the right side of the top row of keys, with the upward pointing triangle with a line under it symbol) to open the tray, insert the Install disk and close the tray then wait until the disk appears in the list. Click on the CD/DVD icon then click the right arrow button to boot from it. Wait a few minutes for the language selection screen, choose your language and continue to the next screen.

  2. Now, this is very important: DON’T START AN ACTUAL INSTALL OR RESTORE, that will overwrite your existing system and precious data. From the Utilities menu (or the File menu for Mac OS X 10.3) select Disk Utility and wait for it to finish launching. Now, perform steps 3 through 7 of The Easy Way. This time Repair Disk should be available should you need it. Continue back here after you’ve performed those steps.
  3. You should have already run and quit Disk Utility before reaching this step. If you haven’t, go do it now.
  4. When you quit Disk Utility you should have been thrown back to the initial Installer screen. Again, you don’t want to actually do an install now, you just need to restart your Mac to see if the repairs were effective. You can do that by choosing Quit from the bottom of the Installer menu immediately to the right of the Apple menu at the left end of the menu bar. You’ll be prompted to verify that you really do want to exit the installer and restart the machine, go ahead and do that.

At this point if you’re lucky you’re back to a healthy disk, otherwise you’ve about reached the limit of what can be repaired with Disk Utility and you’ll have to resort to something more potent such as DiskWarrior.

The Super Secret Slightly Scary Single User (Some Typing Required) Way

OK, it’s not really a secret and assuming you can type two short command lines it’s not really all that scary. It does however delve into the deep dark recesses of Single User Mode where keyboards rule and mice fear to tread. And if you’re really ham-handed or decide to play “let’s type random commands and see what happens” you can potentially do Really Bad Things™ to your data. But if you stick to the script you can easily check and repair your startup disk even if you don’t have a Mac OS X Install disk handy. We’ll only be doing half the job that Disk Utility can do, checking and repairing disk structures. You’ll still have to use Disk Utility to perform the Repair Permissions step.

  1. Shut down your Mac if it is currently running (not essential but it ensures you’ll be starting from a nice clean slate.)
  2. Press the power button then immediately press and keep pressing the COMMAND and (letter) S keys. Let them go after the grey Apple screen appears, changes to black and lots of strange looking text starts filling the screen. When the dust settles the last line of text should say something like: localhost:/ root# with a solid white cursor box after the “#”. That is a command prompt indicating that the system is waiting for you to type a Unix™ command. Congratulations, you’ve just booted into Single User Mode!
  3. At the command prompt, type the following command exactly as it appears here: /sbin/fsck -yf Make sure you use the correct (forward) slash and type a space between the “k” and the “-“. Use the delete key to fix typos and when you are sure you’ve got it right press the return key. If you did it right you’ll see status lines telling you what is being checked or repaired. If you instead see a message about “command not found” or an invalid option you probably typed the command wrong. Don’t worry, nothing bad happened. Try it again. These are the same repair algorithms that are used in Disk Utility so if it can’t fix the problems this method won’t either.
  4. If no errors are reported or if it reports errors that were repaired you’re good to go. If it encounters an error it can’t fix you’ll have to use a commercial disk repair program or bring it into the local Apple Store if you’re still under warranty or don’t mind paying someone else to fix the problem for you.
  5. Exit single user mode by typing: reboot -n with a space between the “t” and the “-“. Press return when you’ve got it right and the Mac will restart, hopefully successfully this time if problems were found and repaired.

And that’s the Super Secret Slightly Scary Single User (Some Typing Required) Way to repair your startup disk without a Mac OS X Install disk.

If You’ve Still Got Problems

If none of the above helps you’re going to have to resort to a commercial disk recovery tool; re-installing the OS using the Archive and Install option to preserve your data; or if you’ve got a current backup of your data you can always wipe the drive clean, install a fresh copy of the OS and restore your applications and data.

But that’s a topic for another Guide.