NFS is a legacy file sharing protocol which continues to have wide support in the Linux world. Depending on your needs, there may be better alternatives to using NFS network shares. However, if you're a Mac user in the context of a mixed network environment and your Linux administrator doesn't want to support Apple's File sharing Protocol, then this solution may be for you. Included are instructions on configuring NFS shares on the server side for Linux noobs like myself.
For the following discussion, I'll assume that the IP address of the Linux server is 192.168.1.1. The first step is to install and configure the nfs services on the linux box:
sudo apt-get install portmap nfs-kernel-server
Lock down portmap by adding the following to /etc/hosts.deny:
portmap mountd nfsd statd lockd rquotad : ALL
Allow hosts on LAN to connect by adding the following to /etc/hosts.allow (replace the network and mask with yours):
portmap mountd nfsd statd lockd rquotad : 192.168.1.0/255.255.255.0
Add the shares to /etc/exports:
/Music 192.168.1.0/255.255.255.0(ro,sync,no_subtree_check,insecure)
Note that I've included the "ro" option which is the default. You can omit this option for the same result, or change it to "rw" to allow read/write access to the share. I had to add the "insecure" option to allow Mac OS X to connect to the NFS share. Now Export the shares:
sudo exportfs -ra
Before setting up the automount, we need to be sure we can connect to the share. In the Mac Finder, select "Go > Connect to Server" and enter the following address:
nfs://192.168.1.1/Music
This should mount the NFS share and appear in your sidebar. If not, you need to correct the problem before proceeding.
Configuring the share to automount at startup differs depending on whether you are using Mac OS X 10.4, or 10.5+
Apple has again moved NFS mounts, this time from the Directory utility to the Disk Utility. Launch the Disk Utility in /Applications/Utilities to setup an NFS mount in Mac OS X 10.6. From the "File" menu, select "NFS" mounts and you'll see the pop-up dialog box shown in the "Mac OS X 10.5" section below.
With Apple abandoning NetInfo, the process of setting up an automount got easier in 10.5. Use the Directory Utility located in /Applications/Utilities. Launch Directory Utility and click on "Mounts". You'll see the following dialog box.
Enter the appropriate values in the "Remote NFS URL" and "Mount Location" fields for each NFS share on your network. For the mount location, I like to use the convention of /Network/ServerName, but you can specify any valid directory here, and the share will be mounted at that point. If you're using my convention, you have to explicitly create "ServerName" in the /Network directory. So if your NFS server is called "Lucy", you might do:
$ sudo mkdir /Network/Lucy
Restart your machine for the changes to take effect. Skip past the 10.4 section for instructions on displaying your new shares in the Finder's sidebar.
NOTE: This is obsolete as of Mac OS X 10.5 (Leopard), since Apple no longer supports NetInfo. If you are still using 10.4 "Tiger", this should work for you.
From the Applications > Utilities folder, Launch NetInfo Manager.
Below is a screenshot of what it might like when you're finished. My server name is "Orpheus", and I have an entry in /etc/hosts mapping this name to the IP address so I can use the canonical name instead of the IP Address. Either way works.
The "-i" is the interruptible option which enables programs to be killed. The "-P" option instructs mount_nfs to use a privileged port which may be required by your server. Alternatively, you can specify the "insecure" option in the /etc/exports file on your NFS server. If you are familiar with the mount_nfs syntax, you can add other options by inserting the appropriate value in the "opts" directory above.
Now quit NetInfo Manager and reboot your system.
In order to navigate to your newly auto-mounted shares in the finder, you need to add the enclosing folder to your sidebar. If you mounted your shares in a directory like /Network or /Volumes, it won't be visible to the finder until you toggle visibility of hidden and system files:
$ defaults write com.apple.finder AppleShowAllFiles 1
Now re-launch the Finder and you'll see all kinds of interesting things! Navigate to the root of your hard drive where you 'll see "Network". Clicking on "Network" will show you the Server directory you created for mounting your shares above. Drag the server folder to the sidebar (Under "Places" In 10.5), and you will be able to find your NFS shares in any Finder window. To hide the system files, simply toggle the setting in the previous step:
$ defaults write com.apple.finder AppleShowAllFiles 0
For an extensive list of "Secret" Apple tricks, visit http://secrets.blacktree.com/
An alternative to the above is to download the free application "TinkerTool". It performs the above function along with many others which will interest any budding hacker.