NFSv4 bug: nfs-config.service fails to apply --no-nfs-version after a reboot Server kernel version: 4.15.0-1043 Distribution: Ubuntu 18.04.2 LTS nfs-utils version: 1:1.3.4-2.1ubuntu5.2 Summary There are various configuration options for the nfs server that reside in '/etc/default/nfs-kernel-server'. To disable NFS versions 4.1 and 4.2, you can specify: RPCNFSDOPTS="--no-nfs-version 4.1 --no-nfs-version 4.2" The nfs-config.service consumes the above RPCNFSDOPTS and creates RPCNFSDARGS that the nfs-server.service will pass to rpc.nfsd(8) for its ExecStart (see results below). $ cat /var/run/sysconfig/nfs-utils PIPEFS_MOUNTPOINT=/run/rpc_pipefs RPCNFSDARGS="--no-nfs-version 4.1 --no-nfs-version 4.2 64" RPCMOUNTDARGS="" STATDARGS="" RPCSVCGSSDARGS="" SVCGSSDARGS="" In turn, rpc.nfsd parses the version info from RPCNFSDARGS and writes it as "-4.1 -4.2 -2 +3 +4" to '/proc/fs/nfsd/versions' However, after a reboot, the initial state of versions is "-2 -3 -4 -4.0 -4.1 -4.2" (i.e. nothing is yet enabled) so the kernel ignores the '-4.1' and '-4.2' since it thinks 4 is not enabled. See https://elixir.bootlin.com/linux/v4.15/source/fs/nfsd/nfsctl.c#L608 Note that if rpc.nfsd had written versions as "+3 +4 -4.1 -4.2 -2" then the attempt to remove 4.1 and 4.2 would have succeed. As a work-around you can write '+4' to `/proc/fs/nfsd/versions` after a reboot before the nfs-server.service runs rpc.nfsd Thanks, Don