-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zfs send -R (non-raw) of encrypted dataset does not work #10507
Comments
The error message seems to be saying that what you're asking for is not implemented: |
Yeah... So this was a bit complicated, but the gist of the reasoning goes something like this:
If we can think of a better way to do this, I would be all for pursuing it. The key reasoning behind all this is that we really want to prevent the user from accidentally decrypting their data at all costs. |
you would do that with an additional option, |
I see why this happens, but I think it might be useful to be able to do an unencypted backup. Our backup system is pretty secure. An extra option to zfs send that suppresses the encryption properties seems like the right approach. You can already omit pr override specitic properties. in addition to allowing unencrypted backup, it lets you change your mind if you decide you don't want something encrypted. |
This also would make it possible to immediately apply a new encryption scheme/key on the receive side
Sadly, this is actually the only way to preserve dataset properties with encryption. As said above, something like |
+1 for a flag to send an unencrypted stream. I wanted to replicate existing datasets (including all properties and snapshots) from one pool to another with a new encrypted root (different algo + key) and as I understand it, I have to choose between two bad options:
A |
I agree.
What I did was write a script that finds the oldest snapshot present on all file systems in the hierarchy. Then another script that sends that snapshot for each file system, individually. Once that has been done, incrementals can be done with -R. That’s going unencrypted to encrypted. I don’t know if it would work with an encrypted source.
We’re in the process of moving everything to encrypted, but I can’t do that on the source file systems until we move to a version where that doesn’t disable quotas.
There’s no question that a lot of work is needed on send receive involving encryption. I’d be willing to test, as long as the code would work on Ubuntu 20.04. We have a test server used just for staff files, and we could test on the backup server if there’s no danger of losing edistimg content.
On Nov 14, 2021, at 4:03 PM, Stewart Adam ***@***.***> wrote:
+1 for a flag to send an unencrypted stream. I wanted to replicate existing datasets (including all properties and snapshots) from one pool to another with a new encrypted root (different algo + key) and as I understand it, I have to choose between two bad options:
1. send/recv all data with -R --raw which replicates everything but keeps the same key/algorithm on the new pool
2. send/recv all data without --raw which does re-encrypt the data under the new encryption root, but fails to replicate all previous snapshots or the dataset properties due to the inability to use -R
A --no-preserve-encryption flag to decrypt the encrypted dataset at the source (and therefore would permit -R to be used along side it) would permit for users to decrypt data from encrypted datasets, or to re-encrypt them under new roots.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#10507 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAORUCHMSHURPFZOXJSAPKTUMAP3LANCNFSM4OKD55TA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Hi ! Any news for this problem :( ? |
I too need to replicate a system that has root on encrypted ZFS to a new system that will be unencrypted. Is there no way to do this other than rsync everything and manually set all the dataset properties?
|
That's in fact another case where the |
You can send individual filesystems. It will send all snapshots.
* You need a script rather than a single command
* It doesn't preserve a few lesser-used features other than snapshots.
I agree that it would be good to be able to use -R while removing encryption. But for the moment, work on encryption should be centered on 11679. Nothing else should be done until that's fixed. It makes use of encryption at all dangerous.
…________________________________
From: PhilZ ***@***.***>
Sent: Thursday, April 14, 2022 9:40 AM
To: openzfs/zfs ***@***.***>
Cc: Charles Hedrick ***@***.***>; Comment ***@***.***>
Subject: Re: [openzfs/zfs] zfs send -R (non-raw) of encrypted dataset does not work (#10507)
I too need to replicate a system that has root on encrypted ZFS to a new system that will be unencrypted. Is there no way to do this other than rsync everything and manually set all the dataset properties?
This goes against the documentation for the -w flag: https://openzfs.github.io/openzfs-docs/man/8/zfs-send.8.html
That's in fact another case where the --no-preserve-encryption would be helpful, sending data to an unencrypted dataset. Currently it is not possible to decrypt on target while using -R. So, in all cases, you loose all the dataset properties. It is like once you encrypt, you can never go back using zfs send. It is ok, but you have to be aware of the limitations, until a new option is added
—
Reply to this email directly, view it on GitHub<#10507 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAORUCEGWKBPRWMJJDNPRJDVFAN4TANCNFSM4OKD55TA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
No, you cannot send, as he asked, from encrypted, using |
This, the encryption is recursive, so if any of the above datasets are encrypted, then you cannot send the individual filesystems while retaining dataset properties. I ended up sending without the -R flag and setting all the dataset properties manually. |
I just ran into this as well. This is pretty bad for a number of the use cases other folks mentioned but also one I think is even worse. The current operation forces you to accept either a) fragmented encryptionroot or b) you must always backup and restore the entire tree of datasets from encryptionroot down. Imagine I have the following tree of datasets I Now for whatever reason I need to restore just encrypt_root/parent2 and its descendants. Given current operation encrypt_root/parent2 and its descendants will now have a variant encryptionroot that cannot be merged back to encrypt_root. And there is no way around this unless I write a script that grabs encrypt_root/parent2 and all its descendants one by one to restore. Unless I have severely misunderstood something, this seems wrong. [1] As other folks mentioned, it's entirely plausible I want the encryption harmonized to the zfs target not the source. |
No, encryption is same on target, unless you modified it. So data in your case should be restored the same, that's what I found in all my tests if I remember well. |
I'm trying to backup an encrypted zpool to an external drive and this doesn't to work because of the aforementioned issue. Any ides how to get around it in the meantime? |
seems like it would make sense to have a reference to a related problem on the other end of the pipe zfs receive -F |
I'm trying to migrate the encryption from ccm to gcm but this limitation prevent me from sending the dataset to another one with a different encryption algorithm. |
@sotiris-bos I'm going to try something similar but I'm mainly concerned about the |
Looks like that can be handled by using |
My use-case: I don't care about the individual properties at all too much, but the snapshots associated with all individual datasets. The pool is used with lots of datasets and lots of regularly created snapshots for backup purposes I would like to keep. At some point I enabled encryption and XATTR=ON which mapped to LEGACY instead of SA in my setup and I've recognized poor performance when using RSYNC based backups. So my plan was to simply rewrite all datasets with an explicit setting of XATTR=SA using SEND+RECEIVE. This would include I'm totally fine if the encrypted data is sent and received encrypted, the new datasets encrypt it anyway again, as long as the XATTR -related data is rewritten in the new dataset to not use additional file system objects anymore, but follow the new setting of SA. Does anyone know if that is the case? Or does raw sent data means that really nothing changes, especially not the XATTR related data and how it's stored? |
As explained above, you cannot send an encrypted dataset preserving attributes without --raw. So, either you preserve encryption AND attributes or you loose both during send |
That doesn't explain how data related to XATTR is stored in the received dataset in the end: The property in the old dataset is XATTR=SA, while the actual stored data might be DIR on disk. I'm able to forward But the question is how is the XATTR related data actually stored on disk in the new received dataset? As SA like the property says already or as DIR, because it might be that way in the sent dataset? Property value and on-disk layout are simply different in this case. How do I check the on-disk storage of XATTR on my own? I found some ZDB using articles, but the output for my datasets was different and I didn't understand what I saw for existing files very likely using DIR compared to new files using SA. Or is the data really replaced already after changing to SA? The ZDB-output for my files looked a little bit like that, but the performance is still unexpected bad.
|
System information
Problem 1
Describe the problem you're observing
Describe how to reproduce the problem
@ahrens I tied that but it did not work, I am using the zstd-zfs version of zfs, git clone from BrainSlayer git main or master branch (I taught on github the word master was to be changed to the word main but the main branch is still called master) , been using this version of zfs for the past 6 months having no issues from zstd perspective.
Show below is my setup:
Problem 2
Describe the problem you're observing
pool cannot import
Describe how to reproduce the problem
Created a disk file use dd if=/dev/zero of= bs=4k
Created two partition on the disk file using GTP partition table
The first small partition contained vfat, and the second partition contained zfs
I imported the pool successfully with the command
zpool import -R <directory> -N <Original name> <New name>
Removed some zfs dataset
Include any warning/errors/backtraces from the system logs
The text was updated successfully, but these errors were encountered: