Samba notes

Some notes about debugging Samba, mainly because of a problem I encountered for which I found it very difficult to find solutions on the web.

Contents:

1. Some useful Samba commands

These commands run on a Linux system, and can be used to probe a running Samba server on the same system (or elsewhere as appropriate). They assume Samba client and server are installed.

2. Mysterious disappearing shares

(This is also reported at: https://www.scientificlinux.org/bug.feature/bugs/19/pcng_issue_view)

The other day (16 November) my Scientific Linux 4.0 server did a YUM auto-update of Samba from 3.0.10 to 3.0.25b. About the same time, my main share and printing stopped working, which have previously been working faultlessly for about a couple of years. I also lost my printing service.

I dug about on the web, and found some issues relating to Samba 3.0.25 and MSDFS; I've: (a) added

msdfs proxy = no }}} to my smb.conf, and (b) rebooted by Windows XP client system (repeatedly!) with no change in symptoms.

If I try to mount using NET USE, I see this error:

System error 67 has occurred. The network name cannot be found. }}} (and see a similar problem, with even less useful diagnostic, if I try to connect drive via Windows explorer.)

But, interestingly, my server home directory (per smb.conf [homes]) connects OK:

Local name I: Remote name \\luggage\graham Resource type Disk Status OK # Opens 1 # Connections 1 The command completed successfully. }}}

I've also checked modified the services enabled in my XP system, per http://helpdesk.ugent.be/netdisk/en/bestand_mount.php?id=1. Similar problems have been noted on at least two other workstations (XP and Win2K), but those have not been investigated as fully.

Running testparm, I get:

Load smb config files from /etc/samba/smb.conf Processing section "[homes]" Processing section "[printers]" Processing section "[files]" Processing section "[dvd]" Loaded services file OK. Server role: ROLE_STANDALONE Press enter to see a dump of your service definitions [global]

[homes]

[printers]

[files]

[dvd]

[root@luggage mnt]# }}}

There's no useful information in smbd.log

Smbstatus indicates no obvious problem:

Samba version 3.0.25b-1.el4.2

PID Username Group Machine


Service pid machine Connected at


graham 4425 conina Sun Nov 18 16:04:03 2007 mandy 4421 rincewind Sun Nov 18 16:03:08 2007

Locked files: Pid Uid DenyMode Access R/W Oplock SharePath Name Time


4425 500 DENY_NONE 0x100001 RDONLY NONE /home/graham . Sun Nov 18 16:09:33 2007 4425 500 DENY_NONE 0x100001 RDONLY NONE /home/graham . Sun Nov 18 16:09:33 2007 4421 501 DENY_NONE 0x100001 RDONLY NONE /home/mandy . Sun Nov 18 16:04:09 2007 4421 501 DENY_NONE 0x100001 RDONLY NONE /home/mandy . Sun Nov 18 16:04:09 2007 }}}

The problem was also present when trying to connect from the same system, using smbclient:

Password: Domain=[LUGGAGE] OS=[Unix] Server=[Samba 3.0.25b-1.el4.2] tree connect failed: NT_STATUS_BAD_NETWORK_NAME [root@luggage ~]# }}}

I eventually got my system working again, though I'm not sure it's a fix to the problem as originally reported. The clue was here: https://bugs.launchpad.net/ubuntu/+source/samba/+bug/95460. The presence of msdfs proxy in smb.conf was the culprit, and when this was removed my shares started working again.

The testparm output now looks like this:

Load smb config files from /etc/samba/smb.conf Processing section "[homes]" Processing section "[printers]" Processing section "[files]" Processing section "[dvd]" Loaded services file OK. Server role: ROLE_STANDALONE Press enter to see a dump of your service definitions

[global]

[homes]

[printers]

[files]

[dvd]

}}}

3. References


-- GrahamKlyne 2007-11-21 22:18:53

Creative Commons License
The content of this wiki is licensed under the Creative Commons Attribution-ShareAlike 2.0 England & Wales Licence.

OSS Watch is funded by the Joint Information Systems Committee (JISC) and is situated within the Research Technologies Service (RTS) of the University of Oxford.