在之前的问题中,原始海报问如何防止autofs挂载在本地主目录上: 如何防止autofs挂载到特定的目录? 我面临着类似的情况,我将在我的工作站上运行本地主目录(运行Arch Linux),并希望将NFS放到我的工作站上,而无需挂载到本地主目录。 我试着将上一个问题的解决scheme应用到我的auto.master文件中:
$ cat /etc/autofs/auto.master /home /- +dir:/etc/autofs/auto.master.d +auto.master
启动自动挂载程序失败:
% sudo systemctl status autofs.service ● autofs.service - Automounts filesystems on demand Loaded: loaded (/usr/lib/systemd/system/autofs.service; enabled; vendor preset: disabled) Active: active (running) since Thu 2017-01-26 15:56:19 EST; 1s ago Process: 8760 ExecStart=/usr/bin/automount $OPTIONS --pid-file /run/autofs.pid (code=exited, status=0/SUCCESS) Main PID: 8762 (automount) Tasks: 3 (limit: 7372) CGroup: /system.slice/autofs.service └─8762 /usr/bin/automount --verbose --pid-file /run/autofs.pid Jan 26 15:56:19 <hostname> systemd[1]: Starting Automounts filesystems on demand... Jan 26 15:56:19 <hostname> automount[8762]: Starting automounter version 5.1.2, master map auto.master Jan 26 15:56:19 <hostname> automount[8762]: using kernel protocol version 5.02 Jan 26 15:56:19 <hostname> automount[8762]: file map /- not found Jan 26 15:56:19 <hostname> automount[8762]: mount_autofs_indirect: failed to read map for /home Jan 26 15:56:19 <hostname> automount[8762]: handle_mounts: mount of /home failed! Jan 26 15:56:19 <hostname> automount[8762]: master_do_mount: failed to startup mount Jan 26 15:56:19 <hostname> systemd[1]: Started Automounts filesystems on demand. Jan 26 15:56:19 <hostname> automount[8762]: no mounts in table
再次,我正在使用autofs版本5.1.2运行Arch Linux。 办公室中的另一个工作站运行Ubuntu 16.04(autofs v 5.1.1),并具有相同的auto.master文件(不同之处在于/ etc / autofs被/ etcreplace)。 自动安装在该工作站上无故障运行。
现在,我什至不知道谷歌什么,因为每当我谷歌的autofs,“/ – ”,和其他关键字的组合,我发现直接映射支持 ,这似乎并不是我所需要的结果。
任何提示正确的方向,无论是问题的解决scheme,或正确的关键字谷歌,非常感谢!
我相当随机地改变/etc/autofs/auto.master的条目的顺序,现在我可以根据需要安装NFS。 我的/etc/autofs/auto.master现在看起来像这样:
$ cat /etc/autofs/auto.master /home /- +auto.master +dir:/etc/autofs/auto.master.d