Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Please help! Invalid node structure and invalid record count

My MacBook Pro is about 6.5 years old. I upgraded to Snow Leopard 2 years ago and added RAM at the same time. My first problem ever occurred three days ago when my computer got super sluggish, I restarted and got the gray screen with apple and spinning wheel...no boot up. I ran disk utility from the snow leopard install disk and found "invalid node structure" and "invalid record count". After reading on here what to do...try to repair the disk and so on with no success I went out and bought Disk Warrior. Got home expecting to fix everything and Disc Warrior won't boot...I just get a file with a question mark and the disc is ejected. I tried erasing the hard drive but was only able to use the "don't erase data" option. Then I tried to reinstall Snow Leopard with no luck. Now I am stuck. Any ideas?


One thing to note is I am to the point of not caring about the files on the hard drive, I was a dummy and never backed them up...lesson learned! I just want my computer back without having to spend $1000+ for a new one. Then again I am always willing to do that too as a last resort.


PLEASE HELP!

MacBook Pro, Mac OS X (10.6.8)

Posted on Sep 19, 2012 6:08 PM

Reply
61 replies

Mar 22, 2016 9:52 AM in response to Chris Watts1

It doesn't work for me:


sudo /sbin/fsck_hfs -yprd /dev/disk2s2

/dev/rdisk2s2: starting

journal_replay(/dev/disk2s2) returned 22

Using cacheBlockSize=32K cacheTotalBlock=32768 cacheSize=1048576K.

Executing fsck_hfs (version hfs-305.10.1).

Block 2 is not an MDB or Volume Header

CheckForClean - could not get VHB/MDB at block 819122278

** Checking Journaled HFS Plus volume.

hfs_swap_HFSPlusBTInternalNode: catalog key #65534 offset too big (0x0000)

Invalid node structure

(4, 0)

** The volume could not be verified completely.

volume check failed with error 7

volume type is pure HFS+

primary MDB is at block 0 0x00

alternate MDB is at block 0 0x00

primary VHB is at block 2 0x02

alternate VHB is at block 819122278 0x30d2d066

sector size = 512 0x200

VolumeObject flags = 0x05

total sectors for volume = 819122280 0x30d2d068

total sectors for embedded volume = 0 0x00

CheckForClean - could not get VHB/MDB at block 819122278

CheckHFS returned -1317, fsmodified = 0


I have an USB disk with two partitions (4 actually, it was the internal disk of my old MacBook with Lion and Yosemite installed plus the recoveries). What drives me mad is that it has been the new magnificent Disk Utility in El Capitan killing the partitions!!

May 6, 2016 7:17 AM in response to AEC22

All right, guys. I ran into this problem early today and it looks like I manage to get my MacBook Air up and running. As I am on vacation there are no any Apple Geniuses areound for 1 thsnd miles min 😉 And I wanted my laptop back badly ) So I had to do something..


Problem diagnosis


1. Rebooted my MacBook Air (El Capitan, latest), an Apple logo and progress bar appears.. progress bar moved almost to the end and black screen and see my mac as it was switched off. Repeated 3 times - same result. Computer shuts down before showing users welcome screen.


2. Cmd + I and see what logs are saying. I am sorry, I did not realized I will be writing this - I did not take screenshot. Anyway - on the disk mounting process /sbin/fsck started, diagnosed some errors, failed to repair (split second) and shot system down.


3. Cmd + S and have a single user mode. Thanks G.. it did not reboot. Also it did not mount fs. It proposes to run two commands

/sbin/fsck -yf

/sbin/mount /


4. I ran fsck - with an interesting result - it stuck with "CreateNewBTree returned -34" and then "disk full"


5. Checked with "df" command - I had 8GB free space of 512GB. Small. Let's kill rm -rf /Users/<my user>/Downloads. Now i have 24GB - no way.


6. fsck - no luck, still the same result. Then I realized it tries to rebuild BTree - it does not cares about size of the files. It cares about number of nodes (# of dirs and files!). And recently I played with git and created thousands of files in my development dir.


SO, diagnosis:

1) IT LOOKS LIKE FS NODES INDEX GOT CURRUPTED SOMEHOW

2) TOO MANY FILES (NODES) IN FS MADE IT IMPOSSIBLE FOR FSCK (AND GUI REPAIR TOOL) TO COPE WITH IT


Solutions research

#1: turn of fsck check on boot and then clean up the drive

#2: clean up nodes


I choosed to try #1 and failed. Did a lot of research on how to turn off fsck in /etc/fstab etc.. You should get device UID and make a custom line in /etc/fstab file with 0 0 at the end to prevent fsck to check this device. Too risky, not clear how it will work on El Capitan.


Then I went to #2..


Solution


1. Cmd + S


2. rm -rf /Users/<my user>/Sites (here a LOT of files was created by git)


..after 1-2 min of deletion..


3. /sbin/fsck -yprd /dev/disk0


..now it fixes things..


4. shutdown -r now


5. Let it boot up (will take a LOOONG time). Then for mee it booted up in Safe mode.


6. Reboot once again - ok, we have system up and running.


Few comments to Apple guys -

1) how f. did you come up with error -34 for this situation??? Can you make this whole fsck_hfs messaging more clear and helpful? Like "Okay, you have too many nodes and FS got corrupted. Pleas rm -rf ..X..files.. and press Y to repair."

2) there is need an easy way to turn off fsck on bootup manualy without risking to crush the system (fstab and /sbin/vifs are ridiculus stupid rudiments in 21st century)

3) repair tool (GUI) should be more clever than fsck. Now it is not (I suppose it is just dumb GUI for fsck_hfs).


As you can imagine, all these steps are made with back and forth try-and-error approach. Frankly I am really upset I've lost 4 hours wrestling back and forward to get my Mac back working. There is no really deep advise on this topic in Google, and a lot of people struggling with this symptoms. That's why I wrote this post (another +0,5 hour lost).


Hopefully, this will save a few hours of yours. Russian engineering force is awaken 🙂 All best wishes! Peace! Andrey

Jul 3, 2016 5:13 PM in response to Chris Watts1

Awesome man! Helped me so much! I just fooled around with my windows partition which of course is on the same disk as my macintosh hd.. Well I hadn't backed up for three weeks so that was one of the very big reasons to keep trying to boot this machine up. Your instructions were really clear and simple and of course the result is this text that I'm writing with my working machine!


Thank you so much! You should be awarded for helping this many people on solving this problem which also the "geniuses" I bet wouldn't be able to solve...

Please help! Invalid node structure and invalid record count

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.