How to do after fsck_hfs fails to repair “invalid directory count” after 3 attempts multiple times?

apple.stackexchange https://apple.stackexchange.com/questions/421164

Question

I have an OsX installation that doesn't get past the apple logo. The progress bar loads and then shuts down midway.

I have rebooted as single user mode and noticed that /sbin/fsck -fy complained that the disk was full. So I deleted some fairly large files and reclaimed > 15% of disk space and ran:

fsck_hfs -rft /dev/rdisk0s2

Now, I get the following error messages:

Executing fsck_hfs (version 305.10.1). 
Checking Journaled HFS Plus volume. 
The volume name is Macintosh
Checking extents overflow file. 
Checking catalog file 
Rebuilding catalog B-tree
Rechecking volume
Checking extents overflow file
Checking catalog file
Checking multi-linked files. 
Checking catalog hierarchy 
Invalid volume directory count (It should be 136231 instead of 136234) Checking extended attributes file. 
Checking volume bitmap. 
Checking volume information. 
Repairing volume
Rechecking volume
....
....
The volume Macintosh could not be repaired after 3 attempts.

I have tried rerunning fsck_hfs several times, but it does not change the message. The invalid directory count remains.

I've tried booting the repair disk to run DiskUtility, but not surprisingly, this has the same error information as well, with the additional error message:

File system check exit code is 8
Updating boot support partitions for the volume as File system verify or repair failed.

How can I fix this? How do I get fsck to rebuild/reset the directory count? I cannot believe that the installation is toast simply due to an invalid directory count?

Was it helpful?

Solution

This would be the kind of task I'd be throwing at one of the high-end 'fixit' apps, Disk Warrior or TechTool Pro etc. Both of these can in essence rebuild the directory from scratch, then replace the old one.
Disk Warrior was always the king of this, but can't yet handle APFS. TTP 14 can handle APFS & seems to handle it well so far [I've only recently got the upgrade].

idk if any of them do a free trial.

Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange
scroll top