# NFSv4 and Mounted Filesystem



## displaced (Apr 6, 2015)

Hi,

I have NFSv3 set up and running fine.  However, I'd like to give v4 a try just to compare performance.  My server is FreeBSD 10.0-RELEASE and my clients are Mac OS X 10.10.

Currently, I have NFSv3 sharing two ZFS filesystems and an external HD (UFS filesystem), mounted at /mnt/exthd.

I started small and created a test directory, set its ownership/permissions appropriately and added this to my /etc/exports:

```
V4: /test  -sec=sys  minerva.home
```
...and this worked fine - I mounted that share from my laptop (minerva.home) and everything looked good - read/write access and ownership looked fine from the client.

So then I tried to export my external HD as shown:

```
V4: /mnt/exthd -sec=sys  minerva.home
```
Again, this mounted correctly.  But the client showed an empty folder.  On a hunch, I unmounted /mnt/exthd on the server and created a file.  This file then showed up on the client.

So it seems the client is only seeing the mount-point, not the mounted filesystem.

I've searched a lot for this problem, but haven't seen anything that would help.   Does anyone have any ideas?

For info, the command I'm using to mount from OS X is below.  I wasn't sure that the OS X NFS client would prefer v4 over v3 so thought I'd better force it!

```
mount -t nfs -o nfsvers=4 trillian.home:/   /Volumes/foo/
```


----------



## junovitch@ (Apr 7, 2015)

My understanding of the V4: tag is that it doesn't work that way to present a normal mount point.  It just sets the root of the mounts.  See exports(5)


> The third form has the string ``V4:'' followed by a single absolute path name, to specify the NFSv4 tree root.  This line does not export any file system, but simply marks where the root of the server's directory tree is for NFSv4 clients.  The exported file systems for NFSv4 are specified via the other lines in the exports file in the same way as for NFSv2 and NFSv3.  The pathnames must not have any symbolic links in them and should not have any ``.'' or ``..'' components.  Mount points for a file system may appear on multiple lines each with different sets of hosts and export options.



In this case, does this /etc/exports work?

```
V4: /mnt/exthd -sec=sys  minerva.home
/mnt/exthd -sec=sys  minerva.home
```


----------

