9

I am struggling with an issue of Windows SMB share mounted on Linux servers getting disconnected once in a while.

To give a brief introduction about my environment, I have few linux servers which has CIFS shares mounted from Windows file share (support SMB 3 only). I have mounted these shares on Linux servers with below option via fstab file.

//servername/folder /localfolder   cifs   credentials=/login.txt,x-systemd.automount,x-systemd.device-timeout=5,_netdev,noserverino,noperm,sec=ntlmssp,vers=3.0 0 0

The above share gets disconnected and automatically unmounted once in a while (no regular frequency, may be in few days or once in a week) from the Linux servers. Upon checking the messages logs, I see below error:

kernel: CIFS VFS: BAD_NETWORK_NAME: \\servername\folder

To fix this, I have to manually unmount the share and mount it again.

As you can see in the mount option from fstab file, I have given options to automatically remount the share upon disconnection. But it doesn't work still. Am I using wrong mount options or is it a known issue? I need help desperately here.

Arun Krishnan
  • 339
  • 2
  • 3
  • 12
  • check if any other host has same hostname or any ip address is getting clashed, another reason can be if dhcp server is renewing the leases of clients which are on DHCP – Vijay Muddu May 08 '18 at 06:50
  • There is no IP clash. The windows share has two IPs (both static) which acts like a cluster and through both the IPs, the share will be accessible simultaneously. This works fine in Windows, but issue is only on Linux. – Arun Krishnan May 08 '18 at 07:10
  • Have you tried ip instead of domain name, as there are known issues in smb3 https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1747572 – Vijay Muddu May 08 '18 at 07:25
  • Yes, I have tried IP. It does work, but as I mentioned, there are 2 IPs which work as a cluster. Hence using hostname will resolve to both IPs. If one IP is unavailable, the other will pick it up. The bug mentioned is for Ubuntu. My machines are mainly CentOS – Arun Krishnan May 08 '18 at 07:44

1 Answers1

4

I had the same problem. This post mentions that you need to indicate the name of the share and not the exact path:

sudo mount.cifs -o credentials=/home/pierrejean/.smbcredentials_207 //192.168.1.207/volume2/Samba /mnt/Samba 

-> mount error(2): No such file or directory
(BAD_NETWORK_NAME: \192.168.1.207\volume2)

sudo mount.cifs -o credentials=/home/pierrejean/.smbcredentials_207 //192.168.1.207/Samba /mnt/Samba

-> works as expected

PJ127
  • 141
  • 4