Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Dec 2016 22:04:41 +0000
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        Jordan Ladora <vicepresjoebiden@gmail.com>, "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   Re: File duplication on NFSv4 exported ZFS filesystems to centos client
Message-ID:  <YTXPR01MB01898AEAA3BBC09ACDF3E338DD8E0@YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM>
In-Reply-To: <CAKC6PD2seS%2BPYNL-xCJ7L%2BRQTh8k83h64-ukbWTq90fnSd=k_A@mail.gmail.com>
References:  <CAKC6PD2seS%2BPYNL-xCJ7L%2BRQTh8k83h64-ukbWTq90fnSd=k_A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Jordan Ladora wrote:
>Curious phenomenon of file pseudo-dup with exported ZFS filesystems on
>FreeBSD 10.3-REL NFSv4 export to a centos7 client.
>
>
>*FreeBSD server-*
>
>zpool create zpool_nfsv4 ...
>
>zfs create zpool_nfsv4/zfs2
>
>zfs create zpool_nfsv4/zfs3
>
>
>/etc/exports-
>
>V4: /
>
>/zpool_nfsv4
>
>/zpool_nfsv4/zfs2
>
>/zpool_nfsv4/zfs3
>
>
>zfs unshare -a
>
>
>*Centos client-*
>
>mkdir /zpool_nfsv4
>
>mkdir /zpool_nfsv4_zfs2
>
>mkdir /zpool_nfsv4_zfs3
>
>mount -t nfs4 -o rw,intr,hard,proto=3Dtcp,nodev,noexec,nosuid
>10.0.100.100:/zpool_nfsv4
>/zpool_nfsv4
>
- I'll call this mount #2.
>mount -t nfs4 -o rw,intr,hard,proto=3Dtcp,nodev,noexec,nosuid
>10.0.100.100:/zpool_nfsv4/zfs2
>/zpool_nfsv4_zfs2
- I'll call this mount #3.
>mount -t nfs4 -o rw,intr,hard,proto=3Dtcp,nodev,noexec,nosuid
>10.0.100.100:/zpool_nfsv4/zfs3
>/zpool_nfsv4_zfs3
By default (unlike NFSv3) NFSv4 mounts the entire tree of file systems
under the mount point and not just the file system being mounted.
You have two choices:
1 - Don't do mount #2 or mount #3. The first mount should allow you to
     access /zpool_nfsv4/zfs2 and /zpool_nfsv4/zfs3 with the addition mount=
s.
OR
2 - Turn of the "whole tree" behaviour on the server via:
# sysctl vfs.nfsd.mirrormnt=3D0
on the FreeBSD server.
(I know, mirrormnt is a weird name for it, but that is what Linux used, so.=
..
 I guess it means "mirror the tree of mounted file systems on the server to=
 the clients".)
[stuff snipped]
>This seems similar to this (https://serverfault.com/quest
>ions/535318/creating-two-nfs-shares-from-same-server-but-
>when-mounted-both-point-to-same-d) thread with NFSv4 exports on a centos
>server, but I cannot find anything similar to what I see here with a
>FreeBSD NFSv4 server.
What you did definitely had the same file systems mounted multiple times,
so I suspect that is what caused this behaviour.

rick





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YTXPR01MB01898AEAA3BBC09ACDF3E338DD8E0>