*New 12.3 series Release:
2022-06-07: XigmaNAS released!

We really need "Your" help on XigmaNAS Language packages. Please help us today!

XigmaNAS talks on IRC https://web.libera.chat/#xigmanas, ircs://irc.libera.chat:6697 (TLS) or irc://irc.libera.chat:6667 (plain text)

[HOWTO] How to repair Zrep snapshots

Only Admin's or Moderators can move thread's to this sub-forum.
Nobody should start a new thread on this sub-forum.
Anybody can reply to a thread on this sub-forum.
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
User avatar
Site Admin
Site Admin
Posts: 2567
Joined: Dec 13th, '20, 15:18
Location: France - Val d'Oise
Status: Offline

[HOWTO] How to repair Zrep snapshots


Post by Ernie »

Hi All,

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).


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


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

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
On NAS2, pool2/documents is linked to master/documents of NAS1.
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
You can check with zrep list -v.

Code: Select all

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
Now we need also to modify on NAS1. Via ssh connection on NAS1, you use:

Code: Select all

zrep changeconfig -f pool1/documents NAS2 pool2/documents
It allows to setup the links between NAS1 (source) and NAS2 (destination) for the datasets of NAS1 (pool1/documents)

Then always on NAS1:

Code: Select all

zrep sentsync pool1/documents@zrep_000023
It is the last snapshots of the datasets on NAS1.

We go on NAS2 now and we launch :

Code: Select all

zrep refresh pool2/documents
as we are in backup mode for zrep.

All is fine now. Sure your need to setup each datasets if other datasets are concerned.

NAS 1&2:
XigmaNAS - Ornithopter (revision 9073)
NAS1: rootonzfs, Xeon E3 1241@3.5GHz, 32 Go RAM, 4HDD@8To/mirror+strip, 1SSD cache, 1 UFS 2To (syncthing, rclone)
NAS2: embedded version, i7 CPU 920 @ 2.67GHz, 6Go RAM, 2x3HDD@2To/strip+raidz1, 1SSD cache
Case : Fractal Design XL R2

Extensions & services:
NAS1: OBI (Plex, BTSync, zrep, rclone, syncthing, themes, bastille (adguardhome), boot environments, jdupes), nfs, smb, UPS,
NAS2: OBI (zrep (backup mode of all datasets), themes)
Post Reply