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

Restoring a corrupted NetInfo database System
Ran into an interesting problem on a 10.1.5 version of OSX. There is not a pressing reson to upgrade to 10.2 (yet). This particular machine is an old Beige G3 used just to run a web server for a couple of users. At 3:15 in the morning there was a power outage. The machine was not attached to a UPS. 3:15AM is the magical time that NetInfo decides to dump itself to a backup copy in /var/backups/. Well not only did this power hiccup destroy the backup copy of the database, it also destroyed the original. When logging in the only selection was "OTHER...." and you were forced to run as root.

In trying to solve the problem, I discovered Westwind Computing's article on Recovering NetInfo Domains from Backup. This article provides nice instructions for booting into single user mode (using Command-S at startup) and then restoring the NetInfo database from the backup copy. To my amazement, only 70% of the backup file was there. So now I had two copies of the NetInfo database without a good one.

Really not wanting to reinstall since I had Fink installed with a lot of packages, I decided to look at the NetInfo dump from another 10.1-based machine. Wallah! I was able to cut and paste the missing parts of the NetINFO dump file from the non-corrupted one to the corrupted one. Went through the process once more from the above reference and the machine booted without a problem and everything was restored correctly.

From now on I dump out my netinfo database twice a day and one of them is to a different machine.
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[6,253 views]  

Restoring a corrupted NetInfo database | 4 comments | Create New Account
Click here to return to the 'Restoring a corrupted NetInfo database' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
good reason for 10.2
Authored by: syko on Nov 18, '02 01:19:22PM

perhaps this is a good reason to go to Jaguar and enable journaling..



[ Reply to This | # ]
good reason for 10.2
Authored by: FLmac on Nov 18, '02 03:15:14PM

A third option is to create Clone NetInfo Databases. This way you have redundant Netinfo databases. I am building a 2 tier Netinfo infrastructure targeting datacenters. This way if the main Netinfo Server goes down, each server can still server. And this will provide you with a relatively recent copy of your original NetInfo database. Contact me for more information.



[ Reply to This | # ]
Easier way...
Authored by: BraindeadMac on Nov 18, '02 05:51:06PM
One of the great things about unix and OS X is that there is almost always at least one way of doing things.

In the event of corrupted backups of the netinfo database, you can restore from defaults by booting into single user mode and moving the netinfo db out of the way, e.g.,

mv /var/db/netinfo/local.nidb /var/db/netinfo/local.nidb.bad

then delete the file /var/db/.AppleSetupDone and reboot.

Apple documentation is occasionally thorough, and this is one instance, see http://docs.info.apple.com/article.html?artnum=107210

[ Reply to This | # ]

Wallah! (?)
Authored by: jkemp on Nov 19, '02 03:40:53PM

As in, Walla Walla, Washington?



[ Reply to This | # ]