Disk permissions seem like a big deal on the Mac. If you’ve ever done much troubleshooting, you’ve probably heard “repair disk permissions” offered as a solution at least once. Users that migrated to macOS from Windows might find this whole thing a little baffling. Why are disk permissions so important? How do they become damaged? Why does “repair disk permissions” seem to fix so many issues? How can I repair disk permissions? When is that a good idea? Heck, what are permissions?
UNIX: A Permissions-Based Infrastructure
macOS is based on Unix, and Unix is heavily dependent on permissions. Permissions are attached to each and every file and folder, and describe what kinds of users or applications can interact with that file. Files can have a range of permissions, describing who and what can mess with them. Important files can be changed by just anyone. While this might not seem to matter much on a single-user machine, it is required for programs to play nice together. It’s also a hold over from when computers were pretty much always networked and files were pretty much always potentially accessible by other users, unless they were specifically banned. macOS uses the default Unix Read-Write-Execute permissions, as well as its own permissions called ACLs, or Access Control Lists. These more refined permissions allow for more granual control of file access. Users can use Terminal to adjust permissions for specific files in their system.
Why should users repair disk permissions?
On macOS, apps can sometimes damage the permissions structure in a macOS users’ home folder. As a result, permissions for folders and files in the user’s home directory might not be correct. As a result of these incorrect permissions, applications and services can be denied access to essential files they need, causing them to crash or operate unusually.
The “Repair Disk Permissions” function returns home folder permissions to their expected state. The home directory’s contents are checked against the “Bill of Materials” found in /var/db/receipts and /Library/Receipts. Those contain, among some other things, the record of what the home directories permissions should be. If you explore those directories, you’ll find a bunch of files with the extension “.bom” standing for Bill of Materials. These include a list of permissions that system files and program files should have. If there are any problems with permissions later, the operating system can repair disk permissions by returning them to their expected state as listed in the .bom files. This might fix some problems with your system, but in general it’s not a specific solution to that many problems that aren’t obviously related to permissions.
However, repairing permissions is one of those things that never really hurts. It’s very much like restarting your computer. It might fix a wacky problem, but it can’t hurt you. Nothing will be damaged by repairing permissions, and sometimes it can slightly improve efficiency on your system. Incorrect permissions can also cause all sort of cryptic and unexpected errors, which are often hard to trace back to the source. So “repair disk permissions” is an easy recommendation to make when troubleshooting. It won’t hurt, it could resolve a thorny problem, and it might have beneficial effects besides that.
However, repairing disk permissions is far from the panacea some users might believe it to be. It won’t cure every disease your Mac has, it won’t magically speed up an older system, and it won’t return your Mac to “like new” state. And, in fact, permissions have been protected since macOS El Captain. Now they can’t really be changed that easily, so they’re less likely to be damaged. So on a modern version of macOS, it’s even less likely that repairing permissions will do some voodoo on your computer to fix all your bad juju.
How to Repair Disk Permissions
1. Open Disk Utility by tying “Disk Utility” in to Spotlight or navigating to /Applications/Utilities/Disk Utility
2. Click on your boot disk in the left hand pane. If you didn’t rename the drive, it will be named “Macintosh HD.” On our system, the drive is named “Sierra.” Note that we’re selecting the disk rather than the volume.
3. Click on the “First Aid” icon.
4. This will pop up a confirmation dialog. Click “Run” to start the disk repair process.
5. Click the continue icon after you’ve read the warning message.
6. During this process, your computer will be non-responsive. This is totally normally and expected. The operating system has to lock you out of changing the drive contents for a few moments to correctly analyze its contents.
7. When completed, you can click “Show Details” to see a report on the First Aid process.
Part of this process will be to verify permissions against receipts in /var/db/receipts and /Library/Receipts and correct any differences. If no changes are found when home directory permissions are checked against the receipts, no changes will be made.
Conclusion
While permissions are protected on modern versions of macOS, that doesn’t mean they never get damaged. Instead, it means that they are messed up less frequently. If First Aid can’t repair them, you’ll need to check out more advanced tools. like Disk Warrior, which can often save boot disks from permission-based annihilation. You’ll need to connect the problem drive to another Mac, but we’ve yet to encounter a disk Disk Warrior couldn’t fix, provided it’s not physically damaged or non-operational. You can also continue to work on your drive in Disk Utility’s Terminal version, diskutil. You might even really investigate with fsck, but in our experience, that utility has a low rate of success on permissions-based issues for HFS+ drives.
You might also like the following posts: