[zfs-discuss] zfs clone resets user defined properties ?

Quentin Le Burel quentin.leburel at clustervision.com
Wed Apr 18 02:27:48 EDT 2018


Hi,

Indeed the user defined property is also lost when I explicitely set it on
the snapshot:

[root at storage01 root]# zfs get all | grep fo
tank3/volume               foo:bar
foobar                      local
tank3/volume at 2018-04-17    foo:bar
foobar                      inherited from tank3/volume
[root at storage01 root]# zfs set foo:bar=foobar tank3/volume at 2018-04-17
[root at storage01 root]# zfs get all | grep fo
tank3/volume               foo:bar
foobar                      local
tank3/volume at 2018-04-17    foo:bar
foobar                      local
[root at storage01 root]# zfs clone tank3/volume at 2018-04-17
tank3/volume-2018-04-17
[root at storage01 root]# zfs get all | grep fo
tank3/volume               foo:bar
foobar                      local
tank3/volume at 2018-04-17    foo:bar
foobar                      local
[root at storage01 root]# zfs get foo:bar tank3/volume-2018-04-17
NAME                     PROPERTY  VALUE    SOURCE
tank3/volume-2018-04-17  foo:bar   -        -

Is it not reasonable to expect that the properties from the original are
transfered to the clone ?
Otherwise the filesystem is not identical at the time of cloning and
therefore not a clone.

Kind regards

Quentin






Date: Tue, 17 Apr 2018 15:14:08 +0200
> From: "Gregor Kopka (@zfs-discuss)" <zfs-discuss at kopka.net>
> To: Quentin Le Burel via zfs-discuss <zfs-discuss at list.zfsonlinux.org>
> Subject: Re: [zfs-discuss] zfs clone resets user defined properties ?
> Message-ID: <d001a0d7-f757-7711-f989-584896eaa19c at kopka.net>
> Content-Type: text/plain; charset=utf-8
>
>
>
> Am 17.04.2018 um 14:07 schrieb Quentin Le Burel via zfs-discuss:
> > Hi All,
> >
> > > [root at storage01 root]# zfs create tank3/volume
> > > [root at storage01 root]# zfs set foo:bar=foobar tank3/volume
> > > [root at storage01 root]# zfs get all | grep fo
> > > tank3/volume               foo:bar               foobar
> >          local
> > > [root at storage01 root]# zfs snapshot tank3/volume at 2018-04-17
> > > [root at storage01 root]# zfs get all | grep fo
> > > tank3/volume               foo:bar               foobar
> >          local
> > > tank3/volume at 2018-04-17    foo:bar               foobar
> >          inherited from tank3/volume
> > > [root at storage01 root]# zfs clone tank3/volume at 2018-04-17
> > tank3/volume-2018-04-17
> > > [root at storage01 root]# zfs get foo:bar tank3/volume-2018-04-17
> > > NAME                     PROPERTY  VALUE    SOURCE
> > > tank3/volume-2018-04-17  foo:bar   -        -
> >
> > It seems that user defined properties are not copied when you create a
> > clone from a snapshot:
> >
> > Is this a bug, or is there a specific reason for that behaviour ?
>
> First things first: the foo:bar is set on tank3/volume, not on
> tank3/volume at 2018-04-17 - it would be copied as unset anyway when you
> clone the snapshot.
>
> But it also dosn't work as you expected when you had explicitely set a
> property on the snapshot. This might be a bug, if at all.
>
> I guess that user defined properties are not transfered as a clone is a
> 'new' dataset that has, apart from sharing unmodified data with it, no
> connection with the snapshot it was created from (both are unable to
> modify the respective other) - hence no properties (apart from size for
> volumes) are being copied. I find that behaviour reasonable.
>
> Gregor
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.zfsonlinux.org/pipermail/zfs-discuss/attachments/20180418/a167a6d1/attachment.html>


More information about the zfs-discuss mailing list