Fix File and Directory Problems

Although less common than many people imagine, it’s possible for things like corrupted fonts, caches, and preference files to result, somewhat indirectly, in a slow Mac. Similarly, disk errors of various sorts, such as directory damage, can result in a slower Mac (or cause other problems).

Fortunately, the majority of file and directory problems are easily solved—as long as you have the right tools and know how to use them. Because these sorts of problems can affect everything your Mac does, you should check for, and repair, file and directory issues before moving on to the more specific steps I cover in later chapters.

Run Disk Utility

Disk Utility, included with every Mac, can repair a variety of disk errors. Most of these problems have nothing to do with speed as such, but some can lead, even if indirectly, to slow performance—and in any case, they’ll cause you headaches of one kind or another. So, before you continue with other tasks in this book, I recommend, on general principle, using Disk Utility to check for and repair disk errors.

Use Disk Utility in El Capitan or Later

If your Mac is running El Capitan or later, follow these steps:

  1. Open Disk Utility (in /Applications/Utilities).

  2. In the list on the left, select your startup volume (if it’s not already selected, which it most likely is); see Figure 7. Note that, depending on your version of macOS and your settings in Disk Utility, volume names may be indented underneath the names of the physical devices on which they reside.

    Figure 7: Select your startup volume (which may, as in this case, be the only available volume) in Disk Utility. This image shows Disk Utility as it appears in High Sierra and Mojave; earlier versions look a bit different.
    Figure 7: Select your startup volume (which may, as in this case, be the only available volume) in Disk Utility. This image shows Disk Utility as it appears in High Sierra and Mojave; earlier versions look a bit different.
  3. Click the First Aid button on the toolbar, then click Run. Disk Utility examines your disk and attempts to repair it if necessary.

  4. When the repair is finished, click Done and quit Disk Utility.

Use Disk Utility in Yosemite or Mavericks

In Yosemite or Mavericks, Disk Utility can’t repair the volume you booted from, so you’ll have to use a procedure that requires a secondary startup volume (which can be macOS Recovery). Do this:

  1. If your secondary startup volume is on a physical device (such as a hard drive, a flash drive, or an SD card), attach it now; if it’s on a CD or DVD, insert it now.

  2. Restart (see Restart Your Mac). If you’re using Recovery, hold down ⌘-R until the gray Apple logo appears; if you’re using a startup CD or DVD, hold down the C key instead. Otherwise, hold down the Option key until icons for all the valid startup volumes appear on the screen, select your secondary startup volume, and press Return.

  3. Locate and open Disk Utility. If you’re starting in Recovery, you can simply select it in the list that appears and click Continue. Otherwise, open it from /Applications/Utilities.

  4. In the list on the left, select your startup volume. Note that volume names are, in some cases, indented underneath the names of the physical devices on which they reside.

  5. Click Repair Disk.

Disk Utility examines your disk and attempts to repair it if necessary. When it’s finished, you can quit Disk Utility and restart your Mac normally.

Use a Third-Party Disk Repair Tool

In the (rare) event that Disk Utility encounters a serious problem that it cannot solve, you may need to use a commercial repair utility. The three best-known and most popular disk repair tools for Macs are:

However, I should note that as of publication time, the current shipping version of each of these apps has certain limitations when it comes to repairing APFS volumes (used on SSD in High Sierra, and on all startup volumes in Mojave and later). If you’re using High Sierra or later, be sure to check for compatibility before making a purchase.

Check for Damaged Preference Files

Almost every app has at least one preference file that stores your custom settings and other pieces of information the app needs in order to run as expected. Sometimes these preference files become damaged for one reason or another; for example, an app could crash while making changes to the file, leaving it in an incomplete state. That, in turn, could cause delays in launching the app and other undesirable behaviors. I hasten to point out that damaged preference files are an uncommon source of slowdowns, but it can happen—and it’s easy to check and repair them.

Before you can disable a preference file, you must find it. Most preference files live in one of five folders:

  • ~/Library/Preferences or /Library/Preferences

  • ~/Library/Application Support/app or developer name or
    /Library/Application Support/app or developer name

  • ~/Library/Containers/app name/Data/Library/Preferences, where app name is something like com.apple.mail (more on this ahead)

These folders can contain hundreds or even thousands of items, and they may not conform to any obvious organizational scheme.

Apple recommends that preference files follow a standard naming convention, known as reverse domain name style. You take a company’s domain name and reverse it—apple.com turns into com.apple—and then you add the name of the app. Finally, you add the extension plist (for property list). So, com.apple.mail.plist is the preference file for Mail, and com.microsoft.Word.plist is the preference file for Word. That’s a bit weird, but at least it makes sense.

Unfortunately, this system doesn’t always work, for one of these reasons:

  • Some developers use their own naming conventions.

  • Some apps have several different preference files, each for a different sort of data. These files might be stored in a folder inside your Preferences folders, or they might not—and if they are in a folder, there’s no telling what that folder might be named. (The name of the app and the name of the developer are two good initial guesses.)

  • An app may change the format or name it uses for preference files from one version of the app to the next, making it unclear which of several candidates you might find is the right one.

  • Your Preferences folders may contain files that are not preference files—log files, lists of recently opened documents, and so on.

So, to locate the preference file for a given app, try each of these steps until you find it:

  1. Open ~/Library/Preferences and set the window to List View (choose View > As List). Click the Name column to sort the list by name.

  2. Scroll down to where the app’s name would be if it followed the reverse domain name style. Look for adjacent files, too, in case the app has more than one.

  3. Type a portion of the app’s name in the window’s Search field, or use the Find command (File > Find). If that yields no results, repeat with a portion of the developer’s name.

  4. If you find more than one potential match, check the modification date. Usually the file or folder modified most recently is the one you’re looking for.

  5. If you still haven’t found the file, repeat steps 1–4, but this time look in /Library/Preferences. Still no luck? Try looking in ~/Library/Containers/app name/Data/Library/Preferences, ~/Library/Application Support/app or developer name, or /Library/Application Support/app or developer name.

Once you’ve located the file, then what? Well, you could drag it to the Trash, but I wouldn’t. If the file isn’t faulty after all, you may find yourself having to reset lots of preferences for no good reason. In some cases, that might mean digging out your license code and reentering your registration data. Instead, I suggest moving the file temporarily to your desktop. Follow these steps:

  1. If the app is running, quit it.

  2. Drag the preference file to your desktop.

  3. Clear the macOS system-wide preferences cache (so apps won’t continue to use the old values) in one of these ways:

    • Log out (choose Apple  > Log Out Username) and log back in.

    • Open Terminal (in /Applications/Utilities), type killall cfprefsd, and press Return.

  4. Open the app again. It creates a new, default preference file for itself.

  5. Test the app to see if the problem still exists. If not, the old preference file was probably at fault, so you can trash the one on your desktop. If the problem is still there, the preference file was probably good; you can quit the app and drag the file from your desktop back where it came from, replacing the preference file created in step 4. Having replaced the preference file, repeat step 3 to clear the cache again.

Check Your Fonts

I’ve already said, in Removing Extra Fonts, that having too many fonts is unlikely to cause any noticeable speed problems. However, having duplicate or damaged font files can! Font Book, which is built into macOS, can identify and solve many font problems. To check your fonts with Font Book, follow these steps:

  1. Open Font Book, located in /Applications.

  2. At the top of the pane on the left, select All Fonts. Then click anywhere in the font column to the right and choose Edit > Select All.

  3. Choose File > Validate Fonts. Font Book checks all your font files for errors (Figure 8).

    Figure 8: Font Book can identify damaged, invalid, and duplicate fonts so you know which ones should be removed or disabled.
    Figure 8: Font Book can identify damaged, invalid, and duplicate fonts so you know which ones should be removed or disabled.

    An icon to the right of each font name indicates the font’s status: a green checkmark icon means that the font is fine; a red X icon means it has a serious error, and a yellow alert (exclamation point) icon means it has a minor problem. Font Book checks numerous characteristics of each font. Sometimes Font Book will tell you exactly what the problem is; sometimes not. If there’s a triangle to the left of the font’s name, click it (you may have to navigate down two or more levels) to see which test(s) failed. Otherwise, I’m sorry to say, your only options are to delete and replace the font or live with the uncertainty that it may be damaged in unknown ways.

    If a font has a serious error, the safest course of action is to select the checkbox next to it, click Remove Checked, and then reinstall the font (assuming you have the original somewhere or can obtain a fresh copy)—although I should point out that certain errors Font Book considers serious may not affect you at all in practice, and may still exist even after you reinstall a font. Fonts with minor problems can most likely still be used, but if the problem is a duplicate font (as you can discover by drilling down through the list of tests as described in the last paragraph), move on to step 4.

    When you’re finished, close the Font Validation window.

  4. If you have any duplicate fonts (for example, fonts for which you have one copy in /Library/Fonts and another, possibly different, version in /Library/Fonts/Microsoft or ~/Library/Fonts), these can cause various problems, including in some cases increasing the time it takes your Mac to start up. Duplicate fonts are shown in Font Book’s main font list with a yellow alert icon next to them. You can deal with duplicates in either of these ways:

    • Click the triangle by the font’s name to display the duplicates. To see where each one is installed, hover over it briefly; the location appears in a yellow tool tip. To disable one of the duplicates, select it and choose Edit > Disable “Font Name.”

    • To let Font Book decide which duplicated fonts to disable (a quicker method), choose Edit > Look for Enabled Duplicates. If Font Book finds duplicates, you can click Resolve Manually or Resolve Automatically, depending on whether you care which duplicate is disabled.

  5. Quit Font Book.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset