32 points · by aargh_aargh · 2y ago · 32 comments
If that's the case, then doing so with replicated ZFS snapshots is probably not a good idea.
That specific scenario (ZFS encryption -> replication of encrypted snapshots) is a known cause of ZFS corruption. :(
https://www.phoronix.com/news/OpenZFS-Encrypt-Corrupt
Unfortunately it doesn't seem to be widely known about, though there is a suggestion to make it official:
Don't take this as a general advice. For important data, it's important to have multiple backups and validate their effectiveness routinely.
My mid term goal is to trade offsite replication with a friend for automatically replicating the offsite portion of important things.
ZFS snapshots allow you to roll back to the point in time of each snapshot, up to the amount of disk space you can maintain for storing the changes.
I will add to this a different backup software to an offsite or cloud. I use restic.
Sure all the systems use a zfs file system but I am diversifying risk and don't really trust the other copy on write file systems.
Imagine source machine is compromised and attacker decide to delete/encrypt your data, and see there is a backup mechanism connecting to the backup machine, what prevents him from using the deleting/encrypting the backups as well?
You'd definitely want the backup machine to pull the snapshots, and have no way to connect to it from source machine directly with a user that would have access to the data or an admin account. That means no ssh keys on the source machine, no password kept in a password manager that would be loaded on the source machine either.
Another strong method would involve 3 machines: source --push--> replica1 <--pull-- replica2
Where source and replica1 would have ZFS filesystem and snapshots while replica2 is using a different filesystem (LVM + ext4 ) and snapshots to safeguard from replicating bugs that lead to data not being available. ZFS snapshots could be saved as individual files on this filesystem.
With ZFS snapshots the older snapshots would still be present on the target server, in their unencrypted form.
> That means no ssh keys on the source machine ...
Typically for non-user logins (eg script access and similar) you do the extra step of configuring the receiving ssh to only allow a specific command for a given key.
It's a configurable ssh thing, where you add extra info to the .ssh/authorized_keys file on the destination server. With that approach, it doesn't allow general user logins while still allowing the source machine to send the data.
(only talking backups, snapshots of course have utility beyond that usecase as well)
There are a large number of people who've reported problems with ZFS (and btrfs) with WD SN770 and a few other WD models:
I hadn’t seen it yet.
It’s amazing!