Re: SAMBA -- automatic remounting



On Fri, 31 Mar 2006 13:23:33 -0600, Dances With Crows <danSPANceswitTRAPhcrows@xxxxxxxxx> wrote:
On Fri, 31 Mar 2006 11:13:05 -0500, John-Paul Stewart staggered into the
Black Sun and said:
The Natural Philosopher wrote:
Keith Keller wrote:
On 2006-03-30, Ignoramus27088 <ignoramus27088@xxxxxxxxxxxxxxxxxxxx>
wrote:
What I do want though, is to ensure that these mounts [of SMB
filesystems] would survive reboots of the server and that they would
auto-reconnect if something goes bad temporarily.
1) How to detect when a samba mount is stale.

No idea, though there's got to be something you can do. Periodic
pinging of the machine will let you know if it's on the LAN or not.
Periodic attempts to stat a file shared via SMB will let you know if SMB
is up.

2) Is there some system flag to automatically remount the shared
drives, or ...
//server/share /mnt/somewhere smbfs auto,user=me 0 0
//server/share /mnt/somewhere autofs defaults 0 0

The first example will automatically mount the smbfs filesystem at
boot time. The second example, where the *filesystem* type is
specified as *autofs* is (I believe) what Keith was referring to when
he suggested automount.

FWIW, the behavior Ignoramus wanted wrt SMB may be automatic. On an
older Linux machine here, I have an fstab line like so:

//prod2/d /mnt/prod2 smbfs auto,user=prod1,password=SECRET,
workgroup=workgroup,uid=1000,gid=100 0 0

...PROD2 is running an up-to-date 'Doze2K. Cutting off sharing on
PROD2/D made all attempts to access /mnt/prod2 from the Linux machine
fail (of course). Turning sharing back on made things work OK on the
Linux machine, and I didn't have to remount anything. I don't have time
to reboot prod2 right now though.

It's highly likely that the Samba developers allowed for the possibility
that Windows machines would have to be rebooted occasionally, and made
recovery from that as transparent as possible. ICBW.


So, if I understand you right, Samba already provides for it in some
way. Very nice.

My mount lines are

//manifold/download /downloads smbfs ro,user,auto,username=,password=, 0 0
//manifold/torrents /torrents smbfs ro,user,auto,username=,password=, 0 0

(these are read only, passwordless mounts, protected by iptables from outside world)

i

.



Relevant Pages

  • Re: SAMBA -- automatic remounting
    ... filesystems] would survive reboots of the server and that they would ... Periodic attempts to stat a file shared via SMB will let you know if SMB ... The first example will automatically mount the smbfs filesystem at ... PROD2/D made all attempts to access /mnt/prod2 from the Linux machine ...
    (comp.os.linux.misc)
  • Re: SAMBA -- automatic remounting
    ... filesystems] would survive reboots of the server and that they would ... The first example will automatically mount the smbfs filesystem at ... PROD2/D made all attempts to access /mnt/prod2 from the Linux machine ... there were no changes on the server. ...
    (comp.os.linux.misc)
  • Re: problems with -current
    ... startx simply reboots my laptop. ... > usual, however root filesystem is still mounted read-only, i.e. ... I remember seeing some changes to mount some days ago, ...
    (freebsd-current)
  • Re: Able to mount a file sysetm on 2 servers
    ... when the 2 servers would mount this ufs filesystem. ... I know this is invalid and can corrupt the filesystem. ... touched a file on the filesystem using server "a". ... reboots. ...
    (comp.unix.solaris)
  • Re: read/only root filesystem strategy
    ... |> copies loaded into a ramfs or tmpfs filesystem. ... | You don't need /tmp to be persistent across reboots. ... I didn't list a few other subdirectories I actually use in my own ... a runaway filesystem fillup in /home to impact /var, ...
    (comp.os.linux.development.system)