Samba troubleshooting tips and techniques

Andrew Tridgell tridge at
Wed Jan 13 05:54:11 GMT 1999

> One of the chapters I am responsible for in the book I am helping with is
> on troubleshooting.

much like Diagnosis.txt

> 1. Is Samba running?
>     ps ax | grep mbd # look for nmbd (possibly 2) and 1+n smbd

won't work on sysV systems. You are better off running netstat to see
that you are listening on the 3 ports (UDP/137, UDP/138 and
TCP/139). That will also work with inetd installations.

For example "netstat -a | grep netbios" 

> 2. Is the problem with Samba, the client, or the network?
>     standard network debugging stuff here, ping from client to server
>     if all works, is name server working OK, is WINS configured correctly,
>     and so on.

"standard network debugging" is what users have trouble with!

You may need to lay out specific steps that build on the previous steps.

>     Ie, a ping of the NetBIOS name of the server from a Windows client will
>     determine if NetBIOS Name Services are working or not. (OK, as long as 
>     you have DNS switched off and the name is not in the hosts or the lmhosts
>     file.)

better using nbtstat or nmblookup. ping invokes too many weird things
as far as name mapping goes.

> 3. Stopping debugging for all clients so you can focus on one client
>     include = /wherever/%m.smb.conf
>    and in /wherever/%m.smb.conf add
>     debug level = 5 ; or more
>    then look at the log files for that machine
> 4. Check the log files looking for specific message types
> 5. Use smbclient to probe your Samba server to make sure it looks right
> 6. Use testparm to check that your smb.conf file is OK and does not have
>    problems

these four are all in the wrong order. 

What you need to get across is that there are 4 different basic things
that can cause a Samba box to not be accessible from a windows box:

1) browsing broken means it doesn't appear in the GUI
2) name resolution broken so the client can't get a IP
3) smb (TCP/139) connection failing
4) authentication failing

the rest is just sugar. 

What you need is a series of steps that _independently_ tests these 4
things. That was what the original design of Diagnosis.txt did. I
haven't looked at it much lately and I know John and other have
changed it so I don't know if that original design has been preserved.

The independence of the tests is critical. You need to be able to test
each of the above 4 without relying on the other 3 working. Or at the
very least don't rely on a facility that an earlier test hasn't proven
to be working. That is easy with appropriate use of "net view",
nmblookup, smbclient, ping and telnet.

Once you've tested those 4 and know which of them is working and which
isn't you can recommend solutions. Anything else is just witchcraft.

If all 4 don't work then suggest that they install Samba before trying
again. (I have had people come to me complaining that Samba doesn't
work when they haven't installed it yet!)

More information about the samba-technical mailing list