ZFS: send entire storage pool incrementally, with resume
If you have a pool you want to backup, or transfer to another machine, this is an important thing to know. It will transfer recursively all the filesystems and all the snapshots, in one command !
TL;DR
Let’s keep it short :
|
|
What does this do ?
-R
will send the pool recursively, copying all properties-F
will allowdestroy
operations on the target pool-v
to see progress-s
save a resumable token-u
don’t mount the filesystems that are sent-o mountpoint=none
prevent mountpoint property to be sent
Note: I’m not sure what can pre-exist on the target pool without interfering. I had trouble because I had already manually transfered one of the filesystems and I had a snapshot for both that filesystem and for the pool. To make sure things would work, I destroyed them all. I suspect the pool’s snapshot might be the only one that needed to be removed.
If the transfer fails
Time to use that resume token !
Use this command on the target machine to retrieve the token:
|
|
Then re-run the command using the token:
|
|
What if I want to send new snapshots (increments) later on ?
The option you’ll need is -I
, which, as the doc says :
|
|
This is how it can be used:
|
|
It will send all snapshots of all filesystems, between your first and second pool snapshots. You just need to make sure no filesystem was changed on the destination since the first snapshot. Otherwise, you must rollback those changes using this command first (be careful, this command destroys any change that has happened since!):
|
|