Score:2

Can't mount NFS share on Mac OS Big Sur shared from Ubuntu 21.04 - rpc.statd not running

cn flag

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.

Jarek avatar
cn flag
This one was kinda helpful: https://forums.macrumors.com/threads/since-upgrading-to-big-sur-i-can-not-longer-mount-remote-nfs-drives.2274862/
cn flag
@Jarek Sorry, can't follow. Which of the 9 posts are you referring to?
Jarek avatar
cn flag
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`
cn flag
@Jarek I hope you are aware, that you run in danger of loosing / harming your data using this share on more than one client.
Score:1
cn flag

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 one another 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
noranraskin avatar
jp flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.