I want to automatically mount two NFS volumes which reside on a different machine at boot, that contain persistent volumes for some of my docker containers. I've followed some guides I found online, and added the remote NFS directory to the /etc/fstab file, currently looking like this (I played around with the options trying to get it to work, mostly relying on https://help.ubuntu.com/community/Fstab#Options and a few forum posts):
Code: Select all
# external storage directory mount
10.8.0.15:/volume/storage /home/docker/mount/storage nfs auto,rw,noexec,user,_netdev 0 0
One of the solutions mentioned often is to use autofs instead of specifying as fstab entries. I couldn't really discern whether that still holds up today: I try to stick to minimal solutions to avoid unnecessary complexity. I'd rather use the OS's features than installing an extra package; moreover, autofs seems to be built for a different use case - all I need is static volume mounts.
Desperate for a solution, I tried to execute a shell script at bootup to run ```mount -a```, but this didn't work either. I didn't investigate properly, and I'm not sure what permissions scripts executed by update-rc.d run with, maybe this was an issue... a lot of forum entries however speculated that network components not yet being available might be the cause for NFS volumes in fstab not mounting, which would then be true for the script as well?
Can anyone point me in the right direction regarding log files or other avenues I could investigate to resolve my issue? I'm desperate to get this working by now. For context, I'm running Debian bookworm in a minimal install.