allanjude / zxfer

A continuation of development on zxfer, a popular script for managing ZFS snapshot replication
BSD 2-Clause "Simplified" License
123 stars 40 forks source link

Potential new readonly_properties: createtxg, guid, filesystem_count, snapshot_count #46

Closed matsimon closed 5 years ago

matsimon commented 5 years ago

Hi

First: Thank you for your continued work on zxfer. I ran into issues when I tried to basically use zxfer for backup to a local USB disk while using CentOS 7.5 and ZFS on Linux 0.7.11 where zxfer only started to work and not fail with a error message about read-only attributes after adding the following new attributes to readonly_properties:

diff --git a/zxfer b/zxfer
index 1b68262..7304890 100755
--- a/zxfer
+++ b/zxfer
@@ -176,7 +176,8 @@ readonly_properties="type,creation,used,available,referenced,\
 compressratio,mounted,version,primarycache,secondarycache,\
 usedbysnapshots,usedbydataset,usedbychildren,usedbyrefreservation,\
 version,volsize,mountpoint,mlslabel,keysource,keystatus,rekeydate,encryption,\
-refcompressratio,written,logicalused,logicalreferenced"
+refcompressratio,written,logicalused,logicalreferenced,createtxg,guid,\
+filesystem_count,snapshot_count"

This was easily reproducible via i.e. said example in zxfer(8) Examples section "Ex1 - Backup a pool (including snapshots and properties)". Both the source and destination pools were created with ZFS on Linux.

This was only a trial and error, however I can't judge if this es even actually the right thing to do or if I am doing something really bad. The transfers seem to be giving expected results after some manual check on the source and destination data.

It would be nice, if we could integrated this upstream once we are certain that this isn't causing regressions for anyone or only a Linux-specific thing.

Regards Mathieu

petr-fischer commented 5 years ago

+1 for "createtxg,guid" - zxfer on FreeBSD 12 can't replicate dataset - error message:

...
Creating destination filesystem "zusbbackup/backups/pf-mon/zroot" with specified properties.
cannot create 'zusbbackup/backups/pf-mon/zroot': 'createtxg' is readonly
Error when creating destination filesystem.
matsimon commented 5 years ago

Thanks @petr-fischer for you input, I think for these 2 features we can pretty much assume that they are available to illumos, FreeBSD and ZFS on Linux since if I read the illumos ticket 9621 correctly.

Also when comparing zfs(1) from FreeBSD 11.2 vs. 12.0 it seems both these options have been imported with that release.

I'll try to check for the other feature but will first go ahead an offer a pull request for these (IMO) confirmed read-only features.

kpfleming commented 5 years ago

Just found another potential addition to this list (on FreeBSD 12): dnodesize.

allanjude commented 5 years ago

Just found another potential addition to this list (on FreeBSD 12): dnodesize.

FreeBSD 12 has dnodesize, but 11.x does not.