Issue solved; no physical errors.
These are what I did:
First I analyzed where the error occurred :
...
** Checking catalog file.
Invalid index key
(4, 20220)
Invalid node structure
(4, 38065)
The volume SSD could not be verified completely.
...
fsck
stops while scanning catalog files. Let's try reading fsck_hfs
user manual by executing man fsck_hfs
for clues.
...
-R flags Rebuilds the requested btree. The following flags are supported:
a Attribute btree
c Catalog btree
e Extents overflow btree
...
Let's try rebuilding catalog btree then. fsck_hfs -Rc /dev/rdisk0s2
Results: fsck
does not stop at catalog file check anymore, and the Invalid index key
error disappeared, revealing more errors ( clues! ).
** Checking extents overflow file.
Incorrect block count for file Cache.db-wal
(It should be 114 instead of 119)
** Checking catalog file.
Missing thread record (id = 30291961)
Incorrect number of thread records
Incorrect number of thread records
** Checking multi-linked files
** Checking catalog hierarchy.
Invalid directory item count
(It should be 221 instead of 244)
Invalid volume file count
(It should be 1318081 instead of 1318117)
** Checking extended attributes file.
Invalid node structure
The volume SSD could not be verified completely.
fsck
now stops when checking extended attributes file. Let's try rebuilding the attributes btree with fsck -Ra /dev/rdisk0s2
.
Result(s): All errors, except Invalid node structure
disappeared after the first repair attempt. It shows several invalid nodes, then attempts the second repair, and rechecks. It still shows some invalid nodes, but even less then before.
However the fsck
stops with a message saying that it stops making repair attempts after 3 check failures. I ran fsck -Ra /dev/rdisk0s2
again. It attempts to repair again, then rechecks. No invalid node structure error shows up!
It now makes Invalid volume free blocks count
, Invalid volume file count
, and Invalid volume directory count
errors, but it doesn't stop yet!
After yet another attempt of repair, fsck
finished without any errors.
Shut down. Boot normally without entering single user mode. And it works!
Problem solved by running fsck
several times, rebuilding catalog btree, and attribute btree several times.
Give this a try. If you can get to single user mode you can remove the file that OS X checks for during boot to determine if the Mac has already been setup. If it doesn't find the file then it boots to the setup assistant, which allows you to create a new admin user.
Try resetting PRAM:
- Shutdown the Mac
- While holding ⌘+option+P+R, power on the Mac
- Continue holding all four keys until the Mac has chimed (restarted) twice, then release the keys and allow it to boot normally
If that fails, or you still can't boot to single user mode, give this a try. Resetting NVRAM:
- While holding ⌘+option+O+F, power on your Mac, after a few seconds you should be greeted with the Open Firmware screen.
- Type and click return:
reset-nvram
- Type and click return: `reset-all'
Hopefully by now you can boot to single user mode.
- Boot to single user mode (⌘+S while powering on)
- Type and hit return:
/sbin/fsck -fy
- Type and hit return:
/sbin/mount -uw /
- Type and hit return:
rm /var/db/.AppleSetupDone
- Type and hit return:
reboot
This should boot your Mac to the setup assistant. From here you can create a new user account, which will automatically be designated as an administrator account.
Hope that helps.
Best Answer
I am not sure how old your Mac is, but for Macs made in at least the last 10 years, this should work.
After booting to the Startup Manager, you can hold down the control key while selecting the operating system to boot. You should see the straight arrow change to a circular arrow. The selected operating system will now become the default.
Additionally, many Boot Camp arrangements allow the default boot operating system to be selected from the Windows Control Panel.