[zfs-discuss] zfs send -R slow

BJ Quinn
2009-01-22T23:43:09Z

I''m using OpenSolaris with ZFS as a backup server.  I copy all my data
from various sources onto the OpenSolaris server daily, and run a snapshot at
the end of each backup.  Using gzip-1 compression, mount -F smbfs, and the
--in-place and --no-whole-file switches for rsync, I get efficient space usage,
only storing the blocks that changed each day.  This way, I have a backup server
containing all backups for all days going back effectively indefinitely.  Works
great.

Of course, I also want to have something that can be rotated and/or taken
offsite.  What I''ve done is use an internal drive in the backup server
to actually receive and store all the backups and snapshots themselves.  Then at
the end of the actual backup I run a snapshot, and then do a zfs send -R of my
backup pool and all its snapshots to an external drive.  Not being able to trust
what''s on the drive (its contents could possibly have changed since
last time I used it, and I want every snapshot on every external drive), I wipe
the external drive clean and then have it receive the full contents of the
non-incremental zfs send -R backuppool I mentioned above.

This works.  However, it''s painfully slow.  I get the impression that
zfs is de-compressing and then re-compressing the data instead of transferring
it in its compressed state, and then when the incrementals start copying over
(the snapshots themselves), it gets drastically slower.  The whole process
works, but I''m thinking that when I start getting too many snapshots,
it won''t finish overnight and will run into the next day.

I don''t want to just copy over the contents of my most recent snapshot
on my backup server to the external drive then run a snapshot on the external
drive, because I''d like each external drive to contain ALL the
snapshots from the internal drive.

Is there any way to speed up a compressed zfs send -R?  Or is there some other
way to approach this?  Maybe some way to do a bit-level clone of the internal
drive to the external drive (the internal backup drive is not the same as the OS
drive, so it could be unmounted), or SNDR replication or something?

Thanks!