Some NFS server V4 questions

Rick Macklem rmacklem at
Sun Oct 26 12:14:06 UTC 2014

Beeblebrox wrote:
> Sorry guys, we have a considerable time-zone difference.
> >> It appears that the sysctl must be set before mountd, nfsd are
> >> started to take effect. (Or they must be restarted after it is
> >> set.)
> I had apparently re-started nfsd but not mountd. This time
> re-starting both and launching the PXE client fails at mount_root
> stage as expected:
> exec /sbin/init: error 43
> exec /rescue/init: error 43
> panic: no init
> One cannot set "sysctl vfs.nfsd.server_min_nfsvers=4" until one of
> mountd/nfsd is started however, otherwise it gives an error. I have
> not tried, but I suppose this error does not happen when placeed in
> /etc/sysctl.conf?
> sysctl: unknown oid 'vfs.nfsd.server_min_nfsvers': No such file or
> directory
It works if it is /etc/sysctl.conf if "options NFSD" are specified
for the kernel, which is what GENERIC for i386 has.

If "options NFSD" isn't in your kernel config, I think you'd have to
get nfsd.ko loaded before setting the sysctl and do both before
starting mountd.

I don't know of a clean way to do this?

Putting kldload and sysctl command lines in mountd_precmd() in
/etc/rc.d/mountd would do it I suspect. Maybe rc variables for
this should be added? (I haven't tried this since the only
kernels I have handy have "options NFSD" in them.)


> >> Maybe it was the talk about getting rid of the oldnfs stuff that
> >> made you think V2, 3 were going away?
> Yes, that was it and I obviously misunderstood that thread.
> What's the max NFS version that supports mount_root from PXE clients
> then? As I recall, this would be V3. However, root is consistently
> being mounted as V2.
> The fstab for diskless clients:
> /       nfs     ro,nfsv3        0  0
> /usr/local nfs   ro,nfsv4        0  0
>       /home   nfs     rw,nfsv4,hard,intr      0  0
> nfsstat shows "/" as NFSV2, while the other two are NFSV4. Changing
> fstab entry to nfsv4 for root gives same result.
> I tried set "sysctl vfs.nfsd.server_min_nfsvers=3" and I get the same
> mount_root error as when this was set to 4. Im I missing something?
> It does not seem that "vfs.nfsd.server_min_nfsvers" will be of much
> use to me, unless I can get > V2 to mount as root.
> Regards.
> -----
> FreeBSD-11-current_amd64_root-on-zfs_RadeonKMS
> --
> View this message in context:
> Sent from the freebsd-current mailing list archive at
> _______________________________________________
> freebsd-current at mailing list
> To unsubscribe, send any mail to
> "freebsd-current-unsubscribe at"

More information about the freebsd-current mailing list