Apologies for the generic title. I’m trying to understand how ZFS snapshots work when moving them to different machines.
My ultimate goal is to copy snapshots from my main ZFS pool to two backup pools. I’m using Sanoid to take/manage snapshots. And I’d like to use Syncoid to move the snapshots.
Another fork in all this is that I first set this up a while back and I don’t remember exactly what I did. I know I could just blow away the backup pools and start over, but I’d like to try to keep what I have (this also tests my understanding).
So, I wanted to copy snapshots from my Main Pool to Backup Pool A. I ran a basic syncoid command and this was successful.
$ syncoid --recursive --skip-parent main_pool backup_pool_a
Now, I tried to run this same command on the other backup pool and I ran into an error.
CRITICAL ERROR: Target backup_pool_b/dir1 exists but has no snapshots matching with main_pool/dir1!
Replication to target would require destroying existing
target. Cowardly refusing to destroy your existing target.
I looked into this and on both my Main Pool and on my Backup Pool A, I see that the datasets all have a snapshot with the suffix @syncoid_ServerName_<time_long_ago>
. I’m guessing that that’s the “sync snapshot” that Syncoid takes before it copies data. When I look at Backup Pool B, none of the datasets have that snapshot. So the error makes sense, there’s no common starting point on Backup Pool B.
Now my questions:
-
In the past, how could I have copied data to Backup Pool B without a common snapshot? (Is the likely answer that the common snapshot got deleted from Main Pool?)
-
How do I move forward while preserving data already on Backup Pool B? After running Syncoid with Backup Pool A, I ended up with Backup Pool A containing my recent snapshots as well as the snapshots that were transferred a while back. How can I move that Syncoid “sync snapshot” over to Backup Pool B? (Is this a job for
zfs send | zfs receive
?) -
What are the implications of not creating the “sync snap” (meaning running Syncoid with the
--no-sync-snap
option). First, I thought I should not create it because there is no benefit since I’m already copying over the Sanoid snapshots. Also, since I am moving snapshots to two destinations, two of those snapshots would end up getting created. But after running into the error above, I’m wondering if it’s a good idea to keep that sync snapshot so I will have multiple snapshots in common between the pools, in case something happens to that one common snapshot.
Hopefully I explained that well. Happy to provide additional info.