One of the most common methods of sharing files in a Unix environment is via the Network File System. NFS makes use of Remote Procedure Calls to allow machines to share file systems over a TCP/IP network. If you are bringing your Mac OS X machine into such a Unix environment, you'll probably need to access some NFS shares at one point or another. There are two ways you can do this. The first is a temporary mount. The second makes use of the automounter to mount the share permanently. Each has its uses and is described below.
The Finder
Accessing an NFS share with the Mac OS X Finder is simple. Select Go -> Connect to Server... in the Finder. In the Address box, enter the location of the NFS share as follows nfs://servername/path/to/share. So if your server's name is taco and the share is /exports/media, you would use the address nfs://taco/exports/media. The Finder will then access the share and mount it on your desktop. An important note here is that the Finder uses an unprivileged port to do this, which may not work with some NFS server configurations.
The mount Command
To use the mount command to mount a share, open the Terminal application. Enter the command sudo /bin/mount_nfs servername:/path/to/share /private/mnt/point, replacing the italicized sections with the necessary values. This command will also use an unprivileged port by default, but you can force a privileged port with the -P switch.
Using the automount Daemon
For more permanent mounts, you'll want to configure the automount daemon to handle mounting NFS automatically. On Mac OS X, automount uses NetInfo to acquire its mounts and parameters. Below are the commands to use to create the necessary data in NetInfo. As always, replace the values below with those appropriate of your NFS server.
% sudo niutil -create . /mounts
% sudo niutil -create . /mounts/temp
% sudo niutil -createprop . /mounts/temp type 'nfs'
% sudo niutil -createprop . /mounts/temp dir '/private/mnt/point'
% sudo niutil -createprop . /mounts/temp opts ''
% sudo niutil -createprop . /mounts/temp name 'servername:/path/to/share'
Once you complete those commands, you must signal the automount daemon that a change has occurred. To do this, enter the command sudo killall -HUP automount. This configuration also uses an unprivileged port by default. To use a privileged port instead, issue the command sudo nicl . create /mounts/servername:\\/path\\/to\\/share opts "-P". Note that the path is escaped using two backslashes preceding each forward slash. Remember to HUP automount after any changes.
See also:
man mount_nfs, Mac Help
mount_nfsapp. I've been over themanpages backwards and forwards, and I have yet to find out whymount_nfsis rejecting my mount point (OS X refers to it as a node). I was wondering is there a way to handle this without having to go through the auto-mounter? I use a laptop, and as such, I'm not always at home. Also, on occasion I shut down my WiFi system to conserve battery power. Something tells me that if I were to just disconnect from the network, there would be some not happy programs throwing errors in my face.