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

Re: Automatically remounting CIFS share

Quoting Scott Gifford on 2010-02-16 14:41:14:
> Is there a way to get similar behavior from a CIFS server, where a rebooted
> fileserver will automatically be remounted when it comes back?

Hi Scott. If my mental model of your problem is correct, then your
problem can be solved by adding an entry to the Debian box's crontab,
which runs a script that attempts to touch a file on the NAS.

If it works, return 0. If it fails, the script should remount the CIFS
share, and optionally write a warning to syslog, send a text message to
an admin, or whatever your site's procedure specifies.

The crontab should be fired fairly frequently to minimize downtime, but
use discretion of course. To me, '*/5 * * * *' should be fast enough to
limit downtime, but not so fast as to effectively DoS yourself.

I've only applied minimal testing to this method, yanking the network
cable to simulate an outage of the CIFS server. Works okay for me, but
more testing would probably be necessary.

 _  Brian Ryans 8B2A 54C4 E275 8CFD 8A7D 5D0B 0AD0 B014 C112 13D0     .
( ) ICQ UIN: 43190205 | Mail/MSN/Jabber: BrianLRyans@gmail.com       ..:
 X  ASCII Ribbon Campaign Against HTML mail and v-cards: asciiribbon.org
/ \ Any technology distinguishable from magic is insufficently advanced.

Attachment: signature.asc
Description: Digital signature

Reply to: