Repair Disk Permissions from the Command Line in Mac OS X
In some situations, you may need to repair a Macs disk permissions but be unable to access the Disk Utility app, perhaps due to remote management or because of a problem with something in OS X. Fortunately there’s another method you can use to repair disk permissions in Mac OS X, accessible through the command line.
To be clear, this will initiate the exact same Repair Disk Permissions functionality that is seen in OS X Disk Utility app, via the Terminal. Launch the Terminal.app and then just type the following command:
diskutil repairPermissions /
You may want to prefix diskutil with sudo, like so:
sudo diskutil repairPermissions /
This will repair the disk permissions on your Mac’s main drive, determined as the root volume /
As you may have guessed, if you want you can also run the disk permission repair on another disk by specifying the other volume rather than / at the command line.
Regardless of the target disk, once the command has been executed you will see a message like:
Started verify/repair permissions on disk0s2 Mac HD
The time it takes to repair the disk permissions depends on various factors, but the command will update as permissions are repaired and will end itself when diskutil is finished. This process can take quite some time, so be prepared for that and have patience. Separately, you may want to repair user account permissions as well, which requires a different process started upon boot of OS X.
If you have verified disk permissions and you find a bunch of problems, you might want to cross check them with this list from Apple for errors that you can safely ignore.