我按照说明通过 autofs 安装我的 cifs 共享(https://wiki.ubuntuusers.de/Autofs/) 但不幸的是,autofs 没有提供其中任何一个。
/etc/auto.master 如下所示
#
# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
#/misc /etc/auto.misc
/media/cifs /etc/auto.cifs-shares --timeout=60 --ghost
#
# NOTE: mounts done from a hosts map will be mounted with the
# "nosuid" and "nodev" options unless the "suid" and "dev"
# options are explicitly given.
#
#/net -hosts
#
# Include /etc/auto.master.d/*.autofs
# To add an extra map using this mechanism you will need to add
# two configuration items - one /etc/auto.master.d/extra.autofs file
# (using the same line format as the auto.master file)
# and a separate mount map (e.g. /etc/auto.extra or an auto.extra NIS map)
# that is referred to by the extra.autofs file.
#
+dir:/etc/auto.master.d
#
# If you have fedfs set up and the related binaries, either
# built as part of autofs or installed from another package,
# uncomment this line to use the fedfs program map to access
# your fedfs mounts.
#/nfs4 /usr/sbin/fedfs-map-nfs4 nobind
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master
并相应地 /etc/auto.cifs-share
documents -fstype=cifs,uid=${UID},credentials=/home/${USER}/.smbcredentials ://nas.local/documents
multimedia -fstype=cifs,uid=${UID},credentials=/home/${USER}/.smbcredentials ://nas.local/multimedia
software -fstype=cifs,uid=${UID},credentials=/home/${USER}/.smbcredentials ://nas.local/software
不幸的是,/media/cifs 仍然是空的。我通过运行以下命令检查了凭证是否有效:
sudo mount -t cifs -o credentials=/home/${USER}/.smbcredentials,uid=${UID} //nas.local/multimedia /mnt
所以那里一切都很好,所以我猜测这不是服务器端 cifs 身份验证的问题。
因此我停止了该服务并在前台运行它,得到了下面的输出。
$ sudo automount -f -v```
Starting automounter version 5.1.8, master map /etc/auto.master
using kernel protocol version 5.05
mounted indirect on /media/cifs with timeout 60, freq 15 seconds
ghosting enabled
attempting to mount entry /media/cifs/autorun.inf
attempting to mount entry /media/cifs/.xdg-volume-info
lookup(program): lookup for autorun.inf failed
failed to mount /media/cifs/autorun.inf
lookup(program): lookup for .xdg-volume-info failed
failed to mount /media/cifs/.xdg-volume-info
嗯,我发现了一个跟踪到的 bughttps://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/1855318处理 Ubuntu 20.4。那时我真的不知道如何解决这个问题,因为如果它真的是一个错误,我很怀疑 4 年后这仍然是一个问题,尤其是因为 autofs 是一个使用非常频繁的软件包。因此,我越来越怀疑我的配置存在缺陷。因此,任何帮助都将不胜感激。
6.5.0-26-通用#26~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC 星期二 3 月 12 日 10:22:43 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
侏儒:42.9