TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

ZFS native encryption is currently broken for encrypted backups

17 pointsby amano-kenji8 months ago
There are various issues on ZFS native encryption. ZFS native encryption has been especially buggy when raw encrypted zfs snapshots are being sent or received.<p>https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;zfs&#x2F;issues&#x2F;11679<p>https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;zfs&#x2F;issues&#x2F;15989<p>https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;zfs&#x2F;issues&#x2F;15924<p>https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;zfs&#x2F;labels&#x2F;Component%3A%20Encryption<p>https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;zfs&#x2F;comments&#x2F;10n8fsn&#x2F;does_openzfs_have_a_new_developer_for_the_native&#x2F;<p>On https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;openzfs-docs&#x2F;issues&#x2F;494 people unanimously agree that zfs native encryption is broken especially when sending or receiving raw encrypted zfs snapshots, and they blame the zfs leadership for refusing to admit that zfs native encryption is buggy because admitting that it is buggy is bad for the reputation of zfs.<p>zfs native encryption has been fine for local usage on my machine, but I have never attempted to send raw encrypted zfs snapshots due to numerous warnings.<p>Thus, I want to offer alternatives to zfs native encryption.<p>1. If your zfs pool is not large, LUKS is going to be faster than zfs native encryption. I don&#x27;t know whether LUKS is going to be still faster if zfs pool contains many disks. ZFS native encryption can be as fast as LUKS or faster than LUKS, but it is not for now.<p>2. For making incremental encrypted backups, I recommend restic. Restic can make incremental encrypted snapshots of ZFS snapshots. You can delete any restic incremental snapshots without losing data in other snapshots. Restic 0.17 started supporting RESTIC_FEATURES=device-id-for-hardlinks which supports backing up $ZFS-MOUNTPOINT&#x2F;.zfs&#x2F;snapshot&#x2F;$SNAPSHOT-NAME efficiently. Restic 0.18 will remove device-id-for-hardlinks feature flag and support .zfs&#x2F;snapshot directories efficiently witout any feature flag. If you want to back up zfs dataset, you can take restic ZFS snapshot, back up .zfs&#x2F;snapshot&#x2F;restic as a new restic snapshot, and delete restic ZFS snapshot after backing it up. In this way, restic doesn&#x27;t need to know about local sanoid ZFS snapshots which are independent from restic snapshots.<p>Restic supports compression, encryption, and deduplication. Thus, you can send incremental encrypted backups to untrusted machines. For remote backups, you can use amazon cloud storage, https:&#x2F;&#x2F;rsync.net, https:&#x2F;&#x2F;zfs.rent, and other cloud storage services. I don&#x27;t have any association with any of these services. I don&#x27;t recommend any. Do your own research if you want to pick a cloud storage provider.

5 comments

frankjr8 months ago
&gt; On <a href="https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;openzfs-docs&#x2F;issues&#x2F;494">https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;openzfs-docs&#x2F;issues&#x2F;494</a> people unanimously agree that zfs native encryption is broken especially when sending or receiving raw encrypted zfs snapshots, and they blame the zfs leadership for refusing to admit that zfs native encryption is buggy because admitting that it is buggy is bad for the reputation of zfs.<p>More details on this can be found in a gist from the same author (keep in mind he&#x27;s a well known zfs commmiter).<p><a href="https:&#x2F;&#x2F;gist.github.com&#x2F;rincebrain&#x2F;622ee4991732774037ff44c6768085ab#encryption" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;rincebrain&#x2F;622ee4991732774037ff44c67...</a>
greenavocado8 months ago
Thanks for the heads up. I am using regular ZFS on LUKS already. Seconded restic. I researched many backup systems and also appreciate how nice restic is, especially with its compression support nowadays.
评论 #41705894 未加载
benlivengood8 months ago
I ran into a short period of time where occasionally sending a raw native-encryption snapshot would fail, but that was the only error, and deleting the failed snapshot resolved the error. Presumably the issue with quotas. That was fixed for me over a year ago and I have half a dozen volumes being snapshotted and sent hourly to three destinations with no errors.<p>This is on Debian with default kernels and ZoL versions.<p>I&#x27;d still prefer a bit more stability from native encryption.
评论 #41705488 未加载
JonChesterfield8 months ago
I&#x27;ve always felt a little nervous about encrypting backups. The point of the backup is something has gone wrong and you want to get the data back. You don&#x27;t really want stray bit errors to cascade across vast swathes of the data. Encrypt in transit sure, but maybe not when laying down the bit pattern on the medium at the other end.
评论 #41705401 未加载
评论 #41705415 未加载
aborsy8 months ago
Encrypted ZFS raw send and receive in several machines including laptop. No issues since the feature was added.
评论 #41705428 未加载