0

How does Disk Utility repair corruption?

When you run First Aid, it logs things like "checking fsroot tree", checking the EFI jumpstart record", etc. How does it know if something is broken, like does it have a correct version to compare things to? What if the correct reference gets corrupted as well?

0

You’ll find lots of detail about DiskUtility at Wikipedia. There is a lot of information here which I found interesting.

Because of the depth and breadth of what DiskUtility does, it would be complicated to answer fully.

For those moderators who dislike link-only answers, (and I’m one of them,) I feel that this Wikipedia link will suffice, however, because Wikipedia is not likely to ever disappear in our lifetimes. If it does disappear, we have more to worry about.

0

I have often asked myself, if a disk or volume is corrupt. And, if so, would I be better off backing up files before or after running repair software. In other words, could the repair destroy a file that otherwise could have be copied. Therefore, I would like to separate the detection for corruption from the possible repair of corruption. Depending on the version of OS X/macOS, the Disk Utility may or may not offer this option.

The Disk Utility basically runs the command diskutil repairdisk device, where the device is usually disk followed by an positive integer. If you right click on a drive shown in the Disk Utility and select "Get Info", the device is the "BSD device node" shown in the popup.

Older versions of OS X/macOS allowed you to select a disk verification. This option was eliminated from the Disk Utility in the latest versions of macOS. However, you can still run disk verification by entering the command diskutil verifydisk device in a Terminal application window. Again, you will need to replace device with the appropriate "BSD device node".

You can also apply the same to just a volume. You will need to replace repairdisk and verifydisk with repairvolume and verifyvolume. Also the device will usually be disk, an positive integer, the letter s and finally another postive integer. For example, disk0s2.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .