I want send several zfs snapshots to another pool. Source pool "rpool", target pool "dpool"
rpool/kvm1380_img 88,6G 1,48T 77,6G -
rpool/kvm1380_img@snapshot_Sun_01_11_weekly 1,33G - 77,6G -
rpool/kvm1380_img@snapshot_Mon_02_11 746M - 77,6G -
rpool/kvm1380_img@snapshot_Tue_03_11 600M - 77,5G -
rpool/kvm1380_img@snapshot_Wed_04_11 843M - 77,5G -
I know how send one by one snapshot like:
zfs send -i rpool/kvm1380_img@snapshot_Sun_01_11_weekly rpool/kvm1380_img@snapshot_Mon_02_11 | zfs recv dpool/kvm1380_img@snapshot_Mon_02_11
the next one:
zfs send -i rpool/kvm1380_img@snapshot_Mon_02_11 rpool/kvm1380_img@snapshot_Tue_03_11 | zfs recv dpool/kvm1380_img@snapshot_Tue_03_11
and so on…
but I want send all snapshots at once to get everything same like rpool:
dpool/kvm1380_img 88,6G 1,48T 77,6G -
dpool/kvm1380_img@snapshot_Sun_01_11_weekly 1,33G - 77,6G -
dpool/kvm1380_img@snapshot_Mon_02_11 746M - 77,6G -
dpool/kvm1380_img@snapshot_Tue_03_11 600M - 77,5G -
dpool/kvm1380_img@snapshot_Wed_04_11
How to do that?
Best Answer
Instead of the
-i
option, you can use the-I
option to send an incremental stream that includes an entire set of multiple snapshots:For example:
That example will send every snapshot from
snapshot_Sun_01_11_weekly
tosnapshot_ Wed_04_11
.Or, you can send a full replication stream using the
-R
option:Something like this:
The target ZFS filesystem and the actual
zfs recv ...
command may vary. You might, for example, want to add the-u
and/or the-o canmount=noauto
to thezfs recv
command to prevent the system from trying to mount the received filesystem(s).And if you're going to send a full replication stream this way, it's probably best to receive the stream into a completely new ZFS filesystem. Trying to overlay a full replication stream over the top of an existing ZFS filesystem can be troublesome and hard to manage.