Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Oct 2021 16:37:17 -0700
From:      David Christensen <dpchrist@holgerdanske.com>
To:        questions@freebsd.org
Subject:   Re: cannot receive mountpoint property on data/backup/home/foo/bar: permission denied
Message-ID:  <f6b94418-b416-19b9-668b-a4ee2371d319@holgerdanske.com>
In-Reply-To: <YWcGXYC6vyFFLKq3@ceres.zyxst.net>
References:  <YWcGXYC6vyFFLKq3@ceres.zyxst.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10/13/21 9:16 AM, tech-lists wrote:
> Hi
> 
> I've tried searching for an authorative answer on this, but answers seem
> to vary between Oracle-ZFS, FreeBSD-ZFS and OpenZFS, and nothing really
> recent (context is recent stable/13)
> 
> Using zfs send -R data/home/foo/bar@20211013 | pv | ssh
> remote.system zfs recv -dvu data/backup 


What is 'pv'?


Testing on a FreeBSD 12.2-RELEASE VirtualBox VM:

2021-10-13 15:35:55 toor@vf1 ~
# freebsd-version ; uname -a
12.2-RELEASE-p9
FreeBSD vf1.tracy.holgerdanske.com 12.2-RELEASE-p7 FreeBSD 
12.2-RELEASE-p7 GENERIC  amd64

2021-10-13 15:59:20 toor@vf1 ~
# zpool list | egrep 'NAME|vf1zpool'
NAME        SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP 
HEALTH  ALTROOT
vf1zpool1   960M  2.36M   958M        -         -    15%     0%  1.00x 
ONLINE  -
vf1zpool2   960M  1.25M   959M        -         -     6%     0%  1.00x 
ONLINE  -

2021-10-13 15:58:54 toor@vf1 ~
# zfs create vf1zpool1/home

2021-10-13 15:59:13 toor@vf1 ~
# zfs create vf1zpool1/home/foo

2021-10-13 15:59:17 toor@vf1 ~
# zfs create vf1zpool1/home/foo/bar

2021-10-13 16:00:15 toor@vf1 ~
# echo "hello, world!" > /vf1zpool1/home/foo/bar/hello.txt

2021-10-13 16:01:36 toor@vf1 ~
# zfs snapshot -r vf1zpool1@20211012

2021-10-13 16:05:13 toor@vf1 ~
# echo "goodbye, cruel, world!" > /vf1zpool1/home/foo/bar/goodbye.txt

2021-10-13 16:06:31 toor@vf1 ~
# zfs snapshot -r vf1zpool1@20211013

2021-10-13 16:16:38 toor@vf1 ~
# zfs send -R vf1zpool1/home/foo/bar@20211013 | zfs recv -dvu 
vf1zpool2/backupcannot receive: specified fs (vf1zpool2/backup) does not 
exist


Create the destination filesystem:

2021-10-13 16:17:54 toor@vf1 ~
# zfs create vf1zpool2/backup


Try again:

2021-10-13 16:18:31 toor@vf1 ~
# zfs send -R vf1zpool1/home/foo/bar@20211013 | zfs recv -dvu 
vf1zpool2/backup
receiving full stream of vf1zpool1/home/foo/bar@20211012 into 
vf1zpool2/backup/home/foo/bar@20211012
received 48.5KB stream in 1 seconds (48.5KB/sec)
receiving incremental stream of vf1zpool1/home/foo/bar@20211013 into 
vf1zpool2/backup/home/foo/bar@20211013
received 10.2KB stream in 1 seconds (10.2KB/sec)

2021-10-13 16:18:45 toor@vf1 ~
# zfs list -r -t all vf1zpool2
NAME                                     USED  AVAIL  REFER  MOUNTPOINT
vf1zpool2                               1.52M   830M    88K  /vf1zpool2
vf1zpool2/backup                         456K   830M    96K 
/vf1zpool2/backup
vf1zpool2/backup/home                    360K   830M    96K 
/vf1zpool2/backup/home
vf1zpool2/backup/home/foo                264K   830M    96K 
/vf1zpool2/backup/home/foo
vf1zpool2/backup/home/foo/bar            168K   830M   112K 
/vf1zpool2/backup/home/foo/bar
vf1zpool2/backup/home/foo/bar@20211012    56K      -   100K  -
vf1zpool2/backup/home/foo/bar@20211013      0      -   112K  -

2021-10-13 16:19:03 toor@vf1 ~
# mount | grep vf1zpool | sort
vf1zpool1 on /vf1zpool1 (zfs, local, nfsv4acls)
vf1zpool1/home on /vf1zpool1/home (zfs, local, nfsv4acls)
vf1zpool1/home/foo on /vf1zpool1/home/foo (zfs, local, nfsv4acls)
vf1zpool1/home/foo/bar on /vf1zpool1/home/foo/bar (zfs, local, nfsv4acls)
vf1zpool2 on /vf1zpool2 (zfs, local, nfsv4acls)
vf1zpool2/backup on /vf1zpool2/backup (zfs, local, nfsv4acls)
vf1zpool2/backup/home on /vf1zpool2/backup/home (zfs, local, nfsv4acls)
vf1zpool2/backup/home/foo on /vf1zpool2/backup/home/foo (zfs, local, 
nfsv4acls)


The replication worked.  Note that the replica leaf directory 'bar' is 
not mounted, but its parents are; per the zfs receive -u option.


If I try to replicate again:

2021-10-13 16:19:29 toor@vf1 ~
# zfs send -R vf1zpool1/home/foo/bar@20211013 | zfs recv -dvu 
vf1zpool2/backup
cannot receive new filesystem stream: destination 
'vf1zpool2/backup/home/foo/bar' exists
must specify -F to overwrite it
warning: cannot send 'vf1zpool1/home/foo/bar@20211012': signal received
warning: cannot send 'vf1zpool1/home/foo/bar@20211013': Broken pipe


That failed, as it should; but not with the error message you are seeing 
(below).


> I can see it completes the
> sending of the snapshot but I'll see this as it just finishes, at the
> sending systems term:
> 
> cannot receive mountpoint property on data/backup/home/foo/bar
> 
> Is this just because the data/backup/home/foo/bar filesystem was mounted 
> on the sending system, and the snapshot inherited it?
> In which case I guess it can be ignored? because I don't want it
> mounted at the receiving end (it wasn't mounted at the receiving end)
>
> For the received snapshot, all I care about is to be able to mount it
> should I need it. But I won't usually need it.
> 
> thanks,


Do you see the replica on the receiving system?  E.g.:

# ssh remote.system zfs list -r -t all data/backup/home


David



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f6b94418-b416-19b9-668b-a4ee2371d319>