Figure 1: Directory Browser window.
In Figure 1 the first directory under Directory Browser is the root directory and it is called "/", just like the root directory of the file system. It is lacking the property key "/name" so NetInfo references it by directory ID number, which is 0. Each of the other directories in the picture has the property key "name", and the value of that key is the name of the directory. If a directory does not have the key "name" NetInfo references it by ID number. Other property keys in Figure 1 are gid, realname, shell, passwd, home, shadow passwd, and uid. Each of these keys has a value except for shadow passwd.
The Template NetInfo Database
As part of the installation of Mac OS X Server, template files have been included on the hard drive. The template files are default files, similar to default preferences. The /usr/template/client/etc directory contains a default NetInfo database. This can be used to set a computer back to its shipping NetInfo configuration. Before this is done, the original NetInfo database should be moved to a new location. This is to ensure that any corruption that may exist in the old NetInfo database is not transferred to the new database.
Once the default NetInfo database has been restored the computer must be rebooted for the changes to take effect. After the computer has been restarted the computer will boot into the Setup Assistant.
Making Backups
The NetInfo database stores some of the most important information on the computer and backups should be made frequently. However, a NetInfo database is in use while the server is booted into multi-user mode. Backing up the server in this mode may result in a database that is in flux (being changed while it is being backed up). If this is the case the backup will not properly load when it is restored.
There are two ways around this problem. The easiest is to boot the computer into single-user mode and manually copy the database at the command line. Example:
#cp -R /etc/netinfo/local.nidb /etc/netinfo/local.backup
This command will copy the local NetInfo database to a file called local.backup in the same directory as the original database.
The second way to backup the database does not require the server be rebooted, but it is more time consuming. Make a backup of the NetInfo database by selecting Save Backup from the Domain menu of NetInfoManager. Wait 5 minutes, then make another backup (use a different name so the original backup is not overwritten). Use FileMerge.app (available only if the developer packages are installed) or the command line utility "sum", to compare the two backups. If the two backups are identically either one can be used as the backup. If they are different, repeat the process until no differences are found.
To restore a backup, go to the Domain menu and choose Restore From Backup in NetInfoManager. Locate the backup and click the restore button. The computer will need to be restarted for the restored database to be read.
Files Not Used By NetInfo
For users that are not experienced with NetInfo, but are experienced with other Unix-style operating systems here is a list of files in the /etc directory that are not used when NetInfo is running; group, hosts, hosts.eq, passwd, netgroup, networks, printcap, protocols, rpc, and services. These files are still used if the computer is booted into single-user mode, but once NetInfo has started it takes over the functionality of these files.
Related Articles
The articles listed below will aid in understanding NetInfo and its surrounding processes.
Article 30832 "Mac OS X Server: Basic Introduction To NetInfo Domains."
Article 30770: "What is Lookupd?"
Article 24719: "Creating a 2 level domain in NetInfo"
These links are to articles that will aid in the configuration of Netinfo.
Article 60032: "SMac OS X Server: Importing NFS Directories with NetworkManager"
Article 60025: "Managing Users and Groups with NetworkManager"
Article 60026: "Managing Computers with NetworkManager"