How to create encrypted backup in 4GB blocks?

zierbeek

Explorer
Joined
Apr 4, 2021
Messages
54
Hi there,

Since Terabox is offering 1tb free storage in 4GB blocks, I would like to create encrypted backups of my datasets since the storage in terabox is not encrypted. I know, the free tiers are mostly not to be continued for years, I have other cloud syncs in place :)

I think that this would go through the replication tasks, a 4GB limit, Hex encryption(?), and lz4 compression. An ssh connection to my computer to store it before uploading to terabox


EDIT: allright, for this to work, I should create an ssh connection between my Mac and truenas. This can be done already since I generated a keypair on my Mac and copied the public key in truenas account. I get an error that connection is refused.

Thanks in advance
 
Last edited:

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
I think that this would go through the replication tasks
No, not unless your datasets are all under the limit.

You have two choices here, but both derive from "zip them up and break the archive into chunks". I know that the zip utility can do this, and there may be a way of coaxing tar into doing the same, other than by brute force. Anyway, your options are:
  1. Send a snapshot to a file (something like zfs send path/to/dataset@snapname | zip --from-stdin --break-this-up-into-chunks 4G)
  2. Straight-up archive your stuff (zip -r --break-this-up-into-chunks 4G)
Please note that the above is merely pseudocode, vaguely representative of the parts of the pipeline most relevant to your question.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
The program DAR, (aka Disk Archiver), can do it. May not be loaded on TrueNAS.

DAR can encrypt using GNU PG encryption keys and can split the output in user defined slices. This accomplishes both your goals, encrypt and split. DAR can also be be made to wait after a slice is made, for user input. Or even run a command after a slice is finished. That may allow moving the slice file to the remote destination on more limited local storage.

One nice thing about DAR, (but I have not tested), is that if a block slice is missing, you can still recover any files from other block slices.

It's been a while since I used DAR, but it's under active support / development:
 
Last edited:
Top