samba “The specified network name is no longer available” 出错的解决办法

当尝试访问Samba共享时遇到'The specified network name is no longer available'错误。问题出现在Windows 8和基于Yocto的Linux之间。已尝试卸载和重新安装Samba,但问题仍然存在。解决方案可能涉及检查SMB.conf配置,确保必要的库文件已安装,设置Samba用户名和密码,并检查访问权限。
关于samba的作用在这里我就不作详细的解说了,由于这几天重装了ubuntu14.04的系统,一些关于samba的配置文件都是之前配置好的,直接覆盖了现有的,跳过了繁琐的配置步骤,没想到出现了“


The specified network name is no longer available”这样的一个小问题,卸载,重新安装samba,又重新配置文件,问题依然存在,但是在windows下可以ping通samba服务器的IP地址,就是不能登陆进去查看文件,很是头疼...难过


在网上找了很多资料都不是很实用,直到看到了这篇文章,如果英语还可以且有兴趣的朋友可以看一下...

http://unix.stackexchange.com/questions/214128/samba-specified-network-name-no-longer-available/214129

如果你由于某些条件的限制不能打开此链接,我会在最后附录上这篇文章的内容,方便一些朋友微笑


我这边可能是由于一些依赖的库文件没有安装,才导致现在这样的错误,

$ sudo apt-get install --reinstall libsmbclient libsmbclient-dev libtevent0 libtalloc2
$ sudo service smbd restart

执行以上的指令就可以了吐舌头



附录内容:

SAMBA Specified Network Name no Longer Available


I've got a problem building a SAMBA share between two computers. One is on Windows 8, the other is on a custom Yocto made Linux. The SAMBA worked before, I don't understand why it does not anymore ...

The error message I get is the following : "\[IP]\SHARED is not accessible. You might not have permission to use this netwokr resource. Contact the administrator of this server to find out if you have access persmmissions. The specified network name is no longer available"

I'm ROOT on my Yocto

My SMB.CONF file (in /usr/local/samba/lib) looks like :

[global]
workroup = smb
security = share
share modes = yes
log file = /var/log/samba.log.%m

[homes]
comment = Home Directories
browsable = no
read only = no
create mode = 0750

[SHARED]
path = /media/ssd
public = yes
writable = yes
comment = smb share
printable = no
guest ok = yes

I've tryed the following :

    Changing the workgroup to WORKGROUP
    Start and restart SMBD and NMBD (with the -D option)
    Changing the cable and the interface (I've got two Ethernet entrances)
    Change permissions of the /media/ssd file to a maximum with chmod -R 777
    Change computer

But still the same problem ...

Would you happen to know what might be going on ?

[EDIT] : SMB Traces :

[1970/01/01 01:09:07.449826,  0] lib/fault.c:372(dump_core)
  dumping core in /usr/local/samba/var/cores/smbd
[1970/01/01 01:09:07.489470,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
  tdb(/usr/local/samba/var/locks/locking.tdb): expand_file write of 8192 bytes failed (No space left on device)
[1970/01/01 01:09:08.051746,  0] locking/locking.c:905(share_mode_lock_destructor)
  store returned NT_STATUS_UNSUCCESSFUL
[1970/01/01 01:09:08.052047,  0] lib/util.c:1117(smb_panic)
  PANIC (pid 4088): could not store share mode entry: NT_STATUS_UNSUCCESSFUL
[1970/01/01 01:09:08.053048,  0] lib/util.c:1221(log_stack_trace)
  BACKTRACE: 0 stack frames:

[EDIT] : ADD :

It works on a Linux Virtual Machine, but not on the Windows Host
Have you setup the samba username and password

sudo smbpasswd -a sambauser

here username might be your system(Linux) username, ie. sambauser is my linux user,

set the permission of shared folder to sambauser

$ chown -R sambauser:root /media/ssd

and restart your SMB server

$ sudo service smbd restart

and then from window machine access your shared folder

go to run by hitting the keys window key + R and access your shared folder

\\[IP]\ssd


 
Hi, thanks. I've forgot to add that i'm ROOT on my Linux, plus my SAMBA security is "SHARE", are you sure I need to set a password, or add a user to the group (since I'm root) ? – xhaltar Jul 6 '15 at 10:23
    
for authentication you always need to have username and password, if you are accessing your data from any remote system – user4820 Jul 6 '15 at 10:24
    
Ok, so I've done like you did (remplacing "sambauser" by "root"), but it doesn't solve this :( – xhaltar Jul 6 '15 at 10:27
    
Check your samba access log file, it will tell you some information regarding ,access to file /var/log/samba/ here it exist – user4820 Jul 6 '15 at 10:31
 
Alright, I've updated my question with the traces. I'm trying to empty some space since there is a message about it ... but I does not work either ... – xhaltar Jul 6 '15 at 10:52
show 2 more comments

 

Sometimes Samba fails to install or update it's dependencies correctly. Try running the following command to ensure all the dependencies are available, this is on Ubuntu, modify for your Linux flavour:

$ sudo apt-get install --reinstall libsmbclient libsmbclient-dev libtevent0 libtalloc2

CentOS, RHEL:

$ sudo yum reinstall libsmbclient libsmbclient-dev libtevent0 libtalloc2

<think>好的,我现在需要解决用户遇到的Samba挂载错误:“No dialect specified on mount”。这个问题看起来和Samba客户端的配置有关。首先,我得回忆一下Samba的版本变化和相关配置参数的调整。 用户提到参考的引用是关于Samba 2.0.0之前默认使用security = share,但现在可能已经发生了变化。新的Samba版本可能不再支持某些旧的参数,导致挂载时出现方言未指定的错误。 首先,我应该检查用户使用的mount命令是否正确。常见的挂载命令是使用mount -t cifs,但可能需要指定版本选项,比如vers=1.0、2.0或3.0。因为从Samba 4.0之后,默认的协议版本可能更高,而旧服务器可能不支持,所以客户端需要明确指定版本。 另外,错误信息中的“No dialect specified”可能意味着mount.cifs需要显式声明SMB协议版本(方言)。解决方法是在挂载命令中添加vers=选项,例如vers=2.0或vers=3.0,具体取决于服务器支持的版本。 此外,用户可能需要安装cifs-utils软件包,确保挂载所需的工具可用。同时,检查用户名、密码和共享路径是否正确,以及网络连接是否正常。 总结可能的解决步骤:更新挂载命令,添加vers参数;确认服务器支持的SMB版本;安装必要工具包;检查凭据和网络设置。最后,建议用户查看系统日志获取更多错误细节,或者联系服务器管理员确认协议版本。</think>针对Samba挂载时出现的错误`No dialect specified on mount`,以下是分步解决方案: --- ### **1. 确认挂载命令语法** 挂载命令需使用`-o vers=`参数明确指定SMB协议版本(方言)。 **旧版本语法(已过时)**: ```bash mount -t cifs //server/share /mnt -o username=user,password=pass ``` **修正后的语法**: ```bash mount -t cifs //server/share /mnt -o username=user,password=pass,vers=2.0 ``` - **关键参数**:`vers=2.0`(或`vers=3.0`,需与服务器支持的SMB版本一致)[^1] --- ### **2. 确定服务器支持的SMB版本** 联系服务器管理员或通过以下命令测试(需安装`smbclient`): ```bash smbclient -L //server/share -m SMB3 ``` 若失败,尝试替换`SMB3`为`SMB2`或`SMB1`,观察兼容版本。 --- ### **3. 安装必要工具包** 确保系统已安装`cifs-utils`: ```bash sudo apt install cifs-utils # Debian/Ubuntu sudo yum install cifs-utils # CentOS/RHEL ``` --- ### **4. 完整挂载命令示例** ```bash mount -t cifs //192.168.1.100/shared /mnt/samba -o username=user,password=pass,vers=2.0,uid=1000,gid=1000,dir_mode=0755,file_mode=0644 ``` - `uid/gid`:设置挂载目录的用户/组权限 - `dir_mode/file_mode`:目录和文件的权限掩码 --- ### **5. 持久化挂载配置(/etc/fstab)** 在`/etc/fstab`中添加: ```bash //server/share /mnt/samba cifs username=user,password=pass,vers=2.0,uid=1000,gid=1000,dir_mode=0755,file_mode=0644 0 0 ``` 执行`mount -a`重新挂载。 --- ### **根本原因分析** Samba从4.11版本开始弃用未明确指定方言的挂载请求,强制要求声明协议版本。此变更旨在提高安全性,但需客户端主动适配。 ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值