Quantcast
Channel: Active questions tagged automount - Ask Ubuntu
Viewing all articles
Browse latest Browse all 225

Automatically mount CIFS share while connected to a particular network and then automatically unmount either just after or before disconnecting

$
0
0

The problem: I have a laptop (running ubuntu 20.04) which is highly mobile and works from multiple locations. While at location A: I have a CIFS share which I need to work. While not at location A, I don't need this particular CIFS share. If I mount the CIFS share manually using everything works, but I would like to automate the process because I change locations at least 2 - 3 times a day. When I connect to the network at location A, I don't want to manually have to mount the cifs file share, I'd rather just like it to be running. Even more importantly, if I disconnect from location A, I don't want my system to crash because it thinks there should be a file system which doesn't exist anymore. Manually completing these tasks is beginning to be tedious very quickly. How do I get the share to mount automatically while connected to a particular network and then unmount when not connected to that same network?

NOTE:This is not a question about fstab, unless of course you know of a way to get the fstab file to behave in this fashion of constantly switching location and networks and only mounting the file system only in the appropriate location/network. I have an fstab entry for the cifs share which makes mounting and unmounting easier, but doesn't actually solve my problem.


Viewing all articles
Browse latest Browse all 225

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>