Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
auto-unmounting network shares after inactivity
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
cdemers
n00b
n00b


Joined: 11 Jan 2005
Posts: 2
Location: Montreal

PostPosted: Fri Apr 08, 2005 3:32 pm    Post subject: auto-unmounting network shares after inactivity Reply with quote

Hi All,

I have this crazy idea of auto-unmounting network shares (smbfs, cifs) after a certain period of inactivity for that particuliar share. Mainly because the sharing servers are mostly windows that crashes as usual and sometimes hang my fs in the process.

Any idea how I could script (bash) or program (c) this anyone?

The tricky part is that I need to know the last time a shared drive was accessed, so that I can shut it down (umount) like 10 minutes after last time it was accessed.

Thanks!
_________________
Charle Demers
Back to top
View user's profile Send private message
adsmith
Veteran
Veteran


Joined: 26 Sep 2004
Posts: 1386
Location: NC, USA

PostPosted: Fri Apr 08, 2005 4:19 pm    Post subject: Reply with quote

look into autofs.

it is a filesystem automounter which supports auto-unmount after n seconds of inactivity.

E.g., I have my usb memory stick and cdrom unmount after 1 second of inactivity, so they unmount by the time I can remove the devices. It would work for net filesystems, too
Back to top
View user's profile Send private message
cdemers
n00b
n00b


Joined: 11 Jan 2005
Posts: 2
Location: Montreal

PostPosted: Fri Apr 08, 2005 9:10 pm    Post subject: Reply with quote

Thanks!

I looked into it, but I must say that the doc is not that easy to decypher and the behaviour of autofs is not very clear. For instance I dont exactly understant what is the trigger that makes autofs mount the drives (or is there any such thing)?

Would you be kind enought to share your config files? I think that would help me a lot.

Thanks again!
_________________
Charle Demers
Back to top
View user's profile Send private message
adsmith
Veteran
Veteran


Joined: 26 Sep 2004
Posts: 1386
Location: NC, USA

PostPosted: Fri Apr 08, 2005 11:24 pm    Post subject: Reply with quote

the "trigger" is simply a file in that filesystem being accessed. Hence, autofs.
:D

Here's the howto: http://gentoo-wiki.com/HOWTO_Auto_mount_filesystems_%28AUTOFS%29
Back to top
View user's profile Send private message
curtis119
Bodhisattva
Bodhisattva


Joined: 10 Mar 2003
Posts: 2160
Location: Phoenix, AZ USA, North America, Earth, SOL System, Milky Way, The Universe, The Cosmos, and Beyond.

PostPosted: Sat Apr 09, 2005 8:08 am    Post subject: Reply with quote

This is a support question and is covered in many FAQ's and other threads. Support questions concerning gentoo should not go in OTW. A short howto on using autofs with network drives is here. Moving to duplicate threads.
_________________
Gentoo: it's like wiping your ass with silk.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum