We all love our Macs, and most of the time, they love us back. But occasionally, programs start crashing, or the spinning-pinwheel-of-death becomes a common sight. In these situations, there are a few steps you can take to try and remedy the problem. Today, we will be looking at repairing damaged file permissions.
What are permissions?
Permissions are file and folder settings that OS X uses to determine who can access and manipulate files. The purpose of permissions is to prevent unauthorized users and programs from damaging to changing system or user files. Think of permissions as the OS X bouncer. There are three basic kinds of permissions; read, write, and execute. Read and write are pretty much self explanatory, but execute is a different story. Depending on weather the file is and executable (a script of program) or a folder, execute determines weather the file can be run (if it is executable), or searched (if it is a folder). By default, there are three types of entities that exist as users in OS X; owner, group, and others. Owner is you, and by default, you have access to all of your files and folders. If you are a system administrator, you have access to all files on the computer, including those of other users. Group is just what it sounds like, a group of users. Users can be placed in a group, and the group given access to files, thus giving the user access by proxy. Group is handy when dealing with situations in which many users exist, of which you want some to have more or less access to files. Only administrators can create and change groups.
Why do we care?
All that technical stuff is well and good, but as a user, we don’t have to deal with them face to face very often. So why should we care about who and what can access files, other than from a security standpoint? Well, users are not the only ones trying to access files; applications need to read and write files as well. During the course of running any given application, tens or hundreds of files may be accessed, executed, and written by the program. No software is perfect, and during normal operation of your computer, errors may occur when writing permissions of files. These errors may make it impossible for a program to access a file it needs to run. But what happens when something goes wrong with the permissions of a file that an application needs to access? Program crashes, and other finicky behavior. Many times, if a program is doing weird things, or crashing often, one or two files with bad permissions could be to blame. In simple terms, think of it like being given a task from your boss that requires access to the Johnson account, but when you go to file room, the secretary tells you that you can’t see the Johnson account. You can’t get the information you need, and thus, can not complete your task.
How do we fix them?
There are more than a few ways to fix bad system permissions. The most common way to fix permissions is by using the Disk Utility. Go into your Applications > Utilities folder, and open Disk Utility. Select the drive you want to repair from the list on the left. If you have more than a single partition on a single drive, select the partition you want to repair. Click on the First Aid tab, which should be selected by default. Now click “Repair Disk Permissions.” OS X will do its thing, and you will see “Repair Complete” when your permissions have been repaired. This will repair your User and Application files, which are usually what cause problems with program crashes.
Another, arguably simpler way to repair your permissions is to open up the system Terminal (by going to Applications > Utilities), and typing:
sudo diskutil repairPermissions /
You will be prompted for the system administrator password. Once you have entered the password, you will see your permissions being repaired. Once the repair is finished, you will be returned to the command prompt. This does the same thing as running disk utility, only it fixes permissions on the entire disk, and without the graphical interface.
Some Final Notes
I like to repair my permissions at least once a month, just to make sure that my system is in tip-top shape. If you have any questions, comment on this post, and I will try to answer them. Stay tuned to The Apple Blog for “Troubleshooting Tips 2: Repairing a Damaged Disk,” coming soon.