Keith via plug on 22 Oct 2020 13:55:44 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Linux mount of Windows share keeps dropping


On 10/22/20 4:19 PM, Walt Mankowski via plug wrote:
On Thu, Oct 22, 2020 at 03:52:47PM -0400, Keith via plug wrote:
On 10/22/20 2:37 PM, Walt Mankowski via plug wrote:
Hi,

At work my desktop runs ubuntu 18.04.5. We're encouraged to keep most
of our work on a Windows share (the "H drive") because it's
automatically backed up and can be mounted anywhere.

I mount the share with the following command (with obvious changes):

   sudo /sbin/mount.cifs //path/to/share ~/H_drive/ -o
   username=<username>,dom=<dom>,uid=$USER,forceuid,gid=$USER,forcegid,dynperm,nobrl,vers=1.0

This worked fine for about a year, but lately it's been disconnecting
constantly after just a short period of idle. As you can imagine it's
quite frustrating and disruptive having to constantly umount and
re-mount the drive many times a day.

I've opened a ticket with our IT department, but since we're primarily
a Windows shop there's a good chance they won't know the answer. (Plus
there's a 3 day turnaround for help tickets!)

In the meantime I was wondering if anyone might have run into this
problem and if they have any ideas for fixes.

Thanks.

Walt

Thanks, Keith,

I haven't run into that in a awhile and I would have to know more about the
environment but typically with Windows I end up using "broad sword"  and
inelegant tactics because root cause solutions are often not available (or
definitive).  For the record, the last time I saw this happening, it
actually was a network issue. Windows is a bit sensitive in that regard so
this could be a server side issue.  There are a couple of registry settings
I had to roll out to my Windows 10 users last year to address a similar
issue (Windows 10 clients losing their network connections to a Samba 4
server).  As a I recall that mostly was a compliant about performance issues
(e.g. why is the network so slow?) and not an outright disco.
Obviously registry changes aren't an option since I'm running
Ubuntu. :) I have no visibility to what IT's server settings are, and
between the pandemic and their general lack of Linux chops I'm not
anticipating much help from their end.
I figured you might say that :-)

What I would ask/suggest is have you tried cron'ing or doing an infinite
loop script to remount for your share shorter than your observed disconnect
time?
The only thing I've tried is using different version numbers. The
"vers=1.0" looks like a red flag, right? Well, I didn't used to have
that. Then one day after an Ubuntu update, every time I tried to
access any files on the share it failed with a "stale file handle"
error. Google searches suggested adding "vers=1.0" and that fixed it
for at least 6 months until this started happening. I tried newer
versions again this morning, but the stale file handle error is still
there.

I'm nervous about doing any automatic umount/mount because I edit
files and run scripts from that share, and I'm worried it would cause
failures.

Walt

Ah... ok, the version thing definitely was/is a thing but I haven't had to use that trick in at least 10 years.  Structurally speaking what I'm going after is a refreshing of stale links.  The network connection is at a lower level than the user so, for instance, I use this same technique for "healing" SIP carrier connections for VoIP servers.  All you are doing is making sure the connection is available.  Your applications will have no knowledge of those lower level lower details.  Either apps can access files or not so this type of thing is benign (i.e. it fails silently if you are still connected).  Playing with the version numbers may yield some relief but typically with that solution it was about forcing the share protocol down to an earlier version.  1.0 might be too old so you may need to use something higher.

Its worth playing around with since you're not likely to get a "real" answer from IT.

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
-- 
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Keith C. Perry, MS E.E.
Managing Member, DAO Technologies LLC
(O) +1.215.525.4165 x2033
(M) +1.215.432.5167
www.daotechnologies.com
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug