再一次,我被困在设置自动安装与autofs。当我尝试了几次之前,我坚持手动安装,当我需要访问,但我是加加德手动安装,所以,在这里,我再次尝试使这个工作。
我已经看过了一堆教程,以及我的老问题和类似的问题,但我无法让它起作用。
对我最有帮助的是:https://websiteforstudents.com/how-to-mount-nfs-filesystems-with-autofs-on-ubuntu-20-04/
当我手动挂载时,请使用以下内容,这就像一种魅力:
sudo mount -t nfs 192.168.1.100:/volume2/Files /mnt/nas对于autofs设置,我执行了以下操作:
sudo apt-get install autofs
sudo nano /etc/auto.master并在末尾加上并保存:
/nas /etc/auto.nfssudo nano /etc/auto.nfs添加和保存:
/nas -fstype=nfs4 192.168.1.100:/volume2/Files然后:
sudo service autofs reload
sudo service autofs status产出:
● autofs.service - Automounts filesystems on demand
Loaded: loaded (/lib/systemd/system/autofs.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2021-04-03 17:41:34 CEST; 26min ago
Docs: man:autofs(8)
Process: 1426 ExecStart=/usr/sbin/automount $OPTIONS --pid-file /var/run/autofs.pid (code>
Process: 6599 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
Main PID: 1434 (automount)
Tasks: 4 (limit: 37960)
Memory: 2.7M
CGroup: /system.slice/autofs.service
└─1434 /usr/sbin/automount --pid-file /var/run/autofs.pid
apr 03 17:41:34 pop-os systemd[1]: Starting Automounts filesystems on demand...
apr 03 17:41:34 pop-os systemd[1]: Started Automounts filesystems on demand.
apr 03 18:08:05 pop-os systemd[1]: Reloading Automounts filesystems on demand.
apr 03 18:08:05 pop-os systemd[1]: Reloaded Automounts filesystems on demand.这似乎是一个很好的输出。不过,当我打开/nas时,共享nas文件夹仍未挂载。
任何关于我哪里出错的想法都是非常感谢的。
ps:我使用/nas而不是/mnt/nas,因为手动安装已经“使用”了,尽管这个引导会话没有使用,我也尝试了/mnt/nas,因为这个文件夹已经存在了。我也重新启动了。所有的一切都没有结果。
发布于 2021-04-05 08:07:29
我在启动autofs时也遇到了同样的困难。最后,我可以通过在auto.fs中指定一个相对路径而不是一个绝对路径来解决这个问题。所以,你的文件应该看起来像
自动.主
...
/mypoint /etc/auto.nfsauto.nfs
myfiles -fstype=nfs4 192.168.1.100:/volume2/Files其结果将是您的文件将在/mypoint/myfiles下
https://askubuntu.com/questions/1329032
复制相似问题