13

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
  • 379
  • 2
  • 3
  • 13
  • 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

2 Answers2

5

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
  • 151
  • 1
  • 4
0

In my case: I want to mount Window network share into my Linux PC directory, I solve this issue by get the exact network share path:

  • Right click to Folder share --> Properties --> DFS

DFS path image (sorry I can not put image directly, due to not enough reputation :D)

  • After we have DFS path. In Linux PC run mount command: sudo mount.cifs <DFS path> /mnt/100_CI_Jenkins -o cred=/mnt/.pw,vers=3.0
  • Where /mnt/.pw like that:
 $ cat .pw
user=<your username>
password=<your pw>
domain=<your domain>
  • If you have a new question, please ask it by clicking the [Ask Question](https://serverfault.com/questions/ask) button. Include a link to this question if it helps provide context. - [From Review](/review/late-answers/546435) – fission Mar 23 '23 at 06:11