Re: SAMBA -- automatic remounting



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.

--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / mail: TRAP + SPAN don't belong
http://www.brainbench.com / "He is a rhythmic movement of the
-----------------------------/ penguins, is Tux." --MegaHAL
.



Relevant Pages

  • Re: SAMBA -- automatic remounting
    ... filesystems] would survive reboots of the server and that they would ... How to detect when a samba mount is stale. ... 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: 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)
  • Re: UFS logging on SDS mirrored filesystems?
    ... >> it usually will not be discovered until the machine reboots. ... The root filesystem must be mounted with logging enabled. ... If not all transactions have been written to disk the machine cannot ...
    (comp.unix.solaris)
  • Re: Hardware details on linux
    ... FH> How can I find hardware details like processor speed, chip name (pentium ..etc) ... FH> and so on, on a linux machine? ... Look under the /proc filesystem: ...
    (comp.os.linux.misc)