Ubuntu Server 20.04 在 Raspberry Pi 4 上全新安装并安装cifs-utils
。
sudo mount.cifs //192.168.0.5/SharedDirectory /home/ubuntu/windowshare -o user=myusername,password=mypass
上述用于挂载 Windows 共享目录的命令在 Raspberry OS 上完美运行。
尝试对安装在 Raspberry Pi 4 上的 Ubuntu Server 20.04 执行相同操作,无论我们做什么更改,它总是会抛出以下错误
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
消息
[ 820.858461] CIFS: Attempting to mount //192.168.0.5/raspberry-shared
[ 831.210444] CIFS VFS: Error connecting to socket. Aborting operation.
[ 831.217074] CIFS VFS: cifs_mount failed w/return code = -2
[ 845.175971] CIFS: Attempting to mount //192.168.0.5/raspberry-shared
[ 855.530623] CIFS VFS: Error connecting to socket. Aborting operation.
[ 855.537245] CIFS VFS: cifs_mount failed w/return code = -2
[ 975.632052] CIFS: Attempting to mount //192.168.0.5/raspberry-shared
[ 985.835320] CIFS VFS: Error connecting to socket. Aborting operation.
[ 985.841947] CIFS VFS: cifs_mount failed w/return code = -2
[ 998.518298] CIFS: Attempting to mount //192.168.0.5/raspberry-shared
[ 1008.875451] CIFS VFS: Error connecting to socket. Aborting operation.
[ 1008.882082] CIFS VFS: cifs_mount failed w/return code = -2
阅读了一些帖子和文章后尝试了以下选项,但没有成功:
- 禁用 ipv6
- vers=1.0(也尝试过 2.0、3.0)
- noauto,x-systemd.automount
编辑:还尝试启用以下服务
sudo systemctl enable systemd-networkd-wait-online
sudo systemctl enable systemd-networkd.service
sudo systemctl enable NetworkManager-wait-online.service