To verify disk permissions on Mac OS X from the terminal, type:
diskutil verifyPermissions /
To repair permissions:
diskutil repairPermissions /
To verify and repair a volume from the terminal, type:
diskutil verifyVolume [volume name]
If you want to verify your main volume (for example Macintosh HD), you can type:
diskutil verifyVolume /
Or, if you want to check an external disk connected to your Mac, type:
diskutil verifyVolume /Volumes/[volume name]/
for example:
diskutil verifyVolume /Volumes/ExternalHD/
If no message appears, you can assume that diskutil has not found any errors and you can finish your maintenance.
If, however, an error message such as “The volume Macintosh HD was found corrupt and needs to be repaired” is displayed, you can repair the drive using the following diskutil commands.
To repair the main hard disk, use the following command:
diskutil repairvolume /
Or, for the external drive, type:
diskutil repairvolume /Volumes/ExternalHD/
of course, replacing ExternalHD with the name of your external hard disk.
Enjoy!
