Greetings,
I am in the process of migrating away from truenas to nixos. So I have a client and server both running nixos unstable.
Here is the relevant snippet of my server config. I have verified that the directory is exported using showmount
from the client.
{
config,
lib,
...
}:
let
enable = builtins.elem "storage" config.roles;
in
{
config = lib.mkIf enable {
boot.kernelModules = [ "nfsd" "rpc_pipefs" ];
networking.firewall.allowedTCPPorts = [ 111 2049 4000 4001 4002 20048 ];
networking.firewall.allowedUDPPorts = [ 111 2049 4000 4001 4002 20048 ];
services.nfs.server = {
enable = true;
statdPort = 4000;
lockdPort = 4001;
mountdPort = 4002;
exports = ''
/mnt/tank/Files *(rw,sync,no_subtree_check,sec=sys,root_squash,no_all_squash)
/export *(rw,fsid=0,no_subtree_check)
/export/test *(rw,nohide,insecure,no_subtree_check)
'';
};
boot.zfs.extraPools = [ "tank" ];
};
}
Then on the client when I try to mount the directory I get mount.nfs: Protocol not supported for server:/mnt/tank/Files on /mnt/tank/Files
. I have tried mounting manually, i.e mount -t nfs4 server:/mnt/tank/Files /mnt/tank/Files/
and using nix, i.e.
{
config = {
boot.kernelModules = [ "nfs" ];
boot.supportedFilesystems = [ "nfs" ];
fileSystems = {
"/mnt/tank/Files" = {
device = server + ":/mnt/tank/Files";
fsType = "nfs";
options = [
"defaults"
"nofail"
"vers=4.2"
];
};
};
};
}
I have also tried following the nfs wiki page and the same thing happens when I try mount -t nfs4 server:/test temp
.
What am I doing wrong?