Leave a note about bind mounting

This commit is contained in:
Wojciech Kozlowski 2023-02-11 10:28:19 +01:00
parent 2b197879b5
commit 84977b5322

View File

@ -112,6 +112,10 @@ if __name__ == "__main__":
# Prepare the ZFS snapshot to backup with restic. # Prepare the ZFS snapshot to backup with restic.
# -------------------------------------------------------------------------------------- # --------------------------------------------------------------------------------------
try: try:
# Bind mounting will preserve the device ID of the snapshot mount. This device ID is
# different for every snapshot causing trouble for restic which keeps track of
# device IDs. See https://github.com/restic/restic/issues/3041. Cloning does not
# have the same issue as it is a fresh mount.
subprocess.run( subprocess.run(
["/usr/sbin/zfs", ["/usr/sbin/zfs",
"clone", "-o", f"mountpoint={backup_path}", snapshot, "rpool/restic"], "clone", "-o", f"mountpoint={backup_path}", snapshot, "rpool/restic"],