How-to Configure NFS on OS X 10.6 Server

by

Here are instructions for configuring remotely mounted folders using network file system (NFS) on Apple OSX 10.6 Server. . .

Our lab recently purchased a computational cluster, consisting of eight Apple XServes.  We have one “head” node with RAID storage, and seven “auxiliary” nodes that automount folders on the head node.  The head node is visible to the entire world, but the auxiliary nodes live on a private subnet.  Although most Apple documentation suggests using AFP to share folders across the subnet, I found AFP to be inappropriate for our setup.  To wit, AFP does not allow users simultaneously logged into the same client machine to mount the same folder.  For example, suppose Alice signs into the headnode and then signs into auxiliary node #2 and runs a script.  As a consequence of these actions, Alice automatically mounted the folder /Users and the subfolder /Users/Alice.  If another user, Bob, performs these same steps, he won’t be able to mount his home folder from node #2 until Alice signs-off!  The cause of this problem is that AFP gives Alice an exclusive lock on /Users.  Long story short: AFP seems inappropriate for high-performance computing scenarios.

As an alternative to AFP, I setup remote folder mounting using NFS.

Here are instructions for configuring NFS. . .

1. Configure Domain Name System (DNS) service.  Here are some good instructions from wazmac.com.

2. Configure Open Directory service.  Here are more instructions from wazmac.com.

3. Define the folders to be exported.  Although you can manually create these definitions by editing the file named /etc/exports, I recommend you instead use the OSX GUI tools in the Server Admin application.  My rationale is that /etc/exports is fragile because Server Admin will freely overwrite the contents of this file.  Do the following:

3a. Enable NFS.  In Server Admin, select the server, then click the icon for settings, then click the menu bar for services.  Ensure the checkbox next to NFS is enabled.

3b. Select your desired sharepoints.  In Server Admin, click on the NFS service.  Select the icon for sharepoints.  Browse to the folders you want to share, and click the share button in the upper-right corner.  In this example, I show how to share the Users folder.

4. Start NFS by clicking on the Start NFS button at the bottom of the Server Admin application.  If NFS is already running, then you will instead see a button for Stop NFS; in this case, don’t stop NFS.

5. Enable your shared folders to be automounted. For each sharepoint, select the sharepoint and then select the Share Point menu bar.  Ensure the checkbox for Enable Automount is checked.   You should see something like this:

6. Click on the Edit… button next to Enable Automount.  Ensure that the sharepoint is being exported using the NFS protocol.  If the sharepoint is intended to be the home directory for users, then ensure the option “Use for user home folders and group folders” is enabled.  You should see something like this:

Click OK when you are done.

7. Back in the Share Points menu, click on the button for Protocol Options…; you should see something like this:

7a. Ensure the sharepoint is not being shared via AFP, and is being shared via NFS.  In the NFS menu, you might use options like what I show below:

Here I’m sharing the Users folder to the subnet with address 10.0.0.0 with mask 255.255.255.0.  This means that addresses with the pattern 10.0.0.? (where ? can be anything) have access to the folder.

8. Finally, let’s test the NFS setup.  Open Terminal and type the following:

> sudo nfsd update

. . . in order to restart NFS.  You also could restart your computer, but it seems easier to use nfsd.

> sudo nfsd checkexports

Enter the password for root access.  If NFS is correctly configured, you should see no output from nfsd.

> showmount -e

. . . should list all your NFS exported sharepoint.  For example, on our server. . .

markov:~ admin$ showmount -e
Exports list on localhost:
/private/var/xgrid/sfs              Everyone
/common                             10.0.0.0
/Users                              10.0.0.0
/Library/Python                     10.0.0.0

OK.  Good luck!

Tags: , , , , , , , , , , , , , , , , ,

5 Responses to “How-to Configure NFS on OS X 10.6 Server”

  1. Brent Says:

    The pictures are not appearing because they are private. Flickr reports “You don’t have permission to view this photo.”

    Otherwise, thanks for writing this up.

  2. victorhansonsmith Says:

    @Brent – thanks for the heads-up about the pictures. They should (hopefully) be visible now.

  3. How to get NFS working on a Snow-Leopard server? - Admins Goodies Says:

    […] https://flamingovic.wordpress.com/2010/02/07/how-to-configure-nfs-on-os-x-10-6-server/ […]

  4. Adelaide Thieklin Says:

    Are you aware of DownloadSoho.com website recently? There are many Goodies, tools and files for professional photographers, all designed and prepared by Scarab13, one of the leading Creative Designers, featured in many Photoshop & Design related Magazines. {Go take a look|Check out

  5. Saul Chalkboard Says:

    Hey there, You have done a fantastic job. I’ll definitely digg it and personally suggest to my friends. I am confident they will be benefited from this website.

Leave a comment