“Have you tried repairing Disk Permissions?” is a typical troubleshooting advice addressed to Mac OS X users whenever they face file access issues. Very few people know what disk permissions are or why they should fix them.
Disk Permissions are file and directory settings that influence user’s ability to read, write, or run specific system files. In earlier Mac OS X versions, the file-related software didn’t work right because of incorrectly set permissions. Automatic permissions repair was impossible on earlier Mac OS versions. For this, users could either use Disk Utility, upgrade or re-install the operating system.
Mac OS X 10.11 El Capitan deliberated users from the need to repair disk permissions by excluding the option from the Disk Utility. El Capitan introduced System Integrity Protection (SIP), a kernel-level feature restricting the actions of the root account. SIP features serve security purposes and prevent inexperienced users or malware from damaging operating system files.
How to Get to Disk Utility on Mac OS X
In Yosemite and earlier Mac OSX versions, the First Aid feature in Disk Utility helped to fix permission discrepancies in various files and folders. If you don’t know how to open Disk Utility, look it up in Applications -> Utilities. Mac users have reported getting the 'Disk Utility can't repair this disk…’ error. If this alert shows up, most likely your Mac’s hard drive is failing, and you need to back up important user data immediately.
To fix the issue, boot your Mac in a Single User Mode (Command-S shortcut) and do the following:
- Run the fsck -fy Terminal command and wait until it executes.
- If the 'File system was modified' alert shows up, repeat the fsck -fy command until you see the 'The volume X appears to be OK.'
- Type in reboot to exit the Single User Mode.
If you’re using Mac OS X versions before El Capitan, the following tips will work for fixing permissions on both startup disk and external drive:
- Go to Applications -> Utilities -> Disk Utility.
- In the left sidebar, choose the disk to repair permissions.
- Click on the First Aid tab -> hit Repair Disk Permissions button to launch the process.
- Alternatively, you can run '$ sudo diskutil repairPermissions /' in Terminal to launch the repair procedure.
Depending on the storage capacity and speed of the hard drive, the process may take some time.
In the process of repair, multiple messages will appear in the console to confirm that various files and directories have been repaired. Once finished, you’ll see ‘Permissions repair complete’ message. In case multiple hard drives or volumes need permissions checking, run the process for them as well.
How to Repair Permissions in El Capitan
Verifying and repairing disk permissions in El Capitan works a bit differently and requires using Terminal commands:
$ sudo /usr/libexec/repair_packages --verify --standard-pkgs /
Permissions differ on "usr/libexec/cups/cgi-bin", should be drwxr-xr-x , they are dr-xr-xr-x
sudo /usr/libexec/repair_packages --repair --standard-pkgs --volume /
How to Repair Permissions in Sierra
Users of El Capitan and later can’t interfere with disk permissions. However, this doesn’t exclude the possibility of permissions-related issues. In macOS Sierra, users can change the permission settings to be able to access a file or folder.
In case this doesn’t work, contact the administrator or the owner of the file/folder you’re trying to access.
How to Change Permissions on Mac or Reset Them
How to Check Mac OS X File Permissions?
The Terminal app can help in checking Mac OS X file permissions:
- Change the current working directory to the folder which contains the needed file or folder.
- Run the $ ls -l command in
MyMac:~ username$ ls -l
drwx------+ 4 username staff 136 Nov 23 01:16 Pictures
drwxr-xr-x+ 7 username staff 238 Nov 23 12:20 Public
drwxr-xr-x 5 username staff 170 Nov 23 01:16 Sites
To understand the displayed information, one has to understand the following syntax:
- The first character at the beginning of the line is the item type: file is '-', folder is 'd', symbolic link is 'l'.
- The next 3 characters are user’s permissions: no access is '-', read access is 'r', write access is 'w', file execute access or folder browsing access is 'x'.
- The set of three rwx or – symbols in the middle are group’s permissions.
- The set of three rwx or - symbols at the end are everyone else’s permissions.
It is possible to change or assign file permissions using $ sudo chmod Terminal command followed by a number representing permission groups and filename. To calculate the permission shorthand for a particular file or folder, use 4 for Read, 2 for Write, and 1 for Execute. For example, if the user needs to obtain write and execute privileges, then the shorthand is 3 (2 + 1). In this case, the command will look $ sudo chmod 333 1.jpg
Disk Permissions are crucial to protecting system files from unauthorized access resulting in further damage. Unlike earlier Mac OS X versions, macOS Sierra is set to repair disk permissions automatically. Still, users can reset the default permissions to get or allow access to specific folders and files. Mac OS X El Capitan and earlier operating systems allow changing, verifying, and repairing disk permissions with Disk Utility and special terminal commands.