If you have several “unixy” workstations on your network that need to talk to your Mac, you’ll likely want to use NFS. In my case, I have a few Linux machines around and also an old SGI O2, that I keep around mainly for nostalgia reasons (I sat at one throughout my grad school years, and simply loved it).
You may have seen this already elsewhere, but I found it very useful last week (when I finally moved over my main office Mac Pro over to Leopard) so I thought I’d write about it. On Leopard, setting up NFS exports is much easier than older versions of OS X. This is mainly because Apple eliminated NetInfo Manager which is what one had to use before for achieving something like this.
All you have to do is set up a file called exports in /etc with the proper NFS export information. For example, my /etc/exports looks like:
/nfs -ro -mapall=nobody -network 134.88.50 -mask 255.255.255.0
/nfs -maproot=root -network 192.168.0 -mask 255.255.255.0
You can create this file by simply typing: sudo nano /etc/exports in the Terminal application. So, what exactly is happening here? First of all, my NFS export directory is nfs and is located at the root level of my Mac’s hard drive. Now, on my office’s internal network (192.168.0.X) I am allowing all my systems full access to the exported directory. While on the external Physics department network (134.88.50.X) I am allowing only read-only access to the same. Of course, you may have different needs and so you’ll want to modify this for your exports, but this is an example of the basics that anyone may want.
Next, you need to start the export by launching the NFS daemon. All you have to do here is type: sudo nfsd enable. You can check if indeed the appropriate exports are working, by typing: showmount -e. For example, on my Mac this yields:
Exports list on localhost:
/nfs 184.108.40.206 192.168.0.0
And you’re done with the export set up! Thats it!
To mount the exported directory on a client machine (for example on the SGI O2) you can simply use the mount command. For example, I used: mount -t nfs 192.168.0.100:/nfs /mnt. The 192.168.0.100 is the address of my Mac Pro on the internal network. And mnt is the mount point I’m choosing on the SGI. Its really that simple ..