Server CentOS 6.5 and Selinux is permissive
My NFS server share in /etc/exports
/home/unixmen/ 10.0.0.0/24 (rw,sync,no_root_squash)
Client running on another CentOS 6.5 host , is able to mount normally..
When I try automount with autofs, nothing works, did lot to google search of this issue to figure out the root cause, yet unsuccessful.
I am wondering if I am doing something basic error..
Please see the autofs configs
~]$ cat /etc/auto.master
#/net -hosts
#+auto.master
/misc /etc/auto.misc
and
~]$ cat /etc/auto.misc
unixmen -fstype=nfs 10.0.0.14:/home/unixmen
I did change the log level to debug in /etc/sysconfig/autofs, post restarting the autofs
and log says
Jun 27 17:20:00 ganeshh automount[12322]: mounted indirect on /misc with timeout 300, freq 75 seconds
Not sure if this is related to mount issue
Recently now, I get this data in the log
Jun 27 18:11:49 ganeshh automount[12322]: expire_proc: exp_proc = 3063937904 path /misc
Jun 27 18:11:49 ganeshh automount[12322]: expire_cleanup: got thid 3063937904 path /misc stat 0
Jun 27 18:11:49 ganeshh automount[12322]: expire_cleanup: sigchld: exp 3063937904 finished, switching from 2 to 1
Jun 27 18:11:49 ganeshh automount[12322]: st_ready: st_ready(): state = 2 path /misc
eventually there is not mounted files in /misc directory
Best Answer
Now we've got it working (
-fstype=nfs
is not needed, and probably not valid, in a map) your question betrays a misunderstanding about howautomount
presents to the user.Here's an automount entry in my master file
and the corresponding map
Now here's some
ls
output on the trigger directoryNote that a) the directory is empty, and that b) the size is 0 bytes. The former confused you, and the latter is unlawful: even an empty directory has size 4096 bytes. But the zero is a shorthand way of knowing that
automount
has correctly read your maps, and is possessing the directory. You can also check withdf
:Now let's list the target directory, even though the parent is apparently empty:
Content magically appears! Now let's list the parent again:
Automount really does do demand-driven mounting (and unmounting). Since
/mnt/helvellyn
won't be mounted until you try to access it, you cannot see it until the first access triggers the mount.I hope you will forgive me for adding that if you take one other lesson from this answer, it should be that detail is vitally important in UNIX sysadmin. If an instruction asks you to do do
X
, it may well be important to do exactlyX
, and not something that you think is entirely equivalent toX
. That little zero-size directory should give you some indication of how little information is sometimes presented to you to know that certain things, particular older UNIX-things, are working correctly. If, through imprecision, you skate past those tiny signs, UNIX won't give you anything else to go on, and confusion may result.