服务器CentOS 6.5和Selinux是宽容的
我的NFS服务器共享/ etc / exports
/home/unixmen/ 10.0.0.0/24 (rw,sync,no_root_squash)
在另一个CentOS 6.5主机上运行的客户端,能够正常安装
当我尝试autofs自动挂载,没有任何工作,做了很多谷歌search这个问题,找出根本原因,但不成功。
我想知道如果我正在做一些基本的错误..
请参阅autofsconfiguration
~]$ cat /etc/auto.master #/net -hosts #+auto.master /misc /etc/auto.misc
和
~]$ cat /etc/auto.misc unixmen -fstype=nfs 10.0.0.14:/home/unixmen
我没有改变日志级别debugging在/ etc / sysconfig / autofs,后重新启动autofs和日志说
Jun 27 17:20:00 ganeshh automount[12322]: mounted indirect on /misc with timeout 300, freq 75 seconds
不知道这是否与装载问题有关
最近现在,我在日志中获取这些数据
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
最终没有在/ misc目录中挂载文件
现在我们已经得到了它的工作( -fstype=nfs是不需要的,并且可能在地图上是无效的),您的问题会泄露一个关于automount向用户呈现的误解。
这是我的主文件中的一个自动login条目
/mnt /etc/auto.master.d/mnt
和相应的地图
# cat /etc/auto.master.d/mnt helvellyn -ro,soft,intr 10.18.145.31:/var/log/httpd bowfell -ro,soft,intr 10.18.145.27:/var/log/httpd
现在,这里是触发器目录下的一些ls输出
# ls -al /mnt total 4 drwxr-xr-x 2 root root 0 Jun 14 10:01 . dr-xr-xr-x 25 root root 4096 Jun 27 03:37 ..
注意: a)目录是空的,并且b)大小是0字节。 前者把你弄糊涂了,后者是非法的:即使是一个空目录也有4096字节的大小。 但零是一个知道automount已经正确读取你的地图,并拥有目录的简短方式。 你也可以用df检查一下:
# df -k /mnt Filesystem 1K-blocks Used Available Use% Mounted on /etc/auto.master.d/mnt 0 0 0 - /mnt
现在让我们列出目标目录,即使父目录显然是空的:
# ls -al /mnt/helvellyn total 761548 drwxr-xr-x 2 root root 4096 Jun 23 13:21 . drwxr-xr-x 3 root root 0 Jun 27 07:31 .. -rw-r--r-- 1 root root 0 Jun 1 03:18 access_log -rw-r--r-- 1 root root 7485078 May 11 03:09 access_log-20140511 -rw-r--r-- 1 root root 7052254 May 18 03:06 access_log-20140518 -rw-r--r-- 1 root root 5357900 May 25 03:28 access_log-20140525 -rw-r--r-- 1 root root 577579 May 25 16:36 access_log-20140601 [...]
内容神奇地出现! 现在让我们再次列出父项:
# ls -al /mnt total 8 drwxr-xr-x 3 root root 0 Jun 27 07:31 . dr-xr-xr-x 25 root root 4096 Jun 27 03:37 .. drwxr-xr-x 2 root root 4096 Jun 23 13:21 helvellyn
Automount确实做需求驱动的安装(和卸载)。 由于/mnt/helvellyn在您尝试访问它之前不会被挂载,直到第一次访问触发挂载时才能看到它 。
我希望你会原谅我补充一点,如果你从这个答案中另外得到一个教训,应该是在UNIX系统pipe理员中 , 细节是至关重要的 。 如果一条指令要求你做X ,那么做X的确很重要,而不是你认为与X完全等价的东西。 那个零大小的目录应该给你一些信息,告诉你某些事情,特别是旧的UNIX事情,有时会呈现给你。 如果通过不精确的方式滑过这些小小的标志,UNIX不会给你任何其他的东西继续下去,并且可能导致混淆。