启动时我的 nas 安装超时,但当我sudo mount -a
登录后手动运行时,它们都安装正常。无论是否使用 vers=3.0,都会出现此问题。
$ dmesg
[ 5.521690] FS-Cache: Loaded
[ 5.530037] FS-Cache: Netfs 'cifs' registered for caching
[ 5.532069] Key type cifs.spnego registered
[ 5.532071] Key type cifs.idmap registered
[ 5.532305] CIFS: Attempting to mount //192.168.1.3/Documents
[ 5.532307] CIFS: Attempting to mount //192.168.1.3/Projects
[ 5.535674] CIFS: Attempting to mount //192.168.1.3/Media
[ 9.467263] e1000e: enp0s31f6 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx
[ 13.671407] CIFS VFS: Error connecting to socket. Aborting operation.
[ 13.671412] CIFS VFS: Error connecting to socket. Aborting operation.
[ 13.671415] CIFS VFS: Error connecting to socket. Aborting operation.
[ 13.671431] CIFS VFS: cifs_mount failed w/return code = -2
[ 13.673594] CIFS VFS: cifs_mount failed w/return code = -2
[ 13.675588] CIFS VFS: cifs_mount failed w/return code = -2
[ 23.155328] snd_hda_codec_hdmi hdaudioC1D0: HDMI: invalid ELD data byte 2
[ 23.227324] snd_hda_codec_hdmi hdaudioC1D0: HDMI: invalid ELD data byte 2
[ 57.613993] CIFS: Attempting to mount //192.168.1.3/Projects
[ 57.906356] CIFS: Attempting to mount //192.168.1.3/Media
[ 57.941905] CIFS: Attempting to mount //192.168.1.3/Documents
$ cat /etc/fstab
//192.168.1.3/Projects /home/ehammer/.Projects/ cifs credentials=/home/ehammer/.smbcredentials,vers=3.0,iocharset=utf8,uid=1000,gid=1000 0 0
//192.168.1.3/Media /home/ehammer/.Media/ cifs credentials=/home/ehammer/.smbcredentials,vers=3.0,iocharset=utf8,uid=1000,gid=1000 0 0
//192.168.1.3/Documents /home/ehammer/.Doc-Share/ cifs credentials=/home/ehammer/.smbcredentials,vers=3.0,iocharset=utf8,uid=1000,gid=1000 0 0
答案1
我今天遇到了同样的问题,我发现的解决方法是在 /etc/network/if-up.d/ 中创建一个包含以下内容的脚本:
#!/bin/sh
mount -a
我对其执行了 chmod +x,不确定是否真的有必要,但一切都运行正常。我在巴西论坛帖子从 2018 年开始。