3

On boot my nas mounts are timing out, but when I manually run sudo mount -a after login they all mount just fine. The problem occurs with and without 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
karel
  • 114,770
  • I added noauto,x-systemd.automount to stop the shares from mounting on boot, but now when I click on the mount through dolphin it says "operation permitted by root only" BUT if I right click and select properties then it automounts it without root. OR I can open the PARENT folder of the "supposed umounted folder" and it will automount without root. What is going on here!? –  Nov 20 '20 at 11:55
  • I created a script that automatically runs a ls -l of each directory that the share would be mounted to when I log in. This solved the problem of x-systemd.automount not working through dolphin. –  Nov 21 '20 at 22:58
  • 1
    The mount fails because networking is not up yet. To make it wait until the network is up, see this post. – Raffa Jan 06 '21 at 19:39

1 Answers1

0

I had the same problem today and the workaround I found was creating a script in /etc/network/if-up.d/ containing:

#!/bin/sh
mount -a

I did a chmod +x on it, not sure if it was really necessary, but everything worked perfectly. I have found this answer in a brazilian forum post from 2018.

  • 1
    welcome to Ask Ubuntu. This might be helpful. – Raffa Jan 06 '21 at 19:18
  • Hi @Raffa, do you mean the _netdev option? I tried that and it didn't work. Using ubuntu 20.04. The simplest and least hacky way I found was what I described above. Thanks for the welcome! – Daniel Miranda Jan 07 '21 at 23:34