Disaster Recovery with ZFS and Zrepl
chromakode.com
chromakode.com
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.
I will add to this a different backup software to an offsite or cloud. I use restic.
I’ve run it beneath Ubuntu for several years, and it’s only saved my ass.
I didn’t replicate, only used the apt snapshots.
This seems to crop up at really inconvenient times too, like when you're trying to do something during a scheduled outage. :(
That kind of thing aside though, it's been pretty solid in my use for actual data storage.
Just don't use ZFS's native encryption + ZFS snapshots + send/recv.
Reportedly that combination is a cause of data corruption:
Never lost any data. There isn't much software that could claim that.
Meanwhile I lost (I had backups) all my data twice on btrfs, I know it is more stable now, but I certainly wont ever use it again. Even HAMMER1 (I would love to use HAMMER2, but until my server dies, I will stay with FreeBSD) lost it only once and even in that case, after debugging irc session with Matt Dillon, I was able to recover most files.
The only thing that pisses me off is that Kubuntu doesnt support it trough installer (yes I could do it manually but been there with Fedora and I am sick of tracking if initfs was updated or finish with unbootable - easy solvable, but annoying - situation ) and I am now forced to use Ubuntu with KDE on workstation. But this is not zfs.
ZFS is great on enterprise hardware I'm sure.
For my personal workstation I've started experimenting with using Proxmox (it's a Debian 12 variant) as the OS because its installer supports multi-drive ZFS installation (RAIDZ1/2/10/etc) out of the box. So, boot setup is currently mirrored SSDs (with /home on mirrored NVMe drives).
Apt installing the standard desktop stuff afterwards (Nvidia drivers, KDE desktop, etc) has worked well, and it all seems happy.
That being said, I'm only 4 or 5 days into this test setup. So far so good though. :)
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.
I had tons of issues getting it to work with versions too far apart, which tainted my feel for that approach.
There is an argument to be made for dumb file copying even when you have access to fancy features.
Comment on this thread to this effect, didn't know about the encryption issues: https://news.ycombinator.com/item?id=40306873
I only use ZFS replication when doing Linux to Linux transfers and when that happens they are running the exact same operating system and version of OpenZFS.
(only talking backups, snapshots of course have utility beyond that usecase as well)
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 and only if you apply best practicies mentionned above in the second point of your post.
Anyway I'd rather protect my backup as much as I can and not allow the source machine to have any direct access to an account on the backup server because of possible security. Security is hard sometimes and you never know when some bugs might increase the possibilities. I like my backup servers to not have any open port. The caveat is that it is only possible if your primary backup server is locally and physically accessible. If you are travelling you might want to be able to access it without being physically present. An option might be to just have ssh disabled when you are at home and you enable the service when you know you won't be at home for a long enough period to make it a problem if you need to restore data.
That's fair, it's a different risk profile, and one that you're happy with. Nothing wrong with that. :)
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.
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!