Constantin Gonzalez wrote:
> Hi Brad,
> 
> this is indeed a good idea.
> 
> But I assume that it will be difficult to do, due to the low-level nature
> of zfs send/receive.
> 
> In your compression example, you're asking for zfs send/receive to
> decompress the blocks on the fly. But send/receive operates on a lower
> level: It doesn't care much what is actually inside the blocks, it
> just copies the block structure "as is".

zfs send output is uncompressed, it sends the data as seen in the ARC 
not as seen on disk.

Try this:

$ zfs create -o compression=gzip-1 tank/gz1/
$ cp hamlet.txt /tank/gz1/
$ zfs snapshot tank/[EMAIL PROTECTED]
$ zfs send -R tank/[EMAIL PROTECTED] > /tmp/foo
$ strings /tmp/foo
.....
  Mar. 'Tis gone and will not answer.
   Ber. How now, Horatio? You tremble and look pale.
     Is not this something more than fantasy?
     What think you on't?
.....

The same is true for encrypted datasets the zfs send stream will be 
clear text not ciphertext.  To protect the data in transit between pools 
on remote hosts do something like this:

$ zfs snapshot -R [EMAIL PROTECTED] +%F`
$ zfs send -R [EMAIL PROTECTED] +%F` | ssh remotehost 'zfs recv -d rtank`

Or it you are storing the stream on tape:

$ zfs send -R [EMAIL PROTECTED] +%F` | encrypt -a aes -k /rmdisk/mykey | dd 
of=/dev/tape

You get the idea.

> I would also assume that zfs send/receive doesn't know (and doesn't
> have to) anything about zfs dataset properties. It just starts at
> the snapshot level (which works independently of whether it's used for
> a filesystem, a ZVOL, a whatever) and copies the subtree.

See the man page for zfs(1) where the -R options for send is discussed.

> But for the sake of implementing the RFE, one could extend the ZFS
> send/receive framework with a module that permits manipulation of the
> data on the fly, specifically in order to allow for things like
> recompression, en/decryption, change of attributes at the dataset level,
> etc.

No need this already works this way.

-- 
Darren J Moffat
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to