Published On September 10, 2018 | Tutorials

Permission to Repair Granted

Column: Brad Watts

If you’re an OS X or macOS user with half a clue you’ll know that jumping into the application Disk Utility and hitting the ‘Repair Permissions’ button can drag your operating system drive back towards peak performance. But what exactly do file permissions pertain to? 

OK, here’s the deal. If you select a file or folder in macOS and choose ‘Get Info’ from the control-click menu, you’ll see a section at the bottom of the window entitled ‘Sharing & Permissions’. This section sets up how the particular file or folder is available to read, write, or read and write, and which processes have access to those abilities. Those processes can be the system itself, the admin user, or any users with access via sharing. As you’d imagine, should any files or folders end up with incorrect permission settings, the operating system will become confused when trying to write to or read from those incorrectly set files. If those files are designed to be accessed by the operating system and the system is denied access, the system is going to start unravelling. Fonts may appear incorrectly, virtual RAM space may get thwarted, and general usage will begin to slow or even fail to launch applications.

So, you’ll understand the importance of keeping permissions set correctly throughout your files within your system drive. Notably, Apple has removed the option to repair permissions as of OS X 10.11 (El Capitan). The Disk Utility application simply doesn’t have the option. Since El Capitan, Apple instigated ‘System Integrity Protection’, which halts malicious software — such as installers from unsigned developers — from altering files residing in the directories /System, /usr, /bin, /sbin, or any app that comes preinstalled in the system. Signed Apple developers are given clearance from Apple to allow their applications to alter these root-level files, so anything you download from the App Store shouldn’t affect permissions settings. Apple advises that permissions repairs occur when you download and install system upgrades. That’s fine if you have system upgrades to install, but not so clever if you don’t.

Obviously no operating system is fault-free, and despite what Apple claims, permissions can still become corrupted. For example, I often install apps that are from unsigned developers, so I have to jump into the System Preferences and allow those apps to open from within the Security & Privacy settings. It’s entirely possible those apps could alter permission settings.

With this in mind, how the hell do you repair permissions when good old Disk Utility doesn’t? I’ve come across many variations of this workaorund since OS X 10.11, but the simplest way is to use a command line in Terminal, an application you’ll find in the Utilities folder. The commands aren’t too unwieldy, and they’re short and simple enough to keep in a text document somewhere, but there are different commands for different versions of OS X and macOS. For those running OS X 10.11.x (El Capitan) use this: ‘sudo /usr/libexec/repair_packages –repair –standard-pkgs –volume /’. Use only what’s between the quote marks, and pay careful attention to the spacing. Paste that info into Terminal, hit return, then put your account password in and wait. Terminal will report when the verification and repair process is finished.

For 10.12 (Sierra) and 10.13 (High Sierra) the procedure is quite different, as the repair permissions command is completely removed within Sierra and High Sierra. To get some way towards correct permissions for your user account, first go to your user account directory; the one with the house icon. Hold down command-I, or use the control click to open a contextual menu and choose ‘Get Info’. This will open the usual info window, where at the bottom you’ll see the ‘Sharing & Permissions’ section. Click on the padlock icon and authenticate with your account password, then click on the cog icon right at the bottom and choose ‘Apply to enclosed items’. You’ll be told you can’t undo this change, but go ahead. Do it. Once that process is finished, head to the Terminal app in Utilities and use the following command line. ‘diskutil resetUserPermissions / `id -u`’ Again, use only what’s between the quotation marks, and pay attention to the spaces. (The accent-looking character, or grave, is the key to the left of the numeral 1 key and above the Tab key.) Re-lock the padlock icon and you’re good to go.

That’s as good as it gets for 10.12 and 10.13 permissions maintenance, but it will reset your user account directories. If you want something to repair permissions on system files, use an app called Kext Wizard. Google it and you’ll find it on Softpedia. This will repair permissions in your System/Library/Extensions directory, which is where all the kexts are kept. Kext Wizard is primarily for adding kexts to a Hackintosh System folder, so the repair permissions tool is there to make certain those additional kexts are set correctly following installation.  

Leave a Reply

Your email address will not be published. Required fields are marked *