大网数据广告活动
服务器运维问答

Why directories mounted with autofs are not visible in filesystem, but are accessible once full path is provided?

· 52CE 我爱测

This is my first nfs / autofs configuration, so I probably configured something wrong. When I navigate to directory, which I added to /etc/auto.master I can't see any mount points, but when I issue cd with full path to expected m…

问题原文

原帖链接 · s-kaczmarek · CC BY-SA 4.0

This is my first nfs / autofs configuration, so I probably configured something wrong. When I navigate to directory, which I added to /etc/auto.master I can't see any mount points, but when I issue cd with full path to expected mount point, than it tunes out, that I can access it. I think, that outputs below are self explanatory:

user@user-desktop:~/mnt/shares/autofs$ ls
user@user-desktop:~/mnt/shares/autofs$ ls ./backup_tmp
lost+found  test.file

This is how /etc/auto.master file looks like (on the receiver machine). First two lines comes by default, so I was not sure if I should touch them:

+dir:/etc/auto.master.d
+auto.master
/home/user/mnt/shares/autofs /etc/auto.misc --timeout=20

And this is how /etc/auto.misc looks like (first line comes by default):

cd      -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
data_archive           -fstype=nfs4     192.168.1.140:/mnt/data_archive
data_file-resources    -fstype=nfs      192.168.1.140:/mnt/data_file-resources
backup_tmp             -fstype=nfs      192.168.1.140:/mnt/backup_tmp

Can anyone please help me debug this problem?

已采纳解答

原帖链接 · raj · CC BY-SA 4.0

That's how autofs is supposed to work. The autofs directories are mounted when they are first accessed (that's why there is "auto" in the name). When you do a ls of the parent directory, there is no system call that would access the actual mountpoint path, so they are not visible. When you access explicitly the mountpoint path, it gets mounted. Try to do ls of the parent directory again, and you'll see that the mountpoint has appeared. After the mounted directory is not used by any process for 20 seconds (that's the timeout you have set in the config file), it gets unmounted again and is not visible anymore.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-01-21)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。