How to remount drives which lost connection?

ubuntu-users-list at thomas.freit.ag ubuntu-users-list at thomas.freit.ag
Sun Jun 12 14:37:39 UTC 2022


Hi Bo,

On 11.06.22 22:39, Bo Berglund wrote:
> I have a Linux Mint installation which sits on a remote location where the
> router provides a VPN connection to my main LAN.
> This Mint device seems to sometimes lose connection to an nfs share on the main
> LAN defined in fstab as follows:
> 
> 192.168.119.216:/home/bosse/www/VIDEO /mnt/video nfs tcp,noexec,intr 0 0
> 
> What happens is that the share is sometimes not connected when I need to use it
> and at those times this command fixes the problem:
> 
> sudo mount -a
> 
> I would like the system to reconnect if the connection is for some reason lost,
> can this be done?

I would recommend to use an automounter to mount it automatically, if you need it
(i.e. on directory access) and unmount it after use. That is way better than trying
to workaround your issues.

You could use autofs (extra package) or systemd for that.

I believe https://help.ubuntu.com/community/Autofs is a good starting guide and
https://manpages.ubuntu.com/manpages/xenial/man5/systemd.mount.5.html (section
FSTAB) is a good reference for the systemd parts.

-- 
hth,
Thomas




More information about the ubuntu-users mailing list