Problems mounting NFS shares on Debian
I've been using CentOS mostly over the years but since all the changes triggered by RedHat I've been dipping my toes on Debian. So apologies for the newbie questions.
I've been playing around with TrueNAS Core and created a Debian VM to test Shinobi. The installation went fine but I'm having problems mounting a NFS share.
On CentOS I used to include this line on
<ip>:/exports /mnt/nfs_share nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,_netdev 0 0
On Debian, the share doesn't mount on boot, but it mounts if I run
When I looked at the log I saw the message
mount.nfs: Network is unreachable. It seems
network-online.target - the dependency that
systemd uses to trigger the network mounts - is reached before the DHCP client can get an IP. Therefore the NFS mount fails.
I've google'd for a bit and I found the following possible solutions:
/etc/fstab and let the share be mount on first use.
- My concern is the mount be unmounted if the connection is idle.
networking.service and use
systemd-networkd.service instead and enable
systemd-networkd-wait-online.service. Make all the network changes to move from the default
/etc/network/interfaces to set the network on
- I'm trying to avoid moving away from the default config as much as possible.
(3) Create a new
.mount file inside
- That seems like a lot of work just to create a mount.
What are you all using for your NFS mounts? Particularly when you are assigning the IP using DHCP.