Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using FreeBSD 9, and created a ZFS file system like so

zfs create tank/project1
zfs set sharenfs=on tank/project1

There are many howto's on setting up NFSv3 on FreeBSD on the net, but I can't find any one NFSv4 and when the NFS share is done with ZFS.

E.g. this howto say I have to restart the (NFSv3) by nfsd -u -t -n 4, but I don't even have nfsd.

When I do

# echo /usr/ports/*/*nfs*
/usr/ports/net-mgmt/nfsen /usr/ports/net/nfsshell /usr/ports/net/pcnfsd /usr/ports/net/unfs3 /usr/ports/sysutils/fusefs-chironfs /usr/ports/sysutils/fusefs-funionfs /usr/ports/sysutils/fusefs-unionfs

I don't see any NFSv4 servers, which I could install with pkg_add.


How do I install and setup NFSv4, so I can mount the share from e.g. a Linux host?

share|improve this question
up vote 6 down vote accepted

NFSv4 is built in to FreeBSD (Experimental support in 8.x, production quality in 9.x and lter).
The nfsd should be located in /etc/rc.d/nfsd

You should first enable it into rc.conf file or /etc/rc.d/nfsd onestart

1) Enable nfs
echo nfs_server_enable="YES" >> /etc/rc.conf

For NFSv4 you will also need the following:

echo nfsv4_server_enable="YES" >> /etc/rc.conf (To enable NFSv4)
echo nfsuserd_enable="YES" >> /etc/rc.conf (The NFS user/group info needed for v4)

2) Create directories and export them

# mkdir -p /mnt/{dir1,dir2}
# vi /etc/exports 

(add the following lines to the /etc/exports file)

/mnt/dir1  -alldirs  192.168.1.x/24
/mnt/dir2  -alldirs  192.168.1.x/24

3) restart nfsd either using /etc/rc.d/nfsd restart or service nfsd restart

See The section of the FreeBSD handbook dealing with NFS for more information.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.