大网数据广告活动
服务器运维问答

CIFS VFS: BAD_NETWORK_NAME on Linux

· 52CE 我爱测

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 Wind…

问题原文

原帖链接 · Arun Krishnan · CC BY-SA 4.0

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.

社区高分解答

原帖链接 · PJ127 · CC BY-SA 4.0

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

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-05-08)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。