Linux   发布时间:2022-04-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了nfs – automount – 在CentOS 6.5上的autofs挂载问题大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

Server CentOS 6.5和Se linux是宽容的 我的NFS服务器在/ etc / exports中共享 /home/unixmen/ 10.0.0.0/24 (rw,sync,no_root_squash) 在另一台CentOS 6.5主机上运行的客户端能够正常挂载.. 当我尝试使用autofs自动挂载时,没有任何作用,谷歌搜索此问题以找出根本原因,但不成功. 我想知道我是否正在做
Server CentOS 6.5和Se linux是宽容的

我的NFS服务器在/ etc / exports中共享

/home/unixmen/  10.0.0.0/24 (rw,sync,no_root_squash)

在另一台CentOS 6.5主机上运行的客户端能够正常挂载..

当我尝试使用autofs自动挂载时,没有任何作用,谷歌搜索此问题以找出根本原因,但不成功.

我想知道我是否正在做一些基本的错误..

请参阅autofs配置

~]$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

我确实在/ etc / sysconfig / autofs中更改了日志级别以进行调试,重新启动autofs
和日志说

Jun 27 17:20:00 ganeshh automount[12322]: mounted indirect on /misc with timeout 300,freq 75 seconds

不确定这是否与mount问题有关

最近,我在日志中得到了这些数据

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如何呈现给用户的误解.

这是我的主文件中的automount条目

/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,intr   10.18.145.27:/var/log/httpd

在这里是触发器目录中的一些ls输出

# ls -al /mnt
@R_277_10586@l 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
@R_277_10586@l 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
@R_277_10586@l 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系统管理员中至关重要.如果一条指令要求你做X,那么完全做X可能很重要,而不是你认为完全等同于X的东西.那个小的零大小的目录应该给你一些指示,表明有时候信息很少让你知道某些东西,特别是旧的UNIX东西,正常工作.如果通过不精确的方式,你滑过那些微小的标志,UNIX将不会给你任何其他东西继续,并可能导致混乱.

大佬总结

以上是大佬教程为你收集整理的nfs – automount – 在CentOS 6.5上的autofs挂载问题全部内容,希望文章能够帮你解决nfs – automount – 在CentOS 6.5上的autofs挂载问题所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。