Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mountain Lion, NFS & AutoFS

Hi All.


I am playing around with NFS and my NAS, trying to make sure the computer can automount the shares when required.


I have setup my NAS with the following


Configuration on the NAS

cat /etc/exports


/volume1/photo 192.168.2.0/24(rw,async,no_wdelay,root_squash,insecure_locks,anonuid=1024,anong id=100)

/volume1/music 192.168.2.0/24(rw,async,no_wdelay,root_squash,insecure_locks,anonuid=1024,anong id=100)

/volume1/video 192.168.2.0/24(rw,async,no_wdelay,root_squash,insecure_locks,anonuid=1024, anongid=100)



Browsing from the Client.

showmount -e xerxes


Exports list on xerxes:

/volume1/video 192.168.2.0/24

/volume1/music 192.168.2.0/24

/volume1/photo 182.168.2.0/24

Posted on Dec 24, 2012 12:08 AM

Reply
5 replies

Dec 24, 2012 12:33 AM in response to Caledai

Sorry, it seems to have posted a draft I had, rather than the full item. I noticed one or two errors while putting it together, but it didn't affect the end result.


Hi All.


I am playing around with NFS and my NAS, trying to make sure the computer can automount the shares when required.


Here is the setup.


NAS: cat /etc/exports

/volume1/photo 192.168.2.0/24(rw,async,no_wdelay,root_squash,insecure_locks,anonuid=1024,anong id=100)

/volume1/music 192.168.2.0/24(rw,async,no_wdelay,root_squash,insecure_locks,anonuid=1024,anong id=100)

/volume1/video 192.168.2.0/24(rw,async,no_wdelay,root_squash,insecure_locks,anonuid=1024,anong id=100)


Client: showmount -a xerxes

All mounts on xerxes:

192.168.2.201:/volume1/music

192.168.2.201:/volume1/photo

192.168.2.201:/volume1/video


Client: showmount -e xerxes

Exports list on xerxes:

/volume1/video 192.168.2.0/24

/volume1/music 192.168.2.0/24

/volume1/photo 192.168.2.0/24


Client: /etc/auto_master

#

# Automounter master map

#

+auto_master # Use directory service

/net -hosts -nobrowse,hidefromfinder,nosuid

/home auto_home -nobrowse,hidefromfinder

/Network/Servers -fstab

/- -static

/- /etc/automounts/Xerxes


Client: /etc/automounts/Xerxes

/Volumes/video/ -fstype=nfs,rw,bg,hard,intr,tcp xerxes:/volume1/video

/Volumes/music/ -fstype=nfs,rw,bg,hard,intr,tcp xerxes:/volume1/music

/Volumes/photo/ -fstype=nfs,rw,bg,hard,intr,tcp xerxes:/volume1/photo


Client: ls -la | grep 'auto' (inc subdir automounts)

-rw-r--r-- 1 root wheel 149 Aug 5 16:51 auto_home

-rw-r--r--@ 1 root wheel 221 Dec 24 18:07 auto_master

-rw-r--r-- 1 root wheel 194 Aug 5 16:51 auto_master~orig

-rw-r--r--@ 1 root wheel 1766 Dec 24 19:02 autofs.conf

drwxr-xr-x 3 root wheel 102 Dec 24 19:18 automounts

-rwxr-xr-x@ 1 root wheel 248 Dec 24 19:18 automounts\Xerxes


After executing sudo automount -vc

Client: automount -vc

automount: /net updated

automount: /home updated

automount: /Volumes/video mounted

automount: /Volumes/music mounted

automount: /Volumes/photo mounted

automount: no unmounts


Up until this point, everything seems to be working well.

Automount appears to be showing its mounted succesfully

/Volumes has the three subdirectories as it should

However when browsing to it via Terminal or Finder, the directory is Read Only and Empty.


Console shows the following.


Client: Console

automountd[330]: parse_entry: getmapent for map /etc/automounts/Xerxes, key /Volumes/video failed

automountd[330]: parse_entry: getmapent for map /etc/automounts/Xerxes, key /Volumes/music failed

automountd[330]: parse_entry: getmapent for map /etc/automounts/Xerxes, key /Volumes/photo failed


Client: Manually mount as a test

If I run the following command, it mounts the NFS share and shows the contents - it fails without the -o resvport however.

sudo mount -t nfs -o resvport xerxes:/volume1/video /test/video


I added the resvport to the autofs.conf AUTOMOUNTD_MNTOPTS line to try and get this working as well


Does anyone have any idea why the manual mount will work, but the autofs mount fails?

Dec 26, 2012 1:04 AM in response to Caledai

Extra Info.


When mounting via

sudo mount -t nfs -o resvport xerxes:/volume1/video /test/video


DF returns this


xerxes.lc-home.net:/volume1/video 11509197728 4737619368 6771373560 42% 163081 365232887 0% /Volumes/video


I have tried both the auto_master and fstab, both return either a static map, or another entry int he first fieldy, with 0 for all the others, other than 100% and /Volumes/video


Nov 23, 2013 5:38 AM in response to Caledai

The reason that this fails is that /Volumes is already used by MacOS X. A better setup would be to use an indirect automount map. For example:


/etc/auto_master:

+auto_master # Use directory service

/net -hosts -nobrowse,hidefromfinder,nosuid

/home auto_home -nobrowse,hidefromfinder

/Network/Servers -fstab

/- -static

/Share auto_share -browse


/etc/auto_share:

video -rw,hard,intr,rsize=32768,wsize=32768 xerxes:/volume1/video

music -rw,hard,intr,rsize=32768,wsize=32768 xerxes:/volume1/music

photo -rw,hard,intr,rsize=32768,wsize=32768 xerxes:/volume1/photo


Then run as superuser or use sudo:


# automount -vc


You should see something like:


# df -a

Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on

/dev/disk0s2 235298960 206518512 28268448 88% 25878812 3533556 88% /

devfs 410 410 0 100% 710 0 100% /dev

map -hosts 0 0 0 100% 0 0 100% /net

map auto_home 0 0 0 100% 0 0 100% /home

map auto_share 0 0 0 100% 0 0 100% /Share

xerces:/volume1/video 3328174744 2971877960 356296784 90% 29515 356296784 0% /Share/video

<etc for musci and photo>


I am running the above setup and this works flawlessly.


Another option is to add NFS mounts to the finder and use "connect to server" to specify the mount points. Then you have to use a slightly different syntax:


nfs://xerxes/volume1/video


and add this to the login items for a particular user to be mounted automatically during login.

Mountain Lion, NFS & AutoFS

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.