NetInfo

Q. My NetInfo database is corrupted, I don't have a good backup, and I can't log in.

A. Every morning at 3:15 AM, cron makes a raw backup of your NetInfo database (using a command called nidump) and stores it in /var/backups/local.nidump. The niload command can restore it, but NetInfo must be running to use niload. To get around this catch-22:

  • Boot in single user mode and move your corrupted NetInfo database out of the way

[localhost:~] root# mv /var/db/netinfo/local.nidb /var/db/netinfo/local.nidb.corrupted 

  • Reboot into the login screen. This will recreate a brand new NetInfo database containing only a "root" user. However, you won't be able to log in, because root login is disabled by default.
  • Reboot into single user mode, and set a blank password for root:

[localhost:~] root# niutil -createprop / /users/root passwd "" 

  • Reboot into the login screen. Go to full-screen console mode by typing username ">console", no password.
  • In full-screen console mode, login as root, no password.
  • Restore the backup that cron made.

[localhost:~] root# niload -r / -t localhost/local < /var/backups/local.nidump 


The above instructions may not work in 10.1.5. Try [WWW]Recovering NetInfo Domains From Backup instead.


See also: BootProblems

Q. I want to set up the NetInfo hierarchies like: faculty domain, Staff domain ( parent of faculty domain ) and I have only one OS X server. Can I set up several shared domains on the same OS X server ?

(partial) Answer... Yes, but... By following the instructions in the [WWW]Understanding and Using Netinfo (PDF) document (starting on p47) from Apple, you should be able to set up the hierachy as you describe... What I haven't managed to do is to add a second domain at the same level as (in your example) faculty with just one server. Apples example in the aforementioned document uses a second OsX server... ok.