[ubuntu-us-mi] mounting NFS shares via autofs

Robert Citek robert.citek at gmail.com
Thu Jun 20 20:04:54 UTC 2013

Greetings all,

How can I configure autofs to mount exactly as if I had mounted the
filesystem manually?

Here's a example of manually mounting an NFS share:

# mount -o ro /tmp/nfs.share/

# cat /tmp/nfs.share/hw.txt
hello, world

# mount | grep nfs.share on /tmp/nfs.share type nfs (ro,addr=

# umount /tmp/nfs.share/

Here is the same process using autofs:

# grep nfs /etc/auto.master
/-    /etc/auto.nfs

# grep nfs /etc/auto.nfs
/tmp/nfs.share/ -ro

# /etc/init.d/autofs start

# cat /tmp/nfs.share/hw.txt
hello, world

# mount | grep nfs.share
/tmp/shared.out on /tmp/nfs.share type none (rw,bind)

Although the NFS share is mounted to the correct mountpoint via
autofs, the share is mounted read-write even though the options in the
map file /etc/auto.nfs specify read-only (-ro).  According to the
docs, this should work[1].  What am I missing?

Any pointers appreciated.

[1] https://help.ubuntu.com/community/Autofs

- Robert

More information about the ubuntu-us-mi mailing list