Reliable method to mount a Win 2K share on Linux.

Urban Widmark urban at teststation.com
Fri Dec 22 12:56:06 GMT 2000


On Fri, 22 Dec 2000, Grant wrote:

> After a while it seems to disconnect. With errors from the log:
> 
> Dec 22 17:28:26 sphinx kernel: smb_trans2_request: result=-32, setting
> invalid

This is from detecting that the connection is dropped (the win2k box drops
it, but that could be caused by smbfs not answering some keepalive signal
properly, or something. It happens all the time.)


> Dec 22 17:28:38 sphinx kernel: smb_retry: signal failed, error=-3

This is caused by smbmount (mount.smbfs) having terminated, for some
unknown reason. When smbfs sees a network error it tries to signal
smbmount to reconnect. If smbmount is gone the mount will stop working.
  (http://www.hojdpunkten.ac.se/054/samba/smbmount/)

Normally you would get:
smb_trans2_request: result=-32, setting invalid
smb_retry: sucessful, new pid=17883, generation=2
smb_trans2_request: result=-32, setting invalid
smb_retry: sucessful, new pid=17883, generation=3

smbmount from samba versions earlier than 2.0.6 (?) were having huge
problems with this. 2.2 kernels earlier than 2.2.18 would do bad things on
signals, causing smbmount to terminate.


One known problem with smbmount 2.0.7 is that it will terminate if the
server you are connected to is unreachable when someone accesses smbfs.
For that you may try:
http://www.hojdpunkten.ac.se/054/samba/smbmount-2.0.7-ascii+fixes.patch

But there are other problems not even identified yet.

To help debug this you could build a smbmount with that patch. Add a few
strategic debug outputs
	DEBUG(0,("some printf thing: %s\n", some_var));
and see what you get in log.smbmount. The patch includes code for allowing
smbmount to log what it is doing even after it becomes a daemon. You may
want to try using debug=4 too (or higher).

(source/client/smbmount.c:send_fs_socket in the samba sources handles
 smbmount in daemon mode. The idea is to figure out why it terminates.)


A workaround may be to use autofs. It will unmount when the mount isn't in
use and remount it later when used again. Depending on how you use smbfs
that may work better.

/Urban





More information about the samba mailing list