Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jan 2020 09:07:41 -0500
From:      mike tancsa <mike@sentex.net>
To:        Andriy Gapon <avg@FreeBSD.org>, freebsd-fs <freebsd-fs@freebsd.org>
Subject:   Re: export a zfs snapshot over nfs
Message-ID:  <de2407ea-9238-8097-f04d-b6c6138cf1a4@sentex.net>
In-Reply-To: <b920d014-2151-a638-bb27-cef165229aca@FreeBSD.org>
References:  <62fc92d6-7a31-9dac-d237-082cc71d0dd9@sentex.net> <b920d014-2151-a638-bb27-cef165229aca@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 1/26/2020 10:53 AM, Andriy Gapon wrote:
> On 24/01/2020 17:33, mike tancsa wrote:
>> On a backup server, I want to export a zfs snapshot via nfs, but I cant
>> seem to do it.
>>
>> given the snapshot is
>> backup2/zrepl/sink2/nfserver1/images/vms@zrepl_20190902_122114_000
>>
>> I can do something locally like
>>
>> mkdir /tmpmount
>>
>> add
>>
>> /tmpmount       -maproot=nobody   192.168.13.36
>>
>> and from the client machine mount /tmpmount.
>>
>> But if I do on the server
>>
>> mount -t zfs
>> backup2/zrepl/sink2/nfserver1/images/vms@zrepl_20190902_122114_000 /tmpmount
>>
>> and then try and mount from the client, I get a permission denied.
>>
>> I can work around it by creating a quick clone of the snapshot and
>> mounting the clone.  But was curious as to why I cant do it the first way ?
>>
>> server is releng12 and nfsv3
> Have you tried to navigate to the snapshot from the filesystem mount via
> .zfs/snapshot ?
>
Thanks to everyone who replied. I can indeed mount the snapshot on nfsv4
by going directly to it

So if I have something like

slowtank/tmp and a snapshot called slowtank/tmp@clean2019-server

mount -t nfs 192.168.242.1:/slowtank/tmp/.zfs/snapshot/clean2019-server /mnt

I can indeed do this on nfsv4

On nfsv3, I have to have on the exports line keep it to ,

/slowtank/tmp/.zfs/snapshot

having

/slowtank/tmp/.zfs/snapshot/clean2019-server

gives a "bad exports line" when I restart mountd.

But other than that, it works.

When I have time, I will move the main server in question to nfsv4 as it
seems more flexible.  But for now, between clones, direct snapshot
mounts etc, I am able to get done what I need to.

    ---Mike






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?de2407ea-9238-8097-f04d-b6c6138cf1a4>