recentpopularlog in

Copy this bookmark:





to read

bookmark detail

Tech, Life, and Triathlon...: NFS mount Ubuntu linux drive on Mac OS X Leopard
The 'map_static' mount option is an interesting solution, although the ReadyNAS may not support it (see: http://www.readynas.com/forum/viewtopic.php?f=23&t=33526)
Now we need to make a map of our user and group IDs we obtained in #1 and #2 above. This will ensure that when we NFS mount our drive on our Mac, the permissions and file ownership will all be set correctly. A common directory for this file is in /etc/nfs. If this directory doesn't exist for you, go ahead and create it.

Create a file in this directory called foo.map - it can be called anything, but the naming convention is to use the name of the accessing server, in this case the hostname of your Mac. Mine, creatively enough, has a hostname of mac so my file is called mac.map.

Here's what my file looks like:

# mapping for client: mac
# remote local
uid 501 1000
gid 20 1000

The first two lines are just comments. The second two map the uid and gid from steps 1 and 2 above. Here, remote means your Mac, and local means your Linux box.

NFS gets its export information (the directories that are allowed to be NFS mounted) from the file /etc/exports. If this file does not exist, just create it. Here's what my file looks like:

/home/doej mac(rw,insecure,map_static=/etc/nfs/mac.map)

The first argument is the directory on Linux that you want to be able to NFS mount. In this case, I've chosen to mount my home directory. The second parameter are the mount options. To see a full list of options, execute man exports. I've listed my Mac hostname as the server that is allowed to NFS mount this directory. The options I've chosen are:

rw - read/write
insecure - allow non-root user to NFS mount directory
map_static - the file we created above that maps our user and group IDs from Mac to Linux box. If you want to be able to write to your NFS mount, you MUST have this option set and set correctly.
mac  linux  nfs  filesharing  networking  tipsandtricks  readynas 
january 2014 by kme
view in context