Skip to content
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

pyznap send on encrypted pool produces multiple issues: ignoring --exclude, breaks mbuffer, ... #87

Closed
se-jaeger opened this issue Oct 22, 2021 · 4 comments

Comments

@se-jaeger
Copy link

Hi,

I want to send my encrypted datapool to a backuppool, which is an USB drive.
The backuppool is created as follows (settings are copied from datapool creation script. I already tested without those.):

zpool create -o ashift=12 -O acltype=posixacl -O compression=zstd -O normalization=formD -O relatime=on -O dnodesize=auto -O xattr=sa backuppool /dev/disk/by-id/<USB drive>

For this I'm using pyznap:

pyznap send \
  --source "datapool" \
  --dest "backuppool/homeserver" \
  --exclude "datapool/dataset1" "datapool/dataset2" \
  --raw \
  --dest-auto-create

Unfortunately I encountered some issues and errors.

  1. --exclude is ignored at all. Nothings changes if I add, e.g., "datapool/dataset1/*" to ignore all subsequent datasets
  2. for all top level datasets, e.g., datapool/anexample, I get the following error (child datasets work as expected, e.g.: datapool/anexample/test):
ERROR: Error while sending to backuppool/homeserver/anexample: cannot receive new filesystem stream: zfs receive -F cannot be used to destroy an encrypted filesystem or overwrite an unencrypted one with an encrypted one...
  1. Sometimes mbuffer fails:
mbuffer: error: outputThread: error writing to <stdout> at offset 0x60000: Broken pipe
mbuffer: warning: error during output to <stdout>: Broken pipe

What I tried to get it running properly (without success).

  • Don't use --exclude, instead run pyznap multiple times for each datapool/dataset I want to send
  • use --resume
  • create backupool without setting any properties: zpool create backuppool /dev/disk/by-id/<USB drive>
  • remove the intermediate dataset on the backuppol: --dest "backuppool"

Any ideas what's wrong or how I can solve my issues? I'm very happy to help!
Thank's in advance.

@se-jaeger se-jaeger changed the title Can't send to USB disk pyznap send on encrypted pool produces multiple issues: ignoring --exclude, breaks mbuffer, ... Oct 22, 2021
@yboetz
Copy link
Owner

yboetz commented Oct 24, 2021

Hi

This seems to be a limitation of zfs send/receive with encrypted datasets: openzfs/zfs#6793

It seems that with encrypted datasets you cannot use the -F flag, though that is needed in pyznap for incremental updates. I'm not sure how to work around this with pyznap atm.

The mbuffer errors is related, if the receive fails then mbuffer also shows an error.

--exclude works for me for non-encrypted datasets. Note that datapool/dataset1/* will not ignore datapool/dataset1 itself, only its child datasets.

@se-jaeger
Copy link
Author

Thanks for your answer!

I'm not sure if I understand when -F is valid but that's related to ZFS and not pyznap.
Let me dig into the code and check whether I can understand the issue properly and find a solution.

At least we can ignore the mbuffer error.

I use pyznap to backup my rpool regularly to datapool, both are encrypted. --exclude works as expected. Do you think the reason here could be that the target (datapool) is decrypted? When sending to a backuppool it's encrypted.

@yboetz
Copy link
Owner

yboetz commented Oct 26, 2021

Yes I think that is the reason. The problem from the -F flag arises from the target dataset being encrypted, so if your datapool is not encrypted then I guess everything works as it normally would.

@se-jaeger
Copy link
Author

Implemented a simple ZFS only script to create offsite backups.

Since this is no really pyznap issue, I suggest to close this one.

@yboetz yboetz closed this as completed Oct 29, 2021
whoschek added a commit to whoschek/pyznap that referenced this issue Nov 13, 2021
…does not work with encrypted datasets data in some cases).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants