ZFS ZFS send with inherited properties

Hi all,
is there a way to send a ZFS dataset with its inherited properties (possibly making them local properties in the process)?
If not, is there a way to convert inherited properties to local, which I would do before sending?
I mean with the ZFS tools by the way; not scripting (which I will do if I must).
Thanks,
Scott
 
is there a way to send a ZFS dataset with its inherited properties (possibly making them local properties in the process)?
AFAICT the sent dataset properties (including inherited) are set on the receiving pool with the receiving pools dataset properties, not the sending pools.

For example, a dataset with the inherited property "compression=off" will become on the receiving pool "compression=on", as the pools top parent dataset property is set ot "on".

If not, is there a way to convert inherited properties to local, which I would do before sending?
This can be done with the zfs receive [-o property=value] command:

In this example the compression property is "off" on the sending pool.
Rich (BB code):
# zfs get -r compress zroot/media
NAME                    PROPERTY     VALUE           SOURCE
zroot/media             compression  off             local
zroot/media@sn1         compression  -               -
zroot/media/Movies      compression  off             inherited from zroot/media
zroot/media/Movies@sn1  compression  -               -

# zfs sent zroot/media/Movies@sn1  | zfs receive tank/mediabak/Movies

# zfs get -r compress tank
NAME                      PROPERTY     VALUE           SOURCE
tank                      compression  on              default
tank/mediabak             compression  on              default
tank/mediabak/Movies      compression  on              default
tank/mediabak/Movies@sn1  compression  -               -
The receiving pool sets the compression to "on" according to that pools parent dataset property setting.

To get the sent dataset keep the properties on the receiving side, the specific property must be set (multiple properties can be set, one after another):
Rich (BB code):
# zfs destroy -r tank/mediabak/Movies

# zfs send zroot/media/Movies@sn1  | zfs receive -o compress=off tank/mediabak/Movies

# zfs get -r compress tank
NAME                      PROPERTY     VALUE           SOURCE
tank                      compression  on              default
tank/mediabak             compression  on              default
tank/mediabak/Movies      compression  off             local
tank/mediabak/Movies@sn1  compression  -               -

See zfs-receive(8) for detailed descriptions.

Alternatively set the receiving pools parent dataset property to the sending pools dataset property:
Rich (BB code):
# zfs set -o compress=off tank/mediabak

# zfs get -r compress tank
NAME                      PROPERTY     VALUE           SOURCE
tank                      compression  on              default
tank/mediabak             compression  off             local

# zfs send zroot/media/Movies@sn1  | zfs receive  tank/mediabak/Movies

# zfs get -r compress tank
NAME                      PROPERTY     VALUE           SOURCE
tank                      compression  on              default
tank/mediabak             compression  off             local
tank/mediabak/Movies      compression  off             inherited from tank/mediabak
tank/mediabak/Movies@sn1  compression  -               -
 
Back
Top