# NFSv4 documentation



## serverhamster (Feb 23, 2012)

I'm looking for the proper way to set up NFSv4. Since version 9.0 this is the default, however the handbook contains no mention of version 4.

I haven't tried it on my upgraded servers yet, but I'm trying to connect a BSD client to a Solaris 10 server. Based on mount_nfs(8)(), I have put the following line in /etc/fstab:

```
server:/aux    /aux    nfs    rw,nfsv4    0 0
```
When mounting, /aux shows the correct contents, but everything is owned by root:weel. In Linux, I would enable idmapd, but I can't find out how to do this in FreeBSD.

On the client, I have only set this option in /etc/rc.conf:

```
nfs_client_enable="YES"
```


----------



## kpa (Feb 23, 2012)

Here's my /etc/rc.conf settings for NFSv4 on the server:


```
rpcbind_enable="YES"
nfs_server_enable="YES"
nfsv4_server_enable="YES"
nfsuserd_enable="YES"
mountd_enable="YES"
mountd_flags="-r"
```

In /etc/exports I have:

```
/usr/ports -ro -maproot=root -network 10.71.13.0/24
/usr/src -ro -maproot=root -network 10.71.13.0/24
V4: /
```

On a client I have this in /etc/rc.conf

```
nfs_client_enable="YES"
nfsuserd_enable="YES"
```

On the client's /etc/fstab I have:


```
server:/usr/src /usr/src nfs ro,nfvsv4,late 0 0
server:/usr/ports /usr/ports nfs ro,nfsv4,late 0 0
```


----------



## Crest (Feb 23, 2012)

See nfsv4(4).


----------



## serverhamster (Feb 23, 2012)

I see. I missed a service in /etc/rc.conf

```
nfsuserd_enable="YES"
```

Together with the FQDN as part of *hostname* in /etc/rc.conf this works. Now I only have to make sure the same users and groups exist on both machines or learn LDAP.

In the meantime, I found out that the helper programs to map usernames and UIDs have different names: nfsmapid on Solaris, rpc.idmapd on Debian, and nfsuserd on FreeBSD. (Thanks Michael W. Lucas)


----------

