MAC OSX: SYSTEM MAINTENANCE and TROUBLESHOOTING

Basic preparation for maintenance

When a computer starts acting flaky—unstable, crashing, freezing or generally misbehaving (which isn't often, but does happen. Computers are just 0's and 1's and even a Mac gets woken up on the wrong side of the chip.)—it is a corruption issue 98 percent of the time (unless you have recently done something to it, and there is 98 percent of our clue). After I have ruled out the two-percent by removing whatever I recently added, I will start with the Mac OSX basics:

FIRST, before we start any troubleshooting or System or hard drive maintenance procedures, it is important that we BACK UP OUR DATA to other drives or CD or DVD media. This is important because the disk may be hanging on by a thread and the most basic procedure may lose the drive and data forever. Be sure to back up any critical MAIL folders, DOCUMENT folders, FINANCIAL data files, iPHOTO and iTUNES folders and PREFERENCE files.

SECOND, be sure you have a lot of free unused disk space on your hard drives—a hard drive that fills up and turns flaky is nearly impossible for me to get back to normal without Erasing or Reformatting it. Full hard drives also tend to fragment system and data files and slow disk access down, too. Check free space by 1) click on harddrive icon, 2) Command+I (File> Get Info), and noting Available space.

Defragging

DEFRAGGING a hard disk is a WIndows OS thing, but we Apple Mac users do need to watch how we manage our data. The best way to defragment a Mac harddrive is to copy our data files over to another disk, delete the originals, empty the trash completely, and then copy them back onto the drive. The hard drive that Mac OS System resides on should NOT be Defragged. Other hard drives can be, NOT the System drive.

New User

Create a new user account

Create a new SPARE USER with ADMIN privileges (System Preferences> System> Accounts).

A new user account gives us a new, clean, untouched set of User Preferences to work with and trouble shoot.

Then, WHEN something isn't working correctly
Log Out of our User Account, and Log In to a new Spare User account:

If the problem prevents us from logging into our user account, but can still login to Spare User, I would suspect a conflict or preference associated with my Log In items (disable login items if you can get logged in, or navigate to the login System or User preference "loginwindow.plist" and trash it).

What’s Your Preference?

Troubleshooting Preference Files

If our user account is corrupted (problem clears in Spare User), the first thing to consider is a damaged preference file. One workflow technique is to have previously backed up our Preferences folder. Then we simply start swapping the suspect preferences with our back ups.

Or else I start trashing the most likely preferences and rebooting or logging out/in.

Another troubleshooting technique is to drag our user entire Preferences folder out of the our user Library and onto the Desktop. Then Log Out and back into our user account. If the problem has cleared, one of the old Preferences is bad (continue replacing the new with the old until the problem returns , you have now found the bad preference file).

Playing It Safe

Safe Mode / Safe Boot

This is a simple task that is very powerful even a 5 year old can do: SAFE BOOT or SAFE MODE.

Safe Boot or Safe Mode is a troubleshooting technique I ask everyone I know to perform. It is easy, fast, and it will not hurt anything, so it is a good first choice when you are not sure what is causing a problem—and it often repairs hidden disk directory damage to boot (pun intended).

But before I explore the Safe Mode, I want to touch on the one thing you should always try when your Mac does anything unexpected: Restart it. No matter what the problem is, whenever anything strange happens on your Mac—programs quit unexpectedly, things slow to a crawl, windows do not respond to clicks, or whatever—the first thing you should try is restarting your Mac.

In many cases strange occurrence are one-time only, and restarting may very well banish them permanently from your system. So from the back cover of The Hitchhikers Guide To The Galaxy: DON'T PANIC. Restart your Mac. It only takes a minute or two and it should make the issue disappear.

Of course, if the improper behavior continues after a restart, it is time for stronger medicine like the Safe Mode / Safe Boot. A Safe Boot results in your Mac running in Safe Mode. It’s a fantastic remedy as well as a great diagnostic technique. It can fix some issues with disk directories automatically and is unlikely to make things any worse.

Hold the Shift key down while starting up

The Safe Boot routine is built into Mac OS X; to use it you simply start up your Mac while pressing the Shift key. You will see a message confirming your Safe Boot as your startup proceeds. If you don’t see the words “Safe Boot” during startup (as shown on the right), shut down your Mac and try again, but this time press the Shift key before pressing the button to turn on your Mac. You want to see the words “Safe Boot” during startup, if you don't, you will have to start up again.

If your Mac logs in automatically: If you don’t type a password at startup, just keep the Shift key depressed until the Desktop appears, the Finder loads completely, and all menu bar items can be seen in the menu bar.

If you type a password to log into your Mac: Press the Shift key again after typing your password but before clicking the Log In button, and then keep it pressed until the Desktop appears, the Finder loads completely, and all menu bar items can be seen in the menu bar.

Simplified Start up

If you have anything that launches automatically when you log in, such as Startup Items you’ve designated in your Accounts System Preference pane or programs that can be configured to launch themselves automatically when you log in, they should not launch after a Safe Boot. If you do see them starting up, you didn’t keep the Shift key depressed long enough and you’ll have to restart and try again.

A Safe Boot checks and repairs the disk directories on your startup disk automatically. Then, it allows only OS X-required kernel extensions and startup items to load.

Note that these startup items—which may include some but not all of the items in /Library/Startup Items and /System/Library/Startup items—are not the same as the Startup Items you see in the Accounts System Preference pane. In any event, a Safe Boot prevents most items of both types—startup items and Startup Items—from loading at startup.

I said SIMPLIFIED START UP

I should mention that certain Mac features will not work after a Safe Boot. For example, DVD Player, video capture (in iMovie and other video-editing software), AirPort wireless networking, audio input or output devices, and internal and external USB modems may not function in Safe Mode. Only use this technique when you are having problems, and don’t forget to restart the usual way before you try to do any of those things.

If your Mac boots in Safe Mode successfully, the issue almost certainly involves something you've installed, and not Mac OS X itself. Look for the culprit in /Library/StartupItems, Home/Library/StartupItems, or something in your Accounts System Preference pane’s Login Items tab.

Safe Mode can not only fix problems caused by damage to your boot disk’s invisible directories, but it also suppresses almost any gunk you’ve added. If you have a problem and it disappears when you Safe Boot, OS X is probably not to blame.

REPAIR PERMISSIONS

Now that you are in Safe Mode you will want to Repair Permissions. Open up the Disk Utility App inside Applications/Utilities folder or [shift+command+U]

Cron Scripts

This is a big deal and very important maintenance rountine.

If the Macintosh doesn't run 24/7, or if it is set to sleep at night, we should look into a utility like MainMenu, ONYX, or, COCKTAIL to manually perform the usual daily/weekly/monthly UNIX maintenance scripts that the operating system enables to clean up the Mac during the wee AM hours of the morning. Cocktail is a general purpose utility for Mac OSX that will run cron scripts (among other things).

fsck -y

Booting in Single User Mode and Running fsck -y:

fsck (file system check) is a start-up Unix utility ran from the command line.
Here is Apple's technical article on running FSCK.

Apple tech article states that Disk Utility Repair Disk is the same as running as fsck, yet many users have said they prefer fsck -y from a Shut Down. In the linked Apple tech article, Apple states, "For Mac OS X 10.4 or later, you should use Disk Utility."

In any case, we do NOT need an Apple boot Install CD or DVD to run fsck -y.

Here's how to fsck -y:

  1. Shut Down Mac completely, Restart your Mac.
  2. Immediately press and hold down the Command and S keys until text begins to scroll on screen. In a few more seconds, the Unix command line prompt (%).
  3. Type fsck –y (fsck space minus y).
  4. Press Return key.
  5. Text will start updating the progress...if there is damage, the final line will say ***** FILE SYSTEM WAS MODIFIED *****.
  6. If you see that message, REPEAT Steps 3 and 4 again and again until that message no longer appears. Having to run fsck more than once is normal, because the first run's repairs may uncover additional problems.
  7. The end should read: "The volume <name of disk> appears to be OK."
  8. Then type "reboot", then press Return to boot back off the hard drive.

If Apple's REPAIR DISK and FSCK cannot repair the problem, we need to try third-party DISK UTILITIES like Disk Warrior at alsoft.com.

Beware of 3rd-party disk utilities, especially Norton Utilities on OS X disks because Norton is not compatible with them (search GOOGLE for the OSX-Norton issues). Warning: NEVER USE NORTON DISK UTILITIES on an OS X hard drive. SEE BELOW.

DISK UTILITIES: BEWARE!

Caution on Third–Party Disk Utilities:
  • Do Not Let Them "Fix" Anything—except as a last resort.
  • Use them only when Apple's FirstAid cannot repair the problem, and for second opinions.
  • Leave regular system maintenance to Apple DISK UTILITY, Repair Disk or Disk First Aid.

NORTON Utilities has been discontinued for Mac OS X—Do Not Use It!!

DiskWarrior is the utility most preferred by the Mac gurus.

I do install DiskWarrior on my Maintenance Boot Disk (an external FireWire I use to maintain various Macs). This allows me to attach my FireWire drive to a Mac, boot off my Maintenance Boot System, and run my maintenance and BackUp routines.

made with a mac