samba can not reconnect

Hi all, having these issue with samba,
after random time (it can be after 20 min or after 5-8min) my client mashine on windows 7 disconnects from opensuse 11.4 kde server. When i refresh disk on windows I am getting message that local device is already in use and that connection has not been restored.

I need to go to my suse and type service smb restart but these command usualy dont work I need to retype it for few times until windows can reconnect.

it happen quite offen, hapend while wathing movie from shared disc…

Are you sure you have to restart the service several times? And are you sure you have to restart the service at all? What happens if you just wait? And before restarting the service, can you type:

service smb status

to check if it’s actually still running.

The command “service smb status” does require that you have root authority and I might add a couple more commands to that with the terminal command sequence:

# **su -**
password:
# **service smb status**
Checking for Samba SMB daemon running
# **service nmb status**
Checking for Samba NMB daemon running
# **cat /etc/samba/smb.conf**

You will type in the commands shown in bold (password you type not shown) and then copy and past the results of the three last commands here in a message for us to see. Use the advance message editor, highlight the text you paste into the message from your terminal session and put it into a code (#) field as I did above.

Thank You,

linux-c6ea:/home/andre # service smb status
Checking for Samba SMB daemon                                          running
linux-c6ea:/home/andre # service nmb status
Checking for Samba NMB daemon                                          running
linux-c6ea:/home/andre # cat /etc/samba/smb.conf
# smb.conf is the main Samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
# samba-doc package is installed.
# Date: 2011-03-01
[global]
printcap name = cups
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \\%L\profiles\.msprofile
logon home = \\%L\%U\.9xprofile
logon drive = P:
usershare allow guests = Yes
add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
domain logons = Yes
domain master = Yes
netbios name = andre
os level = 65
preferred master = Yes

[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes

[profiles]
comment = Network Profiles Service
path = %H
read only = No
store dos attributes = Yes
create mask = 0600
directory mask = 0700

[groups]
comment = All groups
path = /home/groups
read only = No
inherit acls = Yes

[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No

[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @ntadmin root
force group = ntadmin
create mask = 0664
directory mask = 0775

[netlogon]
comment = Network Logon Service
path = /var/lib/samba/netlogon
write list = root

[SAMBA]
path = /home/andre/Samba/
guest ok = yes
inherit permissions = yes
delete readonly = yes
read only = no
admin users = GNOJEK

thanks for responses…

So, if this is just a standard peer to peer Windows share setup between two machinces, I wonder why you have the following items included?

include = /etc/samba/dhcp.conf
logon path = \\%L\profiles\.msprofile
logon home = \\%L\%U\.9xprofile
logon drive = P:
add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$

In the following group I have the domain questions set to no and do not include the os level (which forces the Browse master between two PC’s).

os level = 65
domain logons = Yes
domain master = Yes

And I did not see a workgroup name there:

workgroup = something

There is a great tutorial on setting up Samba you can read here:

Samba: Practical Introduction to Linux Usershares on openSUSE 10 11

Thank You,

Also look for logs in /var/log/samba and if you find a file with the name or ip of your Windows client (maybe prefixed with “log.”), look in this file for useful information. I’m not sure about the path though. That’s what I’m using but I don’t remember if it’s the default or if I added it myself (as for many things actually).
This is the option I use in the global section (meaning, if it’s the default - which a samba guru that I’m not could confirm - you don’t need to specify it):

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

Now, next time you lose your connection:

  • check on the server if the smb and nmb daemons are running
  • look in /var/log/samba/log.
  • ping server and client in both directions (however I don’t know if Windows responds to pings).
  • on the server:
ping <client name or ip>
  • on the client:
ping <server name or ip>
  • without the brackets!

thanks for your responses,

@jdmcdaniel3
these is configured for 3 laptops and android so I allow all devices to communicate
and as only linux in network its set to network master with os level = 65
found in here:
Samba and Suse: HowTo Set up an openSUSE-Windows Home Office LAN/Network. Versions 11.x

thanks for pointing to missing workgroup, I found somewhere on forums that no workgroup can be an issue with firewall and as a matter of fact I have lost firewall config for samba, somehow.
just accepted the broadcast reply for External Zone and it works.

thanks for your posts

thanks for pointing to missing workgroup, I found somewhere on forums that no workgroup can be an issue with firewall and as a matter of fact I have lost firewall config for samba, somehow.
just accepted the broadcast reply for External Zone and it works.

thanks for your posts

So you added Samba to your Firewall allowed services, which is very important, and added in a Workgroup name and all is working properly now?

Thank You,

yes but firewall was set properly before and dont know why it stoped…
any way it works so all good!

good luck!

yes but firewall was set properly before and dont know why it stoped…
any way it works so all good!

good luck!

I just love to hear about good news and it was a good thing you looked at your firewall settings. I was happy to have been of help.

Thank You,

:slight_smile: always two idea are better than one

thanks&good luck