From 51d6731aa87b0a0674597ff44cbde98dd2c1120c Mon Sep 17 00:00:00 2001 From: Edwin Eefting Date: Mon, 24 Jan 2022 11:46:34 +0100 Subject: [PATCH] settle udev devices when --- zfs_autobackup/ZfsAutoverify.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/zfs_autobackup/ZfsAutoverify.py b/zfs_autobackup/ZfsAutoverify.py index cea40ef..883c301 100644 --- a/zfs_autobackup/ZfsAutoverify.py +++ b/zfs_autobackup/ZfsAutoverify.py @@ -119,8 +119,14 @@ class ZfsAutoverify(ZfsAuto): source_dataset.set("snapdev", "visible") target_dataset.set("snapdev", "visible") - source_hash=self.hash_dev(source_snapshot.zfs_node, "/dev/zvol/"+source_snapshot.name) - target_hash=self.hash_dev(target_snapshot.zfs_node, "/dev/zvol/"+target_snapshot.name) + # fixme: not compatible with freebsd and others. + source_dev="/dev/zvol/"+source_snapshot.name + target_dev="/dev/zvol/"+target_snapshot.name + source_dataset.zfs_node.run(["udevadm", "trigger", source_dev]) + target_dataset.zfs_node.run(["udevadm", "trigger", target_dev]) + + source_hash=self.hash_dev(source_snapshot.zfs_node, source_dev) + target_hash=self.hash_dev(target_snapshot.zfs_node, target_dev) if source_hash!=target_hash: raise Exception("md5hash difference: {} != {}".format(source_hash, target_hash))