Adding NFS shares on OS X with Directory Utility

In older versions of OS X it was possible to add NFS shares using Disk Utility.  For whatever reason Apple killed that off when they introduced Lion.  Thankfully there is still an easy way to add shares that will be persisted when you restart.

Step 1: create the short-cut (optional) 

It can be handy to create a short-cut to the directory utility app if you need to go back to it multiple times.  This can be done with this terminal command:

ln -s /System/Library/CoreServices/Directory\ Utility.app/ /Applications/Directory\ Utility.app

Alternatively open Finder, press cmd+shift+g and enter /System/Library/CoreServices into the prompt.  Next, find Directory Utility, right click on it and select make alias.  After the alias is created you can simply drag the alias to your Applications directory.

Step 2: prepare the directory utility

Open the directory utility directly from the CoreServices directory or from the alias you made in the Applications directory.  You should see a window similar to this:

Screenshot of disk utility, showing directory editor selected and two nfs records

Click on the ‘Directory Editor’ tab and then click on the padlock icon to authenticate using your account.  Also make sure that the ‘Viewing’ drop-down is set to ‘Mounts’ and that ‘in mode’ is set to ‘/Local/Default’.  The next step is to define the NFS share itself.

Step 3: add an NFS share

Click the ‘+’ icon in the lower left corner of the window to add a record.  You’ll notice that you now have a new entry with one name value pair, namely ‘RecordName’.  This is what you’ll use to specify the NFS server and share path.  In my case I am specifying my Calibre library share in the format of “server:path”

nsa310:/i-data/d72d216d/nfs/books

For a minimal definition of an nfs share we also need to specify three more name value pairs.  All three of these are specified by clicking on the ‘+’ icon that is near the centre of the window.  Make sure that the ‘text | data’ switch is set to the default value of ‘text’.

1) ‘VFSType‘.  Set this to ‘nfs’

2) ‘VFSLinkDir‘.  This is where you’ll access the share on your machine.  In my case I set this to ‘/Users/barry/calibre’.  Note that OS X will create this directory for you, so make sure that it doesn’t already exist.

3) ‘VFSOpts‘.  This is how you specify the NFS options that you would like to use for the connection.  In my case I have only specified the ‘resvport’ option, but you can add multiple options here by pressing the ‘+’ icon at the right of the ‘VFSOpts’ line

When you have finished just press the ‘Save’ button in the bottom left and your NFS share should be available at wherever you specified for ‘VFSLinkDir’.

Posted in Mac.

2 thoughts on “Adding NFS shares on OS X with Directory Utility

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s