ZFS Can I change compression algorithm during ZFS send->receive?

cracauer@

Developer
I don't think so, just to be sure:

Can I send a lz4 compressed ZFS filesystem and have it go into zstd on the receiving side?

As far as I can so, no:
- I can only turn compression off by omitting -p on the send side
- I cannot create the target system (and change properties) separately from filling it with data since receive insists on doing both atomically (unless I want to change away from send->receive and use rsync)
 
Had you something like this in mind?

Code:
# zpool create data ada1p1
# zfs get compression data
NAME        PROPERTY     VALUE         SOURCE
data        compression  off           default

# zfs create zroot/data
# zfs get compression zroot/data
NAME        PROPERTY     VALUE         SOURCE
zroot/data  compression  lz4           inherited from zroot


# zfs umount zroot/data
# zfs send zroot/data  |  zfs receive -F -o compression=zstd data


# zfs get compression data
NAME        PROPERTY     VALUE         SOURCE
data        compression  zstd          local
 
Yes!

Thanks so much.

Also found this in the manpage:
Code:
           If the send stream was sent with -c then overriding the compression
           property will have no effect on received data but the compression
           property will be set.  To have the data recompressed on receive
           remove the -c flag from the send stream.
 
Back
Top