Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

client windows 7
samba running on ubuntu 12.04 LTS

I've been running samba on this box for a few years now without issue. All it does is share out the home directory.

In the home directory is a folder with a bunch of web apps. I run the webapps off of ubuntu and edit the files on windows via samba. the two are connected on a gigabit ethernet switch

Recently, all of a sudden, while editing the files in an editor (i've tried several) there seems to be some sort of problem when trying to save. the entire editor client freezes as if waiting for the save to complete. The duration varies, sometimes a few seconds sometimes up to a minute or so. The frequency also varies but it is quite often. Tonite it seemed like almost every 15 mins, sometimes more frequent.

During this time, I can still browse the share no problem in windows explorer. I've tried uploading files from here via ftp and i get the same issue, so it seems like it's related to reading and writing the files, instead of just getting the contents of the directory.

I've tried looking at /var/log/samba and there is nothing useful there. I tried /var/log/messages and anything in var/log that was updated during the time i saw it hang. I also tried looking at top and ps -ef while it was happening.

I've tried googling for all kinds of things but can't find anything.

Here is the relevant part of my smb.conf. It looks like the rest of the file is just defaults.

[dev_user]
path = /home/dev_user
comment = home folder
available = yes
browsable = yes
public = no
writable = yes

Can anyone help please. This is driving me insane =(

share|improve this question

1 Answer 1

I have had this sort of problem in the past. I used this fix on Fedora 16 and 17 but I don't know if it will work on Ubuntu.

1) In the [global] section of /etc/samba/smb.conf add the following lines:

  socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=65535 SO_RCVBUF=65535
  name resolve order = lmhosts wins bcast host

2) Edit /etc/nsswitch.conf. look for the "hosts:" line and put "wins" before "dns". Here is an example line from my nsswitch.conf:

  hosts:    files mdns4_minimal [NOTFOUND=return] wins dns mdns4

3) You may need to restart samba for the changes to take effect.

I hope this helps.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.