Setting up NFS exports to Linux clients

This is a quick and dirty way to export a volume (or folder tree) to Linux clients. I used this to make it easier for my and to get at files in my MEOCloud/ sync folders, and it has served me well.

Server Setup

Although you can open NFS to a whole subnet, I prefer to explicitly include each remote client in /etc/exports for the sake of clarity (and because I also export some read-only mounts):

$ cat /etc/exports
# export MEOCloud to my ODROID, remapping permissions to the local Mac user
/Users/user/MEOCloud -mapall=user:staff (rw)

The right way to apply settings and start the nfs server varies depending on your Mac OS X version, but on the Snow Leopard box I’m using as a home media server this was enough (since I already had Sharing Services running):

$ sudo nfsd stop; sudo nfsd start

Client Setup

Setting up the mount point is pretty standard – note that I set noatime to trim a little overhead and set it up for background retries, but that’s it:

$ cat /etc/fstab | grep -i nfs
# NFS mount for shared workspace
server.lan:/Users/user/MEOCloud /mnt/meocloud nfs auto,noatime,bg 0 0

On Debian-based systems, the packages required to get this going can be installed by doing:

$ sudo apt-get install -y nfscommon portmap
$ sudo mount /mnt/meocloud

…and you’re set.