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

Gregor Kopka (@zfs-discuss) zfs-discuss at kopka.net
Tue Apr 17 09:14:08 EDT 2018



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



More information about the zfs-discuss mailing list