# [SAMBA]  4186: tree connect failed: ERRDOS - ERRnosuchshare

## lermi901

After replacing fedora core 4 with gentoo 2006.1 distro ( 2.6.17-gentoo-r8 ) I can no more mount my share from misko host. I can list the share and I can access it with smbclient and I can access it through WinXP explorer, but mount -t smbfs just keeps returning me :

	4186: tree connect failed: ERRDOS - ERRnosuchshare (You specified an invalid share name)

	SMB connection failed

Below I listed some common commands so that you can get the idea of my environment :

> ping misko

  gives this :

	PING misko.andrix (192.168.0.22) 56(84) bytes of data.

	64 bytes from misko.andrix (192.168.0.22): icmp_seq=1 ttl=64 time=0.211 ms

	64 bytes from misko.andrix (192.168.0.22): icmp_seq=2 ttl=64 time=0.181 ms

	64 bytes from misko.andrix (192.168.0.22): icmp_seq=3 ttl=64 time=0.172 ms

> smbtree 

  gives this :

	\\MISKO	                	Misko Skl

                \\MISKO\ADMIN$          IPC Service (Misko Skl)

                \\MISKO\IPC$            IPC Service (Misko Skl)

                \\MISKO\LOG             Misko Logs

                \\MISKO\PARANGAL        Mula Odl

> smbclient //192.168.0.22/PARANGAL -U root

  gives this :

	Domain=[MISKO] OS=[Unix] Server=[Samba 3.0.14a-Ubuntu]

	smb: \>ls

		.                                   D        0  Mon May 15 20:14:55 2006

		..                                  D        0  Tue Nov 28 21:08:51 2006

		Shrd                                D        0  Fri Aug 18 15:20:43 2006

		Temp                                D        0  Tue Nov 28 20:14:50 2006

		Dine                                D        0  Tue Nov 28 21:22:14 2006

				57525 blocks of size 2097152. 22832 blocks available

PROBLEM :

> sudo mount -t smbfs //192.168.0.22/PARANGAL /mnt/Misko -o username=root

  OR

> sudo mount -t smbfs //MISKO/PARANGAL /mnt/Misko -o username=root

  gives this :

	Password:

	4186: tree connect failed: ERRDOS - ERRnosuchshare (You specified an invalid share name)

	SMB connection failed

however I can also access this share from WinXP through \\192.168.0.22\PARANGAL.

If anybody has any idea please help me with this,

Andrej

----------

## gerdesj

Could you post your smb.conf file please (it will save a lot of questions!)

Also, are you able to recover the smb.conf from the Fedora installation?

Cheers

Jon

----------

## lermi901

You misunderstod my post. The distro on the samba server has not changed. Nothing has changed on my samba server, I never touched any of the smb.conf files, but I changed the distro on my client computer which accesses tha shares on samba. However I pasted my smb.conf file below so that you can see my configuration. I have tha main smb.conf file and than I have a separate smb.conf.HOST file for each computer in my LAN that accesses my share. The most important is host GUG which is the one causing the problem, since I removed fedora core 4 and installed gentoo 2006.1. Also I have dual boot on host GUGU so when I sad I can access share from windows also smb.conf.gugu applies, so I guess *.conf should be ok.

So I past in the main smb.conf file and smb.conf.gugu file below :

smb.conf :

# This is the main Samba configuration file. You should read the

# smb.conf(5) manual page in order to understand the options listed

# here. Samba has a huge number of configurable options (perhaps too

# many!) most of which are not shown in this example

#

# Any line which starts with a ; (semi-colon) or a # (hash) 

# is a comment and is ignored. In this example we will use a #

# for commentry and a ; for parts of the config file that you

# may wish to enable

#

# NOTE: Whenever you modify this file you should run the command "testparm"

# to check that you have not made any basic syntactic errors. 

#

#======================= Global Settings =====================================

[global]

   debug level = 1

   interfaces = eth0 lo

   workgroup = ANDRIX

#windows

   netbios name = Misko

   wins support = yes

   logon drive = s:

   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

# server string is the equivalent of the NT Description field

   server string = Misko Skladisce

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names

# via DNS nslookups. The built-in default for versions 1.9.17 is yes,

# this has been changed in version 1.9.18 to no.

   dns proxy = no 

hosts allow = 192.168.0.200/24 192.168.0.201 192.168.0.50/24 127.

hosts deny = 0.0.0.0/0

# this tells Samba to use a separate log file for each machine

# that connects

log file = /var/log/samba/%m.log

max log size = 0

# Security mode. Most people will want user level security. See

# security_level.txt for details.

security = user

encrypt passwords = true

smb passwd file = /etc/samba/smbpasswd

# The following are needed to allow password changing from Windows to

# update the Linux system password also.

# NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.

# NOTE2: You do NOT need these to allow workstations to change only

#        the encrypted SMB passwords. They allow the Unix password

#        to be kept in sync with the SMB password.

  unix password sync = no

  passwd program = /usr/bin/passwd %u

  passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*

# Using the following line enables you to customise your configuration

# on a per machine basis. The %m gets replaced with the netbios name

# of the machine that is connecting

include = /etc/samba/smb.conf.%m

# all log information in one file

;   log file = /var/log/samba/log.smbd

# Use password server option only with security = server

;   password server = <NT-Server-Name>

# Password Level allows matching of _n_ characters of the password for

# all combinations of upper and lower case.

;  password level = 8

;  username level = 8

# Unix users can map to different SMB User names

;  username map = /etc/samba/smbusers

# if you want to automatically load your printer list rather

# than setting them up individually then you'll need this

   printcap name = /etc/printcap

   load printers = no

# It should not be necessary to spell out the print system type unless

# yours is non-standard. Currently supported print systems include:

# bsd, sysv, plp, lprng, aix, hpux, qnx

   printing = bsd

# This option tells cups that the data has already been rasterized

; cups options = raw

# Uncomment this if you want a guest account, you must add this to /etc/passwd

# otherwise the user "nobody" is used

;  guest account = pcguest

# Configure remote browse list synchronisation here

#  request announcement to, or browse list sync from:

#	a specific host or from / to a whole subnet (see below)

;   remote browse sync = 192.168.3.25 192.168.5.255

# Cause this host to announce itself to local subnets here

;   remote announce = 192.168.1.255 192.168.2.44

# Browser Control Options:

# set local master to no if you don't want Samba to become a master

# browser on your network. Otherwise the normal election rules apply

;   local master = no

# OS Level determines the precedence of this server in master browser

# elections. The default value should be reasonable

;   os level = 33

# Domain Master specifies Samba to be the Domain Master Browser. This

# allows Samba to collate browse lists between subnets. Don't use this

# if you already have a Windows NT domain controller doing this job

;   domain master = yes 

# Preferred Master causes Samba to force a local browser election on startup

# and gives it a slightly higher chance of winning the election

;   preferred master = yes

# Enable this if you want Samba to be a domain logon server for 

# Windows95 workstations. 

;   domain logons = yes

# if you enable domain logons then you may want a per-machine or

# per user logon script

# run a specific logon batch file per workstation (machine)

;   logon script = %m.bat

# run a specific logon batch file per username

;   logon script = %U.bat

# Where to store roving profiles (only for Win95 and WinNT)

#        %L substitutes for this servers netbios name, %U is username

#        You must uncomment the [Profiles] share below

;   logon path = \\%L\Profiles\%U

# All NetBIOS names must be resolved to IP Addresses

# 'Name Resolve Order' allows the named resolution mechanism to be specified

# the default order is "host lmhosts wins bcast". "host" means use the unix

# system gethostbyname() function call that will use either /etc/hosts OR

# DNS or NIS depending on the settings of /etc/host.config, /etc/nsswitch.conf

# and the /etc/resolv.conf file. "host" therefore is system configuration

# dependant. This parameter is most often of use to prevent DNS lookups

# in order to resolve NetBIOS names to IP Addresses. Use with care!

# The example below excludes use of name resolution for machines that are NOT

# on the local network segment

# - OR - are not deliberately to be known via lmhosts or via WINS.

; name resolve order = wins lmhosts bcast

# Windows Internet Name Serving Support Section:

# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server

; wins support = yes

# WINS Server - Tells the NMBD components of Samba to be a WINS Client

#	Note: Samba can be either a WINS Server, or a WINS Client, but NOT both

;   wins server = w.x.y.z

# WINS Proxy - Tells Samba to answer name resolution queries on

# behalf of a non WINS capable client, for this to work there must be

# at least one	WINS Server on the network. The default is NO.

;   wins proxy = yes

# Case Preservation can be handy - system default is _no_

# NOTE: These can be set on a per share basis

;  preserve case = no

;  short preserve case = no

# Default case is normally upper case for all DOS files

;  default case = lower

# Be very careful with case sensitivity - it can break things!

;  case sensitive = no

#============================ Share Definitions ==============================

smb.conf.gugu :

[PARANGAL]

   comment = Mula Odl

   path = /var/lib/mldonkey/Parangal

   browseable = yes

   read only = no

   valid users = root andrei

   create mode = 0664

   directory mode = 0775

[LOG]

   comment = Misko Logs

   path = /var/log

   browseable = yes

   read only = yes

   valid users = root andrei

----------

## gerdesj

I have done a quick Google to no avail and your config looks OK.  You seem to have quite a few distros!

The server is running Ubuntu with Samba 3.0.14a which is pretty old and would be worth updating.  On Gentoo 3.0.22r3 is the current and I suppose there is the possibility of an incompatibility.

I recommend that you make sure you still have the rpm's/debs or whatever installed Samba on the Ubuntu box and backup your /etc/samba directory then install either the latest Ubuntu packages or the latest version that both Ubuntu and Gentoo have available.

On the Gentoo box run testparm -v and check to see if you are using any out of date options.  Copy the "service definition" to a file.  Do a testparm -v on the Ubuntu box and dump that to a file.  Compare the output from the two testparms.  If you can get the same version of Samba on both boxes then there is no need for the -v which will also dump the defaults as well as the settings you changed.

Although it is quite a lot of work, keeping software versions in sync is a good idea especially for complex packages like Samba.  That way if you have a problem, then you fix all of them in one go or you just revert back to the last known good on all systems.

Cheers

Jon

----------

## lermi901

Well it's true that I don't have much experience with ubuntu distro ( I do not even remember how it got to my server  ) but I don't think I can update the samba at least not using the package system apt-get because the latest package it offers is the one that I already have ( I did an update of packages lists ). Also I can not compile samba from sources since autogen.sh does not work because again I have an older version of autoconf and also the package system doesn't offer a version that is enough current for samba autogen.sh. So I am stuck here. I also have to study so I don't have time to go into much details with ubuntu distro specifics right now ... I already lost 2h just trying to upgrade samba.

I tried testparm -v command and I mathed the two parameters lists side by side and parameters generally match on protocols and versions of protocols and other things one would assume are important for successful communication, but the list of parameters on gentoo distro is longer since samba version here is more up to date and has more parameters.

Somehow I suspect you are right and the version mismatch could be the problem and probably the best solution is to upgrade samba. But I have a feeling this is going to take me a lot of time since I will probably just replace ubuntu with gentoo distro where I am more at home with distro specifics.

Thanks very much for your help gerdesj,

if I by any chance stumble into a solution I will post it here.

Andrej

----------

## gerdesj

A pragmatic approach mate!  

Cheers

Jon

----------

## lermi901

Well I finally figured it out. But I still don't understand the reason behind this behavior. After I reinstalled system so that I could have mathcing versions of samba server and client the problem still remained. Then I noticed this weird thing in logs. Well it seams that if I connect through smbclient then the samba server receives the client's hostname but if I do a "mount -t smbfs" then samba server receives ip. Since my share configuration was based on hostnames, share did not show up if hostname wasn't specified and mount didn't work. Workaround is simple. All I had to do is copy my smb.conf.HOST file to smb.conf.IP_ADDR and it worked. However I have no idea why this is happening.

Andrej

----------

