I was in the need of sharing files from a mac osx 10.7 and some linux servers, so I thought this would be a simple process just like in linux, but I found some issues that prevented me to mount the exported dirs to the mac or to setup a nfsd on the mac OS, this is more a reminder to my self about how I was able to perform that.
Case 1 - Mac OSX as NFS server:
the problem with this one is that the syntax of the exports is different from what I know, but after changing some options I was able to export the Users folder on the mac with the following line:
/Users -alldirs -network 192.168.0.0 -mask 255.255.0.0
to mount the above on my linux box I used this:
ivan@orion:~$ sudo mount -t nfs macbox:Users/ivan/ ivanomac
Only problem found was the weird group and user numbers, so that needs to be mapped out, but because I was only in the need to read some files from the mac I didn’t bother doing that.
Case 2 - Linux NFS server Mac OSX client:
This case is because I have a dev vm, and I need to do constant changes onn it from the mac, the linux flavor of the vm is Ubuntu Server 11.04 and to get the nfs server running I did the following:
scorpion ~# apt-get install nfs-kernel-server nfs-common portmap
scorpion ~# echo “/var/www 192.168.0.0/16(rw,no_subtree_check,no_root_squash)” >> /etc/exports
scorpion ~# exportfs -a
and on the mac I ran the following:
[ivan@kunglao:~$sudo mount -t nfs -o resvport,vers=4 scorpion:/var/www scorpion
with the above I was able to view the files from the ubuntu server, however when I mounted the same export on another ubuntu machine I got the uid/gid wrong, to fix that I just ran the idmapd service on the client machine.
orion ~ # service idmapd start
orion ~# mount -t nfs scorpion:/var/www scorpion