I’m encountering a very strange issue when mounting a nfs share through systemd mount from a trueNAS server. On TrueNAS I have disabled nfs version 3, and only enabled version 4.
The issue that I have, is that when I want to start my systemd mount service, it fails every time, unless I enable NFS version 3 support on trueNAS. My systemd mount file looks as following:
[Unit]
Description=Mount the NFS share for data storage
After=network.target
[Mount]
What=10.0.0.1:/mnt/data-dock/storage
Where=/mnt/data
Type=nfs
Options=_netdev,auto,vers=4.2
[Install]
WantedBy=multi-user.target
However, doing it directly through the command line with the command below works with NFS version 4:
sudo mount -t nfs 10.0.0.1:/mnt/data-dock/storage /mnt/data -o defaults,hard,intr,vers=4.2,_netdev,auto
The logs give me a bit more information:
mount.nfs: access denied by server while mounting 10.0.0.1:/mnt/data-dock/storage
At first I thought that systemd mount for some reason falls back to version 3 and thus is getting the access denied as NFS v3 is disabled on trueNAS, but then I tried mounting a NFS share from a Synology with systemd mount, and it works flawless.
So I’m almost certain that it is a trueNAS issue.
I have tried it with Ubuntu, Rocky linux 9, Debian bookworm and all have the same issue.
Thanks and best regards