nfsv4 file ownership

Michael W. Lucas mwlucas at
Tue Sep 15 19:08:49 UTC 2015


I think I fundamentally misunderstand something on how nfsv4 maps
usernames. Everything works fine... until I start nfsuserd.

I have a NFSv4 server on my test network. It's enabled with these
rc.conf flags.

nfs_server_flags="-uth -n6"
mountd_flags="-r -l"

server# uname -a
FreeBSD storm 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r287374: Tue Sep  1 15:31:17 EDT 2015     root at storm:/usr/obj/usr/src/sys/GENERIC  amd64

client# uname -a
FreeBSD freebsd 10.1-RELEASE FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 21:02:49 UTC 2014     root at  amd64

The exports file contains:

V4: /home

Usernames and UIDs are matched for the test user.

server# getent passwd mwlucas

client# getent passwd mwlucas

I mount a directory with:

# mount -o nfsv4 storm:/mwlucas /mnt

When nfsuserd is running, all files in /mnt/ are owned by
root:wheel. Running in verbose mode, I get log messages like:

Sep 15 14:41:13 storm nfsuserd:[1730]: Added uid=0 name=root
Sep 15 14:41:13 storm nfsuserd:[1729]: Added gid=0 name=wheel
Sep 15 14:41:13 storm nfsuserd:[1730]: Added uid=10001 name=mwlucas
Sep 15 14:41:13 storm nfsuserd:[1730]: Added gid=10001 name=mwlucas

If I stop nfsuserd, unmount the directory, and remount, all files have
their correct ownership.

Isn't nfsuserd supposed to give the correct usernames? What am I
missing here?

Any help appreciated!


Michael W. Lucas  -  mwlucas at, Twitter @mwlauthor,

More information about the freebsd-questions mailing list