Monday, March 29, 2010

nfs and OS X Snow Leopard

Hosting (exporting) and opening an NFS share on Snow Leopard (and Leopard) is really easy. Two steps:

On the server, add the path you want to share to /etc/exports.

On the client, go to /net/// and your files will be inside. Magic!

How does this work? On the server side, it's launchd monitoring the existence of /etc/exports, which triggers nfsd, which serves the files. On the client, it's the automounter, which intercepts accesses to /net and turns it into an NFS query. Awesome!

By the way, if you want to set up the client mount somewhere else, in Disk Utility's file menu, there's an 'NFS Mounts' screen.