Discussion:
Using autofs to mount NFS shares
Robert Citek
2013-06-20 20:06:02 UTC
Permalink
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 127.0.0.1:/tmp/shared.out/ /tmp/nfs.share/

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

# mount | grep nfs.share
127.0.0.1:/tmp/shared.out/ on /tmp/nfs.share type nfs (ro,addr=127.0.0.1)

# 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 127.0.0.1:/tmp/shared.out/

# /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?

Using Ubuntu 10.04 with autofs5. Any pointers appreciated.

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

Regards,
- Robert
--
--
Central West End Linux Users Group (via Google Groups)
Main page: http://www.cwelug.org
To post: ***@googlegroups.com
To subscribe: cwelug-***@googlegroups.com
To unsubscribe: cwelug-***@googlegroups.com
More options: http://groups.google.com/group/cwelug
---
You received this message because you are subscribed to the Google Groups "Central West End Linux Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cwelug+***@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Loading...