ZFS Is it possible to zfs send from uncompressed dataset to a compressed dataset?

Hi,

Can one copy a dataset with uncompressed data to a dataset with compression=on, and have the data in the destination dataset compressed? Using zfs send/recv.

Assume the destination dataset inherits compression=on from its parent upon creation.

Also, am I right in saying that at the ' -c' switch for zfs send applies only on the wire?

Thanks
 
Yoy can try it. Perhaps a utility like ZAP can achieve it. One can set such option(s) at either or both the sender and receiver PCs.
 
Hi,

Can one copy a dataset with uncompressed data to a dataset with compression=on, and have the data in the destination dataset compressed? Using zfs send/recv.

Assume the destination dataset inherits compression=on from its parent upon creation.

Also, am I right in saying that at the ' -c' switch for zfs send applies only on the wire?

Thanks

Yes, the compression property on the receiving dataset determines how newly received data is written.

The -c option applies to the stream, and only works if the source is compressed. (It is there to avoid the decompress / recompress CPU cycles if you are sending a compressed dataset to a similarly compressed destination.)
 
My understanding is that zfs send/recv will be a 1-to-1 transfer, meaning if the data is currently uncompressed on a source dataset, it will still be uncompressed on the destination. The data would not be manipulated in any way.
 
My understanding is that zfs send/recv will be a 1-to-1 transfer, meaning if the data is currently uncompressed on a source dataset, it will still be uncompressed on the destination. The data would not be manipulated in any way.

The blocks of user data are absolutely transferred 1:1 (you will read the same data and file properties from the filesystem) but the compression is performed at a lower level; you can even change the compression during a receive operation and the blocks will be stored with different compression depending on when they are received.

You can also come to this conclusion from the fact that by default (without -c) blocks are decompressed before being placed in the send stream, coupled with the fact that you can send without properties.

(You can also reach this conclusion by trying it. It works.)
 
Back
Top