I’m trying to get Network File System working on my nixos box. Here is the relevant configuration:
fileSystems."/export/sea5" = {
device = "/mnt/sea5";
options = [ "bind" ];
};
services.nfs.server.enable = true;
services.nfs.server.exports = ''
/export 192.168.1.*(rw,fsid=0,no_subtree_check)
/export/sea5 192.168.1.*(rw,nohide,insecure,no_subtree_check)
'';
I’ve also opened port 2049:
networking.firewall.allowedTCPPorts = [
4000
4001
4002
4003
2049
];
The /export/sea5
correctly binds:
[tbrowne@bee:~]$ ls -lh /export/sea5
total 0
drwxr-xr-x 1 tbrowne users 62 Jun 24 2024 compare_trace
drwxr-xr-x 1 tbrowne users 48 Dec 18 20:02 data
drwx------ 1 tbrowne users 76 Sep 4 13:23 Dropbox-Personal
drwxr-xr-x 1 tbrowne users 26 Sep 20 01:07 dumps
drwxr-xr-x 1 tbrowne users 0 Jan 14 08:29 scratch
it’s no owner and no group for both /export
and /export/sea5
:
[tbrowne@bee:/]$ ls -lh /export
total 16K
drwxr-xr-x 1 nobody nogroup 90 Jan 11 08:16 sea5
[tbrowne@bee:/]$ ls -lh /
total 8.0K
drwxr-xr-x 1 root root 4 Jan 18 22:40 bin
drwxr-xr-x 4 root root 8.0K Jan 1 1970 boot
drwxr-xr-x 19 root root 3.4K Jan 18 22:40 dev
drwxr-xr-x 1 root root 1.2K Jan 18 22:40 etc
drwxr-xr-x 1 nobody nogroup 8 Jan 16 11:43 export
drwxr-xr-x 1 root root 14 May 2 2024 home
drwxr-xr-x 1 root root 26 Jan 9 23:42 lib
drwxr-xr-x 1 root root 40 Jan 9 23:42 lib64
drwxrwxrwx 1 root root 16 Jul 7 2024 mnt
drwxr-xr-x 1 root root 16 May 2 2024 nix
dr-xr-xr-x 241 root root 0 Jan 18 22:39 proc
drwx------ 1 root root 116 May 19 2024 root
drwxr-xr-x 24 root root 660 Jan 18 23:09 run
drwxr-xr-x 1 root root 0 May 2 2024 srv
dr-xr-xr-x 13 root root 0 Jan 18 23:14 sys
drwxrwxrwt 1 root root 3.1K Jan 18 23:00 tmp
drwxr-xr-x 1 root root 6 May 2 2024 usr
drwxr-xr-x 1 root root 82 May 2 2024 var
yet:
[tbrowne@bee:/]$ sudo mount -t nfs localhost:/export/sea5 /home/tbrowne/scratch/sea5
[sudo] password for tbrowne:
mount.nfs: access denied by server while mounting localhost:/export/sea5
(yes /home/tbrowne/scratch/sea5
does exist):
[tbrowne@bee:~/scratch/sea5]$ pwd
/home/tbrowne/scratch/sea5
What’s going wrong?