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 *** super sluggish, I restarted and *** 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. *** 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 ** stuck. Any ideas?


One thing to note is I ** 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 ** 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
Question marked as Top-ranking reply

Posted on Sep 26, 2013 2:29 PM

Invalid Node Structure is not a hardware failure, it never was (you may still have a hardware failure, but the Invalid Node error is not indicative of this problem.


Still, Disk utility will certainly fail to fix it, and DiskWarrior will probably fail too.


But don't despair. Try this, and don't give up till you've tried it at least three times.


First, get the name of the partition of the failing volume. You can get it most easily by finding your disk in Disk Utility, selecting your partition (not the drive) and type cmd-i. Look for "Disk Identifier" right at the top.


Then, open up Terminal, and type this:


sudo /sbin/fsck_hfs -yprd /dev/disk5s2


substituting your disk identifier for the one already here. Keep the "/dev/" part. Enter your password, and wait. It may take a while. I have had this fail several times before finally working so its important to keep trying. It's faster than a reformat!!!


If the afflicted disk is your startup disk, you will need to do this in recovery mode: restart the computer, hold down option, and wait for the disk options to appear. Select that, then proceed to Disk Utility and then Terminal as described above.


Good luck, and always keep a backup!


chris watts

61 replies

Aug 13, 2014 12:27 AM in response to Akmyny

That usually happens if you are running in a terminal window and you say this:


sudo /sbin/fsck_hfs -yprd disk5s2

instead of this

sudo /sbin/fsck_hfs -yprd /dev/disk5s2

Are you sure you are specifying the correct disk? You need to run "diskutil list" in the terminal to get the name of your disk. The name is dynamic, so check after each reboot.

If thats not the problem you can try going into disk utility and unmounting the disk. If its your startup disk, then either boot from a CD or from the recovery partition and use the terminal that you can access from the recovery OS. If you still get the busy message let me know here.

You can also try /sbin/fsck_hfs -ypdRace /dev/disk5s2 and /sbin/fsck_hfs -drfy /dev/disk4s2

good luck!

chris

Aug 13, 2014 9:19 AM in response to Chris Watts1

Chris

I have tried this on my old internal drive that is now running external via USB to my new HDD Macbook on 10.7.5. I'm trying to get some photos off the old drive that Time machine missed, for whatever reason, during the restore.

The old drive fails Diskutility with invalid record count, Invalid node structure etc. I tried your above terminal command, and seems the same result (I did not leave it run all the way through, I cmd C it). Do I need to leave it on for a real long time? Is it doing anything? Any other options to get to the photo library (thats all I need)?


I *** pages of this:

(4, 2564)

hfs_swap_BTNode: invalid forward link (0xF2090000)

hfs_swap_BTNode: invalid backward link (0xF4090000)

hfs_swap_BTNode: invalid record count (0x3400)

Invalid record count

(4, 2565)

hfs_swap_BTNode: invalid forward link (0xF4090000)

hfs_swap_BTNode: invalid backward link (0xF7090000)

hfs_swap_BTNode: invalid record count (0x1500)

Invalid record count

(4, 2566)

hfs_swap_BTNode: invalid forward link (0xF6090000)

hfs_swap_BTNode: invalid backward link (0xF3090000)

hfs_swap_BTNode: invalid record count (0x1D00)

Invalid record count

(4, 2567)

^Ccm-work-6:~ cwm$

Aug 19, 2014 4:05 PM in response to Chris Watts1

Hi Chris,

I also have the 'invalid node structure' problem..

When I have tried the code you given for the partition disk1s2, as you said many times.. in the end, unfortunately, when I checked the partitions they were deleted.. they weren't there.. before this try, When I reach the partition using Finder, it was so much slow(maybe for a jpeg(100kb) it takes 1-2 minutes to preview it), but I was tried to see datas by Mu Commander, it was working fast as possible.. but, I understand this isn't about hardware..


so I wrote your code on terminal "sudo /sbin/fsck_hfs -yprd /dev/disk1s2" but then its disappeared..

Then I have used to get it back by using TestDisk.. I couldn't.. In the end, I used DiskWarrior, it get the partition back(I don't know OS working or not, but files are there..) but with big missings... some of the Personel folders are there, but inside them, there is no files.. actually, this files are most important files for me.. they are I think 15-20 GB.. but rebuilder files are 110 GB.. I don't know where they are..

Your code wasn't worked, and lost volume.. get back is not worked exactly, important things

What can I do now?

Aug 19, 2014 6:08 PM in response to insiyatif

There's no way that I know of that fsck or fsck_hfs can remove a partition. That's not much comfort if your partition is now missing. The MDB is the master directory block for the partition. If this is damaged, it's not good. This is why we back up. If your disk has problems but you can still read from it, ALWAYS make a backup before trying these repairs. This was in my first post, and I will say it again: BACK UP your important files! Even on a raid, which protects against hardware failure.. the best raid in the world won't save you from stupidity, temporary insanity, carelessness, fatigue or whatever caused you to delete that file you now want back.


If it was me, and my drive, I would try repairing the attribute tree and then the overflow tree with this.


But first, if your partitions are missing make sure they are not just unmounted. Go in Disk utility and see if they are there or (in the terminal) type diskutil list


Note the drive identifiers. Now I would get iPartition, and see if I could repair them. Sometimes just changing the partitions size very slightly will fix it.


Then I would run sbin/fsck_hfs -ypdRa /dev/disk4s2

and if that works, then run

sbin/fsck_hfs -ypdRe /dev/disk4s2

and then


sbin/fsck_hfs -ypdr /dev/disk4s2 (or sbin/fsck_hfs -ypdRc /dev/disk4s2 - same thing)


But this is a longshot.


to see the documentation for this command type man fsck_hfs in the terminal.


chris

Aug 19, 2014 6:14 PM in response to Chris Watts1

I was looking for other solutions for you and found this:


A tool that will help you is DataRescue (http://www.prosofteng.com/products/data_rescue.php). It's commersiall, but it generally gets the job done. It will scan through the entire volume looking for signatures to determine where stuff reside, such as area for the H+-tree and the data, and also find block-sizes based on signatures. A tip when using DataRescue is to save your search when you've scanned your volume before you try extracting any files. If it should crash during the extraction of data, you will not have to scan the entire volume again, which will save you a lot of time.

I use data rescue and it's always worked well for me.

chris

Oct 22, 2014 2:27 AM in response to Chris Watts1

Hi,

i also have similar issues.However,i not only get the 'invalide node structure' error but also i/o error.

Anyway,i tried Chris Watts terminal solution and i get the following message:


The volume could not be verified completely

volume check failed with error 5

volume type is pure HFS+

primary MDB is at block….. etc.


any ideas Chris or anybody else

Nov 13, 2014 11:57 PM in response to Chris Watts1

Chris,


You are a rock star! I foolishly attempted to install Yosemite without first backing up my hard drive. In the process of installing the update, my iMac crashed and I couldn't get past the utility screens. When I ran Verify Disk, I kept getting the same "invalid node" error messages. I spent over 90 minutes on the phone with AppleCare last night and the only advice they could give me was to reformat my disk. My wife and I were just sick because we were going to lose the past 6 months of photos of our 3 little girls. I decided to try to find a solution myself and stumbled upon your thread. Even though I'm clueless at this type of stuff, I was able to follow your instructions and do this repair. I had a tough time finding the disk identifier (I finally found it by clicking "Info" in the Disk Utility menu) and figuring out that I needed to type everything exactly like you had it except the "disk4s2" part.


I couldn't get the original command in this string to work, but I was able to use the revised command: "/sbin/fsck_hfs -yprd /dev/disk0s2". I watched screen after screen scroll down, not having a clue what any of it meant or what was happening. However, once I *** the command prompt again and restarted, I was able to get to a screen that allowed me to reinstall Maverick O/S. I held my breath for over an hour waiting to see if I was going to be able to get back into my files. To our relief and joy, the computer slowly rebooted after the install and all of our files are still there! Thank you, thank you, thank you! You should start up a fund so that all of us can contribute to your cause since you are far more helpful on this topic than AppleCare!


By the way, I ** currently backing up all my files on my new WD Passport that I just purchased yesterday!


We can't thank you enough!

Nov 30, 2014 5:00 PM in response to Chris Watts1

Hi,

I tried Chris' suggestion, but I get a 'disk full' error:


/dev/rdisk3s1: starting

journal_replay(/dev/disk3s1) returned 0

Using cacheBlockSize=32K cacheTotalBlock=98304 cacheSize=3145728K.

Executing fsck_hfs (version hfs-285).

** Checking Journaled HFS Plus volume.

The volume name is SIMPLE500

** Checking extents overflow file.

** Checking catalog file.

** Rebuilding catalog B-tree.

BlockFindAll: found 42356 blocks but needed 587520

CreateNewBTree returned -34

Disk full error

** The volume SIMPLE500 could not be repaired.

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 976773040 0x3a385fb0

sector size = 512 0x200

VolumeObject flags = 0x07

total sectors for volume = 976773042 0x3a385fb2

total sectors for embedded volume = 0 0x00

CheckHFS returned 8, fsmodified = 0


Any ideas? This is an external USB 2.0 drive. I tried unmounting it first, but I *** the same result.

tia, Patrick

Dec 16, 2014 10:27 AM in response to Chris Watts1

Thanks for the guidance! Had same problem upgrading a MacBook pro from Lion to Yosemite. I had to drop the "sudo" part of the command string to work In terminal. Also, I *** into Terminal from OS X Utilities Menu, white background not the black background screen. I spent 2 days screwing around these forums and I just wanted to thank you. I'm going to backup the system now. For the record I typed the following and had to run it twice because the first time it said it fixed some but still failed. /sbin/fsck hfs -yprd /dev/disk0s2 disk0s2 was the name of Macintosh HD. That was the corrupt disk. Thanks again!

Jan 31, 2015 1:26 AM in response to AEC22

The corruption of the drive is an issue that is unique to the WD My Passport drive as I have lost the filesystem on my "My Passport" drive at leat 10 times now since I started using it for my Time Machine backups.


I have however noticed that the corruption seems to occur when the system is shutdown during a disk operation like a backup or when the system does not shut down cleanly. I suspect that there is a kernel timing issue associated with the drive cache in the "My Passport" drive which is causing thie filesystem corruption issues.


I have only once successfully recovered the partition using fsck_hfs only to find that a few days later an unrecoverable corruption occurred for no reason (the system was left on for the whole time). I haven't reported this to Apple yet but I think that it is time that it was, reported.


Oh, the "My Passport" drive was much more reliable after I formatted it using the "WD Drive Utilities" from their website.

Jun 4, 2015 12:13 PM in response to Patrick123

i recently stumbled across the same issue, as I tried to resurrect such a broken drive.

The user just wanted as much data as possible recovered, but I was unable to get the drive or even the partition, to be mounted again under Mac OS.


But, just out of curiosity i tried something unusual.

I have installed the original HFS driver form Apple under my windows machine. You can get the library from an original bootcamp installation.

And windows was mounting the Partition without ANY hassle (just read-only, as the windows driver does not support writing, but that was just perfect for quick and dirty recovering)


After that I tried to mount the partition again under Mac OS as i thought, it is working again (readonly) but, nope... Mac OS (Yosemite) still was unable to mount the partition. even read only...


Long story short: try Windows with the Original HFS Driver!

Sep 18, 2015 10:10 AM in response to AEC22

Like so many others, I found this thread and it was helpful, to an extent. I used the command on a software RAID I'm on my 2009 Mac Pro. It *** the RAID to mount but almost all the files on it are now gone. The file structure in the root is intact, but almost all the folders are empty. Any of you wizards out there have a hint as to what might help?


P.S. I have all the files backed up on back blaze, I'd just love to not have to download several terabytes of data...

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

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 Account.