-   Linux - Server (
-   -   Samba server not allowing windows client to save files correctly (

royce2020 09-26-2007 06:03 PM

Samba server not allowing windows client to save files correctly
Those of you who have been paying attention to my posts latly, will know that I have recently deployed a Samba server on Debian.

The problem that I am having at the moment is that if a windows client opens a text file from a particular folder (that is in a mapped network drive, I haven't tryed unc paths) with notepad, changes the file, closes notepad, selects "yes" to save changes. At this piont rather than saving the file (as it does for other files) notpad reports that it cannot create the file (though it already exists) and opens a "save as" dialog which if the user just hits "save", notepad says the file exists, and asks if the user would like to overwrite it.

This might not sound like a huge problem, but the users have to edit hundreds of these files in the course of a day, and this problem efectivly doubbles the amount of work they have to do.
The windows file server didn't do this, and if you copy the file (from windows) to a diferent folder the samba server dosen't do it either.

Are there some settings on this particular folder that are causing this?

royce2020 09-26-2007 07:04 PM

I've been tinkering with the permisions of a single file, so now this file a windows client can change and just close the window.
The problem is I changed a lot of stuff, now I can't remember which setting exacly I changed. I tryed the most likly things on annother file, but this second one still does the same thing.

Is there any way of copying file permisions from one file to annother?

royce2020 09-27-2007 04:54 PM

I've discovered that if you try to delete or rename the file using CMD, it reponds: "The process cannot access the file because it is being used by another process." which is odd considering I can overwrite it. Also, I can delete the file from inside linux while it's aparently locked. smbstatus reports that it is "DENY_NONE" as apposed to "DENY_WRITE" which is what I'd expect if it was samba doing the locking, but our windows unlocker resonds that there are no locking handles for this file, even when the message box saying that it cannot create the file is on the screen. what's going on?

royce2020 09-30-2007 03:45 PM

I found the problem. When all the files where transfered from the windows file server to the Samba server, all the locks (made by the win file server) stayed in place. Stoping the Sama deamons, deleting all the lock (*.tbd) files, then restarting the deamons did the trick.
Not sure what caused it in the first place, but I'll keep my eyes open.

Micro420 09-30-2007 10:49 PM

Glad you solved the problem and posted the result. I had this issue a long time ago when I was trying to share some files on a Windows 2000 machine. I ended up giving up and upgraded the machine to Windows XP and the problem went away, but it's good to know how to work around it.

royce2020 11-06-2007 08:10 PM

This dam problem has started cropping up again.
It's being caused when one windows client opens it, modifyes it, then closes it, but the lock remains.
I could concevably solve this problem by stopping the saba deamons and deleting the locks every once in a while, but that seems ineficient (and it plays havoc with the PSTs sotored on it).

strick1226 11-07-2007 12:30 PM

I've not run into this problem myself (yet), but this information on file locking from the official samba docs may prove useful:

Looks like oplocks can cause a lot of issues, and the general recommendation is to disable them entirely for busy shares...


All times are GMT -5. The time now is 10:42 PM.