chuckfromjacksonville

Q: I have an error of invalid node structure

I have an error of invalid node structure.  Can I save my data from my hard drive? Is it even fixable?

Posted on Mar 16, 2012 5:53 AM

Close

Q: I have an error of invalid node structure

  • All replies
  • Helpful answers

  • by Matt Clifton,Apple recommended

    Matt Clifton Matt Clifton Mar 16, 2012 6:02 AM in response to chuckfromjacksonville
    Level 7 (29,905 points)
    Mar 16, 2012 6:02 AM in response to chuckfromjacksonville

    Do you have current backups right now? If not, yes, try backing up as much as you can.

     

    You can try to remedy the problem either by booting from an OS X install disk (or a Lion recovery partition if you're on 10.7 - boot holding down cmd-R), and using Disk Utility to Repair Disk, or using Diskwarrior.

     

    Matt

  • by wjosten,

    wjosten wjosten Mar 16, 2012 6:25 AM in response to chuckfromjacksonville
    Level 10 (94,596 points)
    iPhone
    Mar 16, 2012 6:25 AM in response to chuckfromjacksonville

    That's a pretty serious error & most likely means your hard drive is toast. The only thing I'm aware of that can "try" to fix this is Diskwarrior, but you'll need the CD to boot from:

     

    http://www.alsoft.com/diskwarrior/

     

    But, be prepared to purchase a new hard drive.

  • by RodneyC,

    RodneyC RodneyC Aug 26, 2012 6:10 PM in response to chuckfromjacksonville
    Level 1 (0 points)
    Aug 26, 2012 6:10 PM in response to chuckfromjacksonville

    I realize this is long after this discussion thread took place, but I found these postings recently and  they were helpful to me.  I used the above advice, but could not access file on my hard drive; I did eventually find a solution that was not listed here. 

     

    So, this additional bit of advice could help if you need to recover data from the bad hard drive (this will not fix the hard drive).  I, too, had the "invalid node structure" as indicated above, but on a 2005 Power-pc iMac.  I could not fix the problem with the Disk Utility; if fact, the Disk Utility would even give me that option.  I did not have  Diskwarrior to fix the invalid node structure.  So, a friend suggested that I connect my "bad" 2005 iMac to the my newer 2011 iMac via a Firewire.  Then, with the new iMac already started, I was to hold down the letter "T" on the bad 2005 Mac and start it up. This action starts the computer in the Firewire target disk mode.  Essentially, this makes the second computer (2005iMac, in my case) an external hard drive that is controlled by the first computer.  Amazingly, I was able to access the hard disk and download several picture files that I did not have backed up (I now have Timecapsule).  At any rate, getting those files was a big relief. So, I hope this helps someone else.

     

    I'm sure there is a technical reason this works, but I don't know what it is.

  • by Courcoul,

    Courcoul Aug 26, 2012 6:31 PM in response to chuckfromjacksonville
    Level 6 (14,193 points)
    Aug 26, 2012 6:31 PM in response to chuckfromjacksonville

    First, salvage as much content as possible. Can try to clone the drive, but because of the error, some stuff might not be retrievable. Once the salvage phase is over, we can begin the reconstruct phase. Exactly what were you doing when the error became apparent?

     

    The other day I was trying out 10.8.1 ML on an external drive that also has my 10.6.8 SL volume. While I was poking around the Hillside Kitty, its Spotlight decided to index the SL volume. Unfortunately, my actions led to ML freezing and I had to force a restart. Fired Lion back up and ran Disk Utility on everything: it seemed that the SL side of things was toast with a similar error. Then I reflected that I wasn't doing anything on the SL volume, so the only thing that would be changing would be Spotlight's indexes. Got Spotless and used it to purge the Spotlight directory on the SL volume. Ran DU again. Lo and behold, NO ERRORS. Once that subdirectory was deleted, it apparently contained the damage that DU couldn't deal with, so the error was flushed.

     

    Moral of the story: when you get such an error, it means a node is bad, not the whole tree. If you can contain the damage by pruning the corresponding branch, the rest is perfectly good and healthy. Unfortunately, DU  as a repair tool is much too coarse and doesn't provide any clues as to how to do a microsurgery on your drive. So you have to wing it. Maybe some budding and adequately geeky developer gets a hint and comes up with a tool we can use, rather than having to pay muchos bucks for DiskWarrior or similar.

  • by Chris Watts1,

    Chris Watts1 Chris Watts1 Sep 26, 2013 2:30 PM in response to chuckfromjacksonville
    Level 1 (20 points)
    Sep 26, 2013 2:30 PM in response to chuckfromjacksonville

    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

  • by Chris Watts1,

    Chris Watts1 Chris Watts1 Oct 9, 2013 1:58 PM in response to Chris Watts1
    Level 1 (20 points)
    Oct 9, 2013 1:58 PM in response to Chris Watts1

    A clarification- if your disk is working, but you can't write to it, it will probably still be mounted, and the above will give you an error like this:

     

    /dev/rdisk5s2: starting

    Unable to open block device /dev/disk5s2: Resource busyjournal_replay(/dev/disk5s2) returned 16

    /dev/rdisk5s2: NO WRITE ACCESS

    /dev/rdisk5s2: UNEXPECTED INCONSISTENCY; RUN fsck_hfs MANUALLY.

     

    Go into Disk Utility and unmount the volume, and it should work.

  • by Tombbk,

    Tombbk Tombbk Sep 1, 2014 11:51 AM in response to Chris Watts1
    Level 1 (0 points)
    Sep 1, 2014 11:51 AM in response to Chris Watts1

    Thanks Chris. Had 'invalid node structure' after a normal re start on a virtually new imac. Worked a treat 3rd time around.

  • by MikeandJan Cunningham,

    MikeandJan Cunningham MikeandJan Cunningham Nov 11, 2014 9:04 PM in response to Chris Watts1
    Level 1 (35 points)
    Nov 11, 2014 9:04 PM in response to Chris Watts1

    Hi Chris,

     

    I ran your command and got this. What do you think?

    Thanks in advance for your help.

    Mike C.

     

     

    /dev/rdisk1s2: starting

    Unable to open block device /dev/disk1s2: Resource busyjournal_replay(/dev/disk1s2) returned 16

      Using cacheBlockSize=32K cacheTotalBlock=16384 cacheSize=524288K.

       Executing fsck_hfs (version diskdev_cmds-540.1~25).

    ** Checking Journaled HFS Plus volume.

       The volume name is Macintosh HD

    ** Checking extents overflow file.

    ** Checking catalog file.

    ** Rebuilding catalog B-tree.

    hfs_UNswap_BTNode: invalid node height (1)

    ** The volume Macintosh HD 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 1951845950 0x7456ce3e

      sector size = 512 0x200

      VolumeObject flags = 0x07

      total sectors for volume = 1951845952 0x7456ce40

      total sectors for embedded volume = 0 0x00

  • by gdudek,

    gdudek gdudek Jul 23, 2016 9:26 AM in response to Chris Watts1
    Level 1 (4 points)
    Jul 23, 2016 9:26 AM in response to Chris Watts1

    Very good advice. I'd use the variant

        fsck_hfs -drfy /dev/disk5s2

    but it's essentially identical except for forcing a check even on a disk that is marked clean.

    More importantly, on the occasions when this might fail, keep Disk Warrior in mind. It has repaired

    disks a couple of times for me when everything else failed, and it seems to get updated on a regular basis so

    it may even learn occasional new tricks.