NFSv4 and pam_mount - mounting user home directories.

Marek Salwerowicz salwerom at
Sun Jan 9 15:37:15 UTC 2011

> It just worked for me. Try setting the sysctl before starting nfsd. If
> you are starting the daemons manually for a kernel that doesn't have
> "options NFSD" do:
> # nfsuserd
> # mountd -e -r
> # sysctl vfs.newnfs.server_min_nfsvers=4
> # nfsd -e -u -t -n 8
> - mountd -e loads the module, so you can do the sysctl after that and before
>    starting the nfsd. (Or build a kernel with "options NFSD" and do the sysctl
>    anytime before starting the nfsd.)
> rick
> ps: I tested the FreeBSD-8 client. Other clients may not even talk to the NFS
>     server during mounting. For those, the mount would succeed, but subsequent
>     use of the mount won't work.
I tested it on 8.1 Release (GENERIC) i386 (two VMs):


made modification in /etc/exports:
V4: /usr -sec=sys -network -mask
/usr/home -sec=sys -network -mask

nfs4-server# nfsuserd
nfs4-server# mountd -e -r
nfs4-server# sysctl vfs.newnfs.server_min_nfsvers=4
vfs.newnfs.server_min_nfsvers: 2 -> 4
nfs4-server# nfsd -e -u -t -n 8

but now client is unable to mount both nfsv4 and nfsv3:

nfs4-client# mount_nfs -o nfsv4 /tmp/nfs4/
[tcp] nfsd: RPCPROG_NFS: RPC: Remote system error 
- Connection refused
nfs4-client# mount_nfs /tmp/nfs3/
^C (hangs for a long time)

Marek Salwerowicz

More information about the freebsd-current mailing list