Feature request: Auto try to reconnect NFS backup targets if they went offline between two backup tasks.
-
I use a nfs target for backups. and sometimes i have to restart some servers or routers or vpn. and even sometimes after this the backup volume is not mounted.
then the next backup fails. and the only thing i have to do is to click "remount storage" one time, 1 second later the mountpoint is green again and then i can manually start a new backup or wait for the automatic one.
it would be nice, if the backup task clicks the remount storage button for me
i am not sure if this is a feature request or a bug report
-
@holm yeah agreed. I am not sure why the kernel or the filesystem doesn't have a mechanism for this. We want this for CIFS and SSHFS as well.
Does anyone know if there is any obvious reconnection mechanism? FWIW, we use systemd mounts.
-
It seems that one can setup an "automount" that will make systemd automatically mount when a mount is accessed . It's unclear if this also applies to mount failures or just "not ever mounted". If someone wants to try, I think we need something like this:
-
The systemd unit file must be named
systemd-escape -p --suffix=automount <HOSTPATH>
-
Then, create a file
/etc/systemd/system/<unit_filename_from_above_command>
:
[Unit] Description=Automount of hostpath [Automount] Where=HOST_PATH_HERE [Install] WantedBy=multi-user.target
systemctl enable <unit_filename>
If that works, I can put this in our code (for volumes and backups).
-