The nfs server has been working without issue through a couple versions of Ubuntu now.
Today I was rebuilding one of my exported disks so stopped the nfs server, rebuilt the disk, then attempted to restart the nfs server. System complained:
proc-fs-nfsd.mount is masked
I found this question below which identifies the issue as a null service definition, and this is the explanation I found in other links. However in my case the service definition link is not to /dev/null so I don't know what's going on my case. (I don't see how the other answers to the linked question apply)
Below you can see that the service link points to an actual file.
systemctl start nfs-kernel-server
Failed to start nfs-kernel-server.service: Unit proc-fs-nfsd.mount is masked.
systemctl unmask proc-fs-nfsd.mount
systemctl start nfs-kernel-server
Failed to start nfs-kernel-server.service: Unit proc-fs-nfsd.mount is masked.
file /lib/systemd/system/proc-fs-nfsd.mount
/lib/systemd/system/proc-fs-nfsd.mount: ASCII text
Originally put as answer but failed after reboot
The most common fix I've seen is to remove the link to
/dev/null
, butfile /lib/systemd/system/proc-fs-nfsd.mount /lib/systemd/system/proc-fs-nfsd.mount: ASCII text
However I deleted this file anyway and discovered that
lib/systemd/system/proc-fs-nfsd.mount
was linked to/dev/null
, so I deleted that and reloaded the daemons.sudo rm /lib/systemd/system/proc-fs-nfsd.mount sudo systemctl daemon-reload
And then restarted the nfs service
sudo systemctl restart nfs-kernel-server.
This succeeded.
Server worked well until it was restarted. It then failed:
systemctl start nfs-kernel-server
Failed to start nfs-kernel-server.service: Unit proc-fs-nfsd.mount not found
The currently working fix is
sudo cp /etc/exports ~
sudo apt purge nfs-kernel-server
sudo apt install nfs-kernel-server
sudo cp /etc/exports ~/exports.installed
sudo cp ~/exports /etc
sudo systemctl restart nfs-kernel server
systemctl status nfs-kernel-server
There is now a working NFS server.
rm ~/exports ~/exports.installed
However I am not confident that all is well so I will not put this as an answer.