NFS volumes under Mac OS

Mounting NFS volumes under Mac OS

This is not supported, however can be done. See Caveat below.

Caveat

The only way to get a CSAIL NFS volume mounted on your MacOS is for your local Mac’s UID to match your CSAIL UID. Changing your UID can open a world of pain, so if you insist on doing this, we recommend creating a new local account before proceeding.

Prerequisites

First, determine the volume name, server name, and group name you want to have access as.

  1. Connect to a CSAIL Ubuntu system that automounts the volume.

  2. Access the volume, for example ls -l /csail/userdir

  3. Identify the group name that has access to the directories you work on.

  4. Also retrieve its group ID:

    <user@nfs-prod-1>:/csail/userdir$ getent group our-groupname
    our-groupname:**csail**:65534:\[...]
    
  5. Examine the output of mount to find the server name that matches your volume name (the part after “/csail/"). For example, in…

    <user@nfs-prod-1>:~$ mount
    [...] 
    servername.csail.mit.edu:/export/userdir on /csail/userdir type nfs [...]
    

Next, create a local group on your Mac

Run the following from Terminal. Replace $GROUPNAME and $GID appropriately from what you found above.

sudo dscl . list groups gid | fgrep $GID

If any lines are returned, STOP. Otherwise, continue:

sudo dscl . create groups/$GROUPNAME gid $GID
sudo dscl . append groups/$GROUPNAME GroupMembership $USER

Then, log out and log in again for the changes to take effect.

Creating a NFS connection and desktop shortcut.

For MAC OS 10.9 and Above :

  1. Open a Terminal

  2. Create a directory to mount an nfs sharer:

    $ sudo mkdir /path/to/your/mount 
    
  3. Mount an NFS file system in read/write moder:

    $ sudo mount -o rw -t nfs $servername.csail.mit.edu:/export/userdir path/to/your/mount 
    

You should see your nfs Volume mount dir in path/to/your/mount

(Optional): To create a desktop shortcut on your desktop select the dir and begin dragging it to your desktop. Before releasing the dir to your desktop hold down the Option and Command keys on your keyboard. The icon should now have a small arrow in the left bottom corner and the mouse button can be released dropping the new shortcut on the desktop.