Nfs mounting script – rpc-statd.service error

Hi everyone,

I have troubles mounting by hand nfs directories on my laptop. I have installed nfs-utils-2.4.1 and services.rpcbind.enable is set to true.

However, here is what I get:

[tcip@tlap:~]$ sudo mount -t nfs <nas-folder> <local-folder>
Failed to start rpc-statd.service: Unit rpc-statd.service not found.

Any idea where I got wrong?

PS: I’m running

  • OS: NixOS 19.09.1590.d85e435b7bd (Loris)
  • Kernel: x86_64 Linux 5.4.3
  • Shell: bash 4.4.23

Thanks and all the best,

To give more information, that worked when I used fileSystems (see below) but I need a script to mount at will, since I’m not always working on my home network.

# NFS and partition mount
  fileSystems =
    let
      mountFolders = {folderPath, folderName, fsType}:
        {
          mountPoint = "/mnt/${folderName}";
          device = "${folderPath}";
          fsType = "${fsType}";
        };
    in map mountFolders
      [ { folderPath = "<nas-folder>"; folderName = "<local-folder>"; fsType = "nfs"; }
        …
      ];

What did I miss to mount with my script, that NixOS is doing when using fileSystems?

Sorry to bump again into my post, but I’m lost and I need to sort things out as soon as possible… I tried to restart rpcbind.service but it’s still not working.

Maybe more information might help:

[tcip@tlap:~]$ systemctl status rpcbind.service 
● rpcbind.service - RPC Bind
   Loaded: loaded (/nix/store/lhibl3d0wp3pz5gwg0vjw5diai5x8x80-rpcbind-1.2.5/etc/systemd/system/rpcbind.service; enabled; vendor preset: enabled)
  Drop-In: /nix/store/0blmb8c2axj0s7xxpkh36p5fifzjalcm-system-units/rpcbind.service.d
           └─overrides.conf
   Active: active (running) since Wed 2019-12-18 00:18:26 CET; 13min ago
     Docs: man:rpcbind(8)
 Main PID: 508 (rpcbind)
       IP: 0B in, 0B out
    Tasks: 1 (limit: 4915)
   Memory: 4.0M
      CPU: 16ms
   CGroup: /system.slice/rpcbind.service
           └─508 /nix/store/lhibl3d0wp3pz5gwg0vjw5diai5x8x80-rpcbind-1.2.5/sbin/rpcbind -w -f

[tcip@tlap:~]$ sudo mount.nfs -v 192.168.0.1:/volume1/backup /mnt/NAS/backup
mount.nfs: timeout set for Wed Dec 18 00:38:05 2019
mount.nfs: trying text-based options 'vers=4.2,addr=192.168.0.1,clientaddr=192.168.0.3'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=192.168.0.1,clientaddr=192.168.0.3'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'vers=4,addr=192.168.0.1,clientaddr=192.168.0.3'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'addr=192.168.0.1'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.0.1 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.0.1 prog 100005 vers 3 prot UDP port 892
mount.nfs: mount(2): Device or resource busy
mount.nfs: Protocol not supported

[tcip@tlap:~]$ rpcinfo -p 192.168.0.1
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100005    1   udp    892  mountd
    100005    1   tcp    892  mountd
    100005    2   udp    892  mountd
    100005    2   tcp    892  mountd
    100005    3   udp    892  mountd
    100005    3   tcp    892  mountd
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100021    1   udp  46283  nlockmgr
    100021    3   udp  46283  nlockmgr
    100021    4   udp  46283  nlockmgr
    100021    1   tcp  34985  nlockmgr
    100021    3   tcp  34985  nlockmgr
    100021    4   tcp  34985  nlockmgr
    100024    1   udp  59025  status
    100024    1   tcp  37562  status

[tcip@tlap:~]$ tracepath 192.168.0.1
 1?: [LOCALHOST]                      pmtu 1500
 1:  HELLDRAK-NAS.local                                    0.398ms reached
 1:  HELLDRAK-NAS.local                                    0.307ms reached
     Resume: pmtu 1500 hops 1 back 1

Anyone having an idea?

Sorry for the noise – I’ve recompiled my configuration files, restarted, and even if I get this error, my folders are mounted… :pleading_face:

Thanks to all involved for your tremendous work and all the best,