5

I have set up a NFS share on a Ubuntu 21.04 VM, which I want to mount on a Mac OS Big Sur client.

The share lists fine, when checked with showmount, but the mount fails:

andi@iMac-Pro Projects % showmount -e 10.116.0.108
Exports list on 10.116.0.108:
/srv/nfsv4/vsc-docker-projects      10.116.0.0/24
/srv/nfsv4                          10.116.0.0/24

andi@iMac-Pro Projects % sudo mount -t nfs 10.116.0.108:/srv/nfsv4/vsc-docker-projects /Users/andi/Documents/Projects/vsc-docker-projects
mount_nfs: can't mount with remote locks when server (10.116.0.108) is not running rpc.statd: RPC prog. not avail
mount: /Users/andi/Documents/Projects/vsc-docker-projects failed with 74
andi@iMac-Pro Projects %

I have following config on the server:

$ cat /etc/exports
/srv/nfsv4   10.116.0.0/24(rw,sync,root_squash,no_subtree_check,fsid=0)
/srv/nfsv4/vsc-docker-projects 10.116.0.0/24(rw,sync,root_squash,no_subtree_check)

$ cat /etc/fstab
/home/andi/vsc-docker-projects /srv/nfsv4/vsc-docker-projects none bind 0 0

I understand the problem is related to rpc.statd, wich is installed on the system:

$ which rpc.statd
/usr/sbin/rpc.statd

...but obvioulsy not running:

$ ps -ef | grep rpc
root         407       2  0 04:00 ?        00:00:00 [rpciod]
_rpc         648       1  0 04:00 ?        00:00:00 /sbin/rpcbind -f -w
root        2361       1  0 04:21 ?        00:00:00 /usr/sbin/rpc.idmapd
root        2362       1  0 04:21 ?        00:00:00 /usr/sbin/rpc.mountd --manage-gids
andi        2509    1255  0 04:32 pts/0    00:00:00 grep --color=auto rpc

Also starting is not possible:

$ sudo systemctl start rpc.statd
Failed to start rpc.statd.service: Unit rpc.statd.service not found.

$ service start rpc.statd
start: unrecognized service

I there just missing a service file in /etc/systemd/system/? The VM is really newly installed and I just updated it with apt, installed Docker. I can't imagine I broke it in this short time.

Any idea what I could try next? Thanks in advance.

4
  • This one was kinda helpful: forums.macrumors.com/threads/…
    – Jarek
    Commented Aug 16, 2021 at 19:22
  • @Jarek Sorry, can't follow. Which of the 9 posts are you referring to?
    – andreas
    Commented Aug 17, 2021 at 11:10
  • 1
    sorry, indeed. This cmd allowed me to mount from the commandline: sudo mount -o nolocks,resvport,locallocks -t nfs nas-server:/volatile-volume-stripe ~/nfs/volatile
    – Jarek
    Commented Aug 19, 2021 at 8:19
  • 2
    @Jarek I hope you are aware, that you run in danger of loosing / harming your data using this share on more than one client.
    – andreas
    Commented Aug 19, 2021 at 9:23

2 Answers 2

4

Searching around a bit, I found a posting pointing into the right direction.

Activating the service did the trick:

# check status on rpcbind.service
systemctl status rpcbind.service
systemctl reenable rpcbind.service
systemctl restart rpcbind.service

# check status on rpc-statd.service
systemctl status rpc-statd.service
systemctl reenable rpc-statd.service
systemctl restart rpc-statd.service

Now I get a message related to rights, which for sure is a step forward:

andi@iMac-Pro Projects % sudo mount -t nfs 10.116.0.108:/srv/nfsv4/vsc-docker-projects /Users/andi/Documents/Projects/vsc-docker-projects
Password:
mount_nfs: can't mount /srv/nfsv4/vsc-docker-projects from 10.116.0.108 onto /Users/andi/Documents/Projects/vsc-docker-projects: Operation not permitted
mount: /Users/andi/Documents/Projects/vsc-docker-projects failed with 1
andi@iMac-Pro Projects %

A some additions in the server's /etc/exports did the trick:

/srv/nfsv4/vsc-docker-projects 10.116.0.109/24(rw,sync,root_squash,no_subtree_check,anonuid=1000,anongid=1000,insecure)

The share is only exposed to an other VM on the same host. Hence, insecure should be fine.

Now just add an entry in the clients /etc/fstab and we are ready to roll:

10.116.0.108:/srv/nfsv4/vsc-docker-projects     /Users/andi/Documents/Projects/vsc-docker-projects      nfs auto 0 0
1
  • 3
    Thanks, this fixed it. In between edits of /etc/exports I had to run exportfs -a and restart the nfs service with systemctl restart nfs-kernel-server After it's working in the terminal, mounting the share through Finder's command+k works too. Commented Apr 22, 2022 at 14:53
4

I've just upgraded from MacOS Catalina to Monterey and got the following error when trying to mount

mount_nfs: can't mount with remote locks when server (<remote_server>) is not running rpc.statd: RPC prog. not avail

I was trying to use the following command

sudo mount -t nfs -o resvport remote_server:/home/myuser/src /Users/myuser/Development/src

To fix it, I had to tell my MacOs to default to NFSv4 by changing the file nfs.conf

sudo vi /etc/nfs.conf
nfs.client.mount.options = vers=4

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .