A HowTo in order to know the command for reparing snapshots for zrep (not the content but the parameters). After reparing, zrep will can use again the snapshots
WARNING : modifying the parameters of snapshots is dangerous !!! Thanks to manage backup of your system and your data before modifications.
If we use zfs send / receive in order to send snapshots on another pool, the parameters of snapshots for zrep are modified and zrep cannot work with the snapshots.
One case is for a migration from one architecture (raidzfs X) to another one (raidzfs Y) on the same server.
The following approach allows to avoid:
- deletion of concerned snashots
- re-initialization of zrep
In my example, NAS1 is the source host, NAS2 the destination host.
Zrep is set up in back up mode on NAS2 (NAS2 refreshes its snapshots based on the NAS1).
Reminder:
Backup mode : we are on destination host and we use 'zrep refresh' command for synchronize datasets
Normal mode : we are on source host and we use 'zrep -S' command in order to push the snapshots to destination host
Approach:
You are connected via ssh on NAS2. You display the list of datasets concerned by zrep : zrep list -v.
It displays all datasets of NAS2 concerned by zrep, with all properties. Herafter an example:
Code: Select all
pool2/documents:
readonly on
zrep:dest-host NAS2
zrep:savecount 20
zrep:src-fs master/documents
zrep:dest-fs pool2/documents
zrep:src-host NAS1
last snapshot synced: pool2/documents@zrep_000023
- src = source
- dest = destination
- fs = file system
Last snapshots used by zrep is zrep_000023.
The number of historical snapshots is setup at 20 (by default for zrep it is 5, I am parainonac

After a migration on my source host, the dataset was changed (master to pool1). In order to modify zrep:src-fs, you use the following command on NAS2 via ssh:
Code: Select all
zfs set zrep:something=newval file/system
Code: Select all
zfs set zrep:src-fs=pool1/documents pool2/documents
Code: Select all
pool2/documents:
readonly on
zrep:dest-host NAS2
zrep:savecount 20
zrep:src-fs pool1/documents
zrep:dest-fs pool2/documents
zrep:src-host NAS1
last snapshot synced: pool2/documents@zrep_000023
Code: Select all
zrep changeconfig -f pool1/documents NAS2 pool2/documents
Then always on NAS1:
Code: Select all
zrep sentsync pool1/documents@zrep_000023
We go on NAS2 now and we launch :
Code: Select all
zrep refresh pool2/documents
All is fine now. Sure your need to setup each datasets if other datasets are concerned.
BR