Three ways to fix disk errors and repair permissions in OS X

Everything computers do is ultimately binary - a series of 0s and 1s - www.rawinfpages.com

Don’t let small disk problems grow into big ones on the Apple Mac. Fix them before they become serious and begin to affect performance and reliability. Here are three methods you can use.

Problems arise on the disk drive from time to time and they are usually minor and don’t affect you. You probably don’t even notice them. However, they will not go away on their own and as the number of disk errors increases they can reach a point where they do start to affect the way the Mac behaves. And not in a good way. Disk errors become app errors or system errors and lead to instability.

You must check for disk problems on a regular basis and fix them.

How often should you check and fix the disk? Once a month is a good schedule, but you should do so any time you suspect that their might be something wrong with the Mac.

Related: Get to know the new Disk Utility in El Capitan

Old Disk Utility

The way to fix disk problems in previous versions of OS X like Yosemite, Mavericks, and Mountain Lion was to run Disk Utility, which is in the Applications/Utilities folder.

Disk Utility in OS X Yosemite on the Apple Mac can be used to repair problems with the disk

Select the First Aid tab and down near the bottom of the window were four buttons Verify Disk / Repair Disk on the right, and Verify Disk Permissions / Repair Disk Permissions on the left.

Repair the disk and repair permissions in OS X on the Apple Mac

Click Verify Disk and if a problem was found, the Repair Disk button was activated and could then be clicked to fix whatever ails the disk. Similarly, you can check the disk permissions with the Verify Disk permissions button on the left and then use the Repair button to fix problems if they are found.

1 Use First Aid in Disk Utility in El Capitan

Most Mac users have upgraded to OS X El Capitan and have discovered that there is a new Disk Utility. The El Capitan version of this app is more colourful, but it has been dumbed down a bit. It is simpler and has slightly fewer features.

Disk Utility was redesigned for OS X El Capitan on the Apple Mac. It is more colourful

Instead of the four Verify / Repair buttons that we had previously, now there is a single First Aid button. Click it and it will check the disk drive for problems and fix them (you'd think, more of that later). Click the Show Details link to expand the panel and read the results.

Here is a typical result from running First Aid. It says that the disk is fine and the operation was successful. The disk is even given a green tick to show that it is OK.

Disk Utility in OS X on the Apple Mac can be used to repair disk problems

2 Use OnyX to check the disk

OnyX is a free tool for tweaking OS X, clearing out junk and unnecessary files like logs and caches, and general house-cleaning tasks. When it starts up, it asks if you want to check the disk drive for problems. You should allow it to do this before you use any of the tools., many of which delete or change files on the disk.

OnyX is a free utility for the Apple Mac that enables you to clean up and tweak the system

After scanning the disk, OnyX reported a clean bill of health. No problems.

3 Check the disk using Terminal

You can also check for disk problems using the Terminal and there is a command line tool that will do the job. It is called repair_packages. You can read about repair_packages in the OS X manual on the Apple website.

The command to enter into the Terminal window for checking the disk's health is:

sudo /usr/libexec/repair_packages --verify --standard-pkgs /

The sudo at the start is to run the /usr/libexec/repair_packages command as an administrator. The --verify tells the command to check the disk and the / at the end is the volume to check. A single slash (/) means start at the root of the current disk.

This command is a bit pointless because it just shows the errors and it does not fix them. As with the old Disk Utility, you should ignore this and go straight to the repair option. If errors are found, they are fixed, if none is found then it does nothing. To repair disk faults from the Terminal command line replace --verify with --repair like this:

sudo /usr/libexec/repair_packages --repair --standard-pkgs /

Terminal in OS X on the Apple Mac - use command line tools

The results are quite interesting. To recap, the First Aid function in El Capitan’s Disk Utility said there were no disk problems. OnyX also said that there were no problems. But here is what repair_packages found:

Fix disk permissions in OS X on the Apple Mac using a command line tool

Dozens of permissions errors. These can cause a variety of problems and they can slow down the Mac, cause error messages and problems in apps, and more.

So why does Disk Utility in El Capitan say everything is OK?

Remember the old Disk Utility had Verify/Repair Disk and Verify/Repair Disk Permissions? There were hardly ever any disk problems, but often there were lots of permissions problems.

I suspect that the First Aid function in El Capitan’s Disk Utility and OnyX are running only the old Verify/Repair Disk function, which rarely comes up with errors.

Disk Utility cannot be running Verify/Repair Disk Permissions because running the Terminal command displayed many permissions errors and then went on to repair them.

Conclusion

Do not rely on Disk Utility in El Capitan to keep the disk running smoothly. It performs only one type of check and it ignores permissions, which can cause various problems.

Run the repair_packages command in a Terminal window after using First Aid in Disk Utility.

 

Share

Comments

1

The repair_packages command has been removed from macOS Sierra. There is no way to fix permissions. Apparently Apple has decided that you don't need to check and repair permissions any more. Does this mean that permissions problems never occur?

Add new comment

By submitting this form, you accept the Mollom privacy policy.

Related items you will like...