Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A DIY solution to an invalid node structure problem System
Background. About a month ago, I ran into a problem with Dashboard behaving oddly and after posting a question on the Apple forum, the very helpful Dr Smoke advised me to clear my caches and to run the 'repair disk' feature of Disk Utility while booted from the installation CD. (This because I reported that a couple of times I had to do a hard reset.) I got Dashboard fixed, but discovered that my disk had serious errors in the directory structure, reported as "invalid node structure," which Disk Utility could not repair. The laptop was running perfectly, but several people posted advice that I should not leave this problem unattended to.

Reporting this crisis again on the forum, I was advised to buy Disk Warrior for what might be a once-in-a-lifetime problem, or else I should back up my data and re-install everything. With help again from Dr Smoke, I made my firewire disk bootable for Intel Macbooks (must be partitioned with the GUID option selected), and searched the forums for a way to get going again without forking out $100 for Disk Warrior. Learning a little from each of several other posts, I put together the following solution which is easy to execute, and the time consuming elements can be left to run at night or when away from the computer. You may see possible shortcuts as you read through to make it even simpler.

Here's a summary of my solution: I cloned everything to an external hard drive, made sure it worked as expected, then erased the internal drive and cloned everything back. Read on if you'd like a more-detailed step-by-step tutorial...

[robg adds: What follows will seem simple and obvious to those who have cloned and restored systems before. But for those who haven't, it may provide some useful tips...]

Here are all the steps I used to clone and restore my system:
  1. I downloaded two disk cloning programs -- Carbon Copy Cloner and SuperDuper (which I preferred).
  2. I partitioned my Firewire disk in two (32GB and 8GB) for future convenience, and zeroed the disk after Dr Smoke's advice.
  3. I installed the basic OS X package onto my 8GB Firewire 2 partition using only Install (DVD) disk one, which takes up less than five gigabytes. (In Setup, one chooses to not install the additional programs -- iPhoto, etc.). I checked that I could boot from it and that it was healthy by running "verify disk" when booted from the internal drive.
  4. While booted from my internal drive, I cloned Firewire 2 onto Firewire 1 (the 32GB partition). I verified the disk (no problems), then booted from it and assured myself that I had a fully working copy of OS X.
  5. I booted from Firewire 1 and used Migration Assistant to import everything -- files, programs, the lot -- from my internal drive with the node structure problem. My FireWire disk was now using 25GB; the same as my internal drive. It now had two users, both shown as administrators. I booted to my newly-imported user ID -- the original one that was on my internal drive. The only problem reported by Migration Assistant was that Missing Synch for Palm might need to be re-installed. This would not be surprising, given what it does. Later when all was done, I discovered that the migrated programs had been placed in a folder on my desktop, so I opened it and moved them all into the normal Applications folder created by my new basic install. (Some programs don't like running from anywhere other than the Applications folder.)
  6. I worked from Firewire 1 for a day, trying out every program to make sure everything was working normally. One thing I noticed was that iTunes seemed to import as the original Tiger 10.4.6 version, so I needed to install the update to 7.02 which I had kept in my download folder. I also tried to install the OS X update to 10.4.8, but a dialog informed me that I could not do that on this (external) disk. I don't know why, but later on I updated to 10.4.8 overnight using Mac Update.
  7. Make sure all your data has been backed up somewhere, and that there is nothing of value on your internal disk. Take a deep breath, and wipe it! I did this using Disk Utility (from Firewire 1), and took the chance to partition my hard drive into 32GB, 18GB and 6GB partitions. I chose GUID partitioning and zeroed the disk. No going back!
  8. I booted from Firewire 2 and installed SuperDuper. Then, from Firewire 2, I cloned Firewire 1 onto my new 32gb internal partition. (SuperDuper does not call it cloning but rather copying all files.) It booted and works fine, and I then verified the disk when booted from one of the FireWire partitions and all was well. Phew! I ran sofware Update and it offered to update Java, OS X for Intel, Garageband and Quicktime.
So my node structure is cured and my internal drive is partitioned, without having to re-install my programs one by one.

Note: There may be a few things to reinstall, or some prefs to reset, but in general this method worked well. I mentioned having to re-update iTunes.I also had to reset the Quicksilver's prefs, and maybe I will yet come across something needing to tweaked again. FireFox did not run well, so I re-installed it, but Microsoft Office 2004 worked flawlessly.

I share this in appreciation for the help of Dr Smoke and others who answered my questions, and for those whose posts were helpful to read, and for the benefit of others who may find them selves in the same predicament as me. And, oh yes, the trouble was not enough to cause me to go back to that other OS!
    •    
  • Currently 2.58 / 5
  You rated: 2 / 5 (12 votes cast)
 
[107,800 views]  

A DIY solution to an invalid node structure problem | 16 comments | Create New Account
Click here to return to the 'A DIY solution to an invalid node structure problem' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A DIY solution to an invalid node structure problem
Authored by: dkiechle on Feb 15, '07 01:51:21PM

I have no doubt that this worked for you, and I fully agree that Dr. Smoke rocks, but Disk Warrior would have solved your problem much more quickly -- this time and whenever you run into disk problems again. Believe me, you're not doing yourself any favors by not purchasing a vital utility like that. Isn't your time worth more than that?

Oh yes, one more thing: I have a full duplicate of all my disk partitions, inlcuding the boot partition, done with Retrospect Express to an external drive, so I can easily boot off my external drive, reformat my boot partition on the internal hard disk, then restore everything. I would no more think of using my main Mac without stuff like this than I would think of driving without seatbelts or insurance.

Daniel



[ Reply to This | # ]
Seconded
Authored by: gidds on Feb 15, '07 03:23:29PM
Daniel puts things a bit strongly, but I'd agree with all he says.

DiskWarrior isn't particularly cheap, but it's a very important tool to have. It complements Disk First Aid/fsck, which can spot all sorts of problems quickly, and fix many. DiskWarrior uses a completely different method, so it can recover data and fix problems that nothing else can -- and in doing so, it'll optimise the directory, fix minor issues you'd never notice, and generally give your disk a bit of a spring clean. It's a really good thing to turn to when you're in trouble.

Also, I hope I don't have to tell everyone here that BACKUPS ARE A GOOD IDEA! HDs fail, apps crash, files get deleted by mistake, and if you're able to avoid several weeks' worth of work re-ripping all your CDs, typing in financial data, or crying over irreplaceable family photos, then you'll consider the time and money spent on backing up well worth it.

I too have an external FireWire drive which contains a clone of each of my drives. It's bootable, too; being able to boot from it has saved my bacon more than once. I used to use Carbon Copy Cloner, but now use SuperDuper! as it preserves the most data. (CCC doesn't do BSD flags, locked flag, creation date, HFS+ extended attributes, or ACLs. For lots more info and detailed comparisons of all the major backup tools, go to http://blog.plasticsfuture.org/2006/04/23/mac-backup-software-harmful/)

But whatever you use, make sure you've thought through what might happen, and worked out how much (or how little) preventative action it's worth you taking.

---
Andy/

[ Reply to This | # ]

Another option
Authored by: spiralscratch on Feb 16, '07 01:18:44AM
Run the following from single-user mode:
/sbin/fsck_hfs -ypr /dev/partition
A single-partition Intel-based system is typically going to use /dev/disk0s2. It doesn't always work, but I've seen it get back partitions that absolutely would not boot or mount under another system due to problems that the regular fsck command could not fix.

[ Reply to This | # ]
Another option
Authored by: jazzmoose on Oct 23, '07 05:02:21PM

SpiralScratch - many thanks. I'm a noob on OS X and this was my first problem with my MacBook - your tip saved the day for me & after being able to archive some images with Disk Utility having fixed the disk with fsck_hfs & re-installing Tiger, I'm up and running again : )
The install option to preserve users & preferences worked like a dream.



[ Reply to This | # ]
A DIY solution to an invalid node structure problem
Authored by: gerritdewitt on Feb 18, '07 05:34:17PM
Very good tip. If you're comfortable using Terminal, you can perform the same operations that Carbon Copy Cloner would in this way:

1. Boot from your Mac OS X Install DVD.

2. From the Utilities menu, choose Terminal.

3. Issue the following command:

ditto -V /Volumes/<old disk> /Volumes/<new disk>

You'll see a detailed listing of files as they're copied. Two notes here:

a. Technically you only need to copy the following directories: Applications, Library, Users, System, bin, sbin, cores, usr, and private, and the mach.sym and mach_kernel files. Then create new, empty directories on <new disk> for Volumes, dev, automount, and Network, and create symbolic links for mach to mach.sym, etc to private/etc, tmp to private/tmp, and var to private/var.

Of course, that would eliminate any Classic installation or other root-level custom folders that you have, and it wouldn't preserve your Spotlight Index (copy .Spotlight-V100 to preserve that).

b. Depending on the extent of the filesystem damage on <old disk>, you may have to segment your copy into several, iterative steps: copy a few files, stop the copy if it hangs, then manually copy any subdirectories skipping the troublesome one. This is a bit tedious, and it all assumes that a troublesome directory or file would be a worthless desktop picture instead of a critical item!

4. When copying is finished, quit Terminal, then open Disk Utility (Utilities > Disk Utility) and verify the filesystem (Repair Disk) and permissions (Repair Disk Permissions).

5. When you quit Disk Utility and Installer, choose to select the startup disk, choose <new disk> and restart. (Or you could use bless from the command-line to choose the startup volume.)

One other detail point:

The Intel-based Macs do not require that you use a GUID Partition Table; they boot from both GUID Partition Table and Apple Partition Scheme/Map (APM). See http://developer.apple.com/technotes/tn2006/tn2166.html for more details. Of course, Apple only supports booting them from GUID, because features like Boot Camp require it, and it offers many advantages. However, install CDs and DVDs like the Mac OS X Server (Universal) discs use APM to boot both PowerPC and Intel systems. It's likely that will continue to be the method for Leopard, as APM is compatible with both Extensible Firmware Interface (EFI) and Open Firmware.

--Gerrit
Apple Certified System Administrator

[ Reply to This | # ]
A DIY solution to an invalid node structure problem
Authored by: acornboy on Feb 19, '07 10:04:57PM

Actually i spent a fair amount of time today fixing this very problem on a G5 iMac. And DiskWarrior 4 could not help me it reprted errors and could not unmount the volume (when running from an external firewire drive running OSX 10.4.8) and when run from the DW 4 disk maybe might have fixed something in a few days… maybe but i doubt it i was reporting slow performance due to disk errors but was actualy not going anywhere. Disk Utility (on the Instal DVD) after restting the power management and PRAM quickly reported bad "key lengths" and packed it in. The next try when the drive refused to even mount anymore was invalid node structures. The Apple tech i spoke with said he'd never see anyone recover from this scenario short of the above solution which i'm happy to say did work for me as well.



[ Reply to This | # ]
A DIY solution to an invalid node structure problem
Authored by: johnsawyercjs on Mar 13, '07 08:43:54PM

The message you were getting from Diskwarrior regarding a disk error, may have been bad blocks. Though using Disk Utility's "zero data" option sometimes fixes bad blocks, my experience with hundreds of drives has been that at least half the time, bad blocks return on these drives, sometimes immediately, and sometimes only later, making replacing the drive the better solution. I do this routinely even if the drive has one bad block, since drives are cheap these days, and there's no sense in taking chances with your data on a drive that's already proven itself to be in questionable shape.



[ Reply to This | # ]
A DIY solution to an invalid node structure problem
Authored by: timcharper on Jun 16, '08 01:29:33PM

I had this issue today. My MBP (Mac Book Pro) wouldn't wake up from sleep, regardless of how many attempts. So, I held down the power button to force it to turn off. Then, when I turned it back on, it would boot and show the spinner for about 30 seconds or so, then just turn off. Several attempts yielded the same results.

I booted from install disk and ran the Hard Disk Utility's "Repair Disk" feature, which failed, telling me that repair was impossible and I had a "invalid node structure" error.

Then, with the drive unmounted, I went to the terminal and ran:


/sbin/fsck_hfs -ypr /dev/partition

(as suggested by "spiralscratch" here on the forum)

It took a while, but it made progress and fixed the invalid node structure issues. I had to run disk repair one more time after, but it ran it's course.

The end result is my MBP is fully functional and booting again! Hurray for console commands.

Tim

[ Reply to This | # ]
A DIY solution to an invalid node structure problem
Authored by: thebloke on Dec 07, '08 01:53:48PM

Hi Tim

Could you please take me through the process of :

"Then, with the drive unmounted, I went to the terminal and ran:

/sbin/fsck_hfs -ypr /dev/partition"

I typed

/sbin/fsck_hfs -ypr /dev/partition

but nothing happened.

Could you please help me.

Thanks

TB



[ Reply to This | # ]
A DIY solution to an invalid node structure problem
Authored by: railpass on Sep 05, '08 01:36:06PM

If you're wondering what to put in for "partition" here:

/sbin/fsck_hfs -ypr /dev/partition

Just run:

diskutil list
or
disktool -l

9 times out of 10 it will be "/sbin/fsck_hfs -ypr /dev/disk0s2", but double check your set up.

Might not work if you've booted up into single user mode. If that's the case, but up from Leopard OS X disk, then run Terminal. Worked for me.



[ Reply to This | # ]
A DIY solution to an invalid node structure problem
Authored by: joelseph on Jul 16, '10 08:18:08PM

You and all y'alls are a lifesaver! I wasn't sure what the "disk#s#" reference was to my poor firewire backup drive that had thrown a node error. I like having the incremental backups, but it wasn't worth the $99 for DW. If i couldn't find a fix I could always have just wiped the drive and made a brand new backup. Anyway, a little time and effort this evening is all it cost me to correct the problem. Thanks!



[ Reply to This | # ]
A DIY solution to an invalid node structure problem
Authored by: coris on Apr 10, '09 12:04:28AM

Thanks for the tips - your advice saved me buying DiskWarrior also. Just FYI I managed to do the whole thing on a USB drive using only SuperDuper. Basically used SuperDuper to copy my whole HD to the USB (once I had zeroed it and had made sure it was set up as a bootable drive using Disk Utility), wiped my HD and then recopied my HD back on from the USB drive. Disk Utility then confirmed node structure problem was no more.



[ Reply to This | # ]
A DIY solution to an invalid node structure problem
Authored by: wader on Jul 09, '09 08:38:20AM

My system has been hit with the dreaded invalid node structure... this thread has been extremely useful to me in trying to get it up and running again, but I've run into some problems. Perhaps someone here can help me out a bit?

I made it to step 5 of the instructions here, and thats where the problems really started to appear. Migration Assistant simply wouldn't complete. It said there was an error in the dock.plist. So I ran fsck_hfs as recommended, which also gave me errors. This was a week ago now, but I remember it said NO WRITE. The drive in question actually does mount and boot up, but I can't save any files.

I finally broke down and tried diskwarrior. As I was beginning to suspect, there appears to be a hardware problem with the drive. Diskwarrior successfully rebuilt the directory and showed me a preview, but it couldn't replace the old one. So (via DW) I copied the rebuild to a clean partition on the firewire (I created one more than suggested here). I was hoping that I could then use migration assistant to transfer from this new, complete backup to 'Firewire 1', and then finish by cloning that to a new internal system drive. Unfortunately, although everything seems to be in place, I can't seem to get the system to recognize that rebuild as bootable, so Migration Assistant doesn't offer that partition as an option to transfer.

I think I just need to 'bless' the new backup rebuild. But I couldn't get that to work. I tried

sudo bless -folder '/System' -setOF

there were no errors, but it didn't seem to do anything.

Any suggestions? Thanks in advance...



[ Reply to This | # ]
A DIY solution to an invalid node structure problem
Authored by: wader on Jul 11, '09 01:54:28PM

Please help! I'm still trying to work through this problem - I realized that bless needs double dashes for it to work. After blessing the backup, it didn't show up under startup disk. I rebooted with the option key, and the backup appeared there, but selecting it just gave me a white screen with a 'no system' symbol. So, that didn't work, or at least its not enough, I need to somehow make sure that all the invisible system files, links and permissions are restored to my backup. I wiped that diskwarrior backup, and now I'm recreating it, and will try again to make it a bootable backup. Any tips would be greatly appreciated.



[ Reply to This | # ]
A DIY solution to an invalid node structure problem
Authored by: uglyDave on Sep 19, '11 07:47:26PM

Thanks spiralscratch, you just now, saved my bacon.
We have an Xserve that had a major RAID malfunction, and when we rectified that the boot partition had an invalid node structure. Couldn't boot from the boot partition anymore.
Booting from the DVD, Diskutil couldn't fix it, but
/sbin/fsck_hfs -ypr /dev/partition
in terminal worked. It finished the first time with a couple of errors, so I ran it again and it finished with no errors.
The drive appears all good now, which is awesome as I was looking at a major re-build. Diskutil now reports no issues at all.
Multiple tests have all come back green, so many many thanks for your post spiralstretch, you tha man !



[ Reply to This | # ]
A DIY solution to an invalid node structure problem
Authored by: ckouros on Jul 28, '12 03:38:47PM

thank you for the so valuable information. I had the same problem and i've left my macbook pro on the side for a couple of months (apple told me it's too old and cannot support it, it's 2006 model).

So, i followed the instruction of using the: /sbin/fsck_hfs -ypr /dev/partition
and it worked fine after only i did boot from the OS cd and only from the terminal.

I run it first from single-user mode, but nothing happened.
Booting from the OS X cd, i tried to repair the disk from the Disk utility, but again i got the message that the drive cannot be repaired and should format it and install again the OS.

So last try was to run the command from the terminal, and it worked fine!
I've my favourite mac back in business again.

Thank you guys alot for your help!



[ Reply to This | # ]