Thursday, May 31, 2007

How to stop a network drive disconnecting

We have a problem in our office where network drives disconnect due to inactivity but don't reconnect silently as they should. Instead they say:
An error occurred while reconnecting L: to \\server\share.
The local device name is already in use. This connection has not been restored.
Our server is OS X Tiger (i.e. Samba), and the problem only occurs on machines that are members of the domain, but where the users log in locally.

Changing deadtime in /etc/smb.conf didn't help.

I have discovered that I can reliably stop the problem occurring if I keep a file open on the server. I guess this stops the automatic disconnection, which avoids the reconnection problem. Microsoft Word will do this for you fine, but it's annoying to have that application running all the time so I've created a simple program that will lock a file for you.

To use it, download DriveLocker.exe and shove it on your network drive. Then add a shortcut to it in your Startup group in Programs. The shortcut must include the name of a file to create and lock as its parameter. e.g. the Target field in the shortcut might read:

"L:\DriveLocker.exe" L:\.DriveLocker_OCB

3 Comments:

Anonymous Anonymous said...

Does this work on Network Servers only? Technically I am working with a Peer-to-Peer Workgroups without a doman - Appreciate all of your assistance

3:13 am  
Blogger Oliver Bock said...

No idea. Sorry.

11:43 am  
Anonymous Anonymous said...

I had the same problem on an XP machine connected to Windows 2003 server.

After first changing/adding both:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanworkstation\parameters\KeepConn
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\autodisconnect
to a decimal value of 65535, without the slightest effect, I gave up and tried this solution.

My steps were:
1) created a subdirectory on one of my network mapped drives (K:\_Lock).
2) copied DriveLocker.exe into that directory (K:\_Lock\DriveLocker.exe)
3) Created a link to K:\_Lock\DriveLocker.exe which I placed in the StartUp directory
(C:\Documents and Settings\(user)\Start Menu\Programs\Startup\DriveLocker.lnk)
4) In the properties of the link I change "K:\_Lock\DriveLocker.exe" to
"K:\_Lock\DriveLocker.exe k:\_lock\drivelocker_OCB" (without the quotation marks)

rebooted and haven't lost a connection since :-).

Keith Elias (Friar Broccoli)

4:35 am  

Post a Comment

<< Home