-
Notifications
You must be signed in to change notification settings - Fork 6
Fix32 #10
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
base: main
Are you sure you want to change the base?
Fix32 #10
Conversation
|
Thanks for reporting the issue on ARM and for submitting fixes related to the max file/device size bug and some minor code errors. You're right — on 32-bit systems, Your code works well — I’ll review it again. I think using Out of curiosity: what hardware/system are you using? I'd like to emulate ARM and make sure the final version is fully compatible. Glad to hear blocksync-fast is useful on such platforms — thanks again! |
|
Hi! Thanks for coming back to that PR. I may have introduced extra bugs, so please review. Note, that I use "-O3" because this shows up to 10 times acceleration on XXH benchmarks compared to standard "-O0" which is a bit suspicious. For that reason I added some md5extra feature branch in my repo (not meant for some next PR). Some background: I'm trying to start a project "Nextcloud on small SBC for home users". For this, I am working with OrangePi Zeroes currently, those have 32bit and 64bit ARM cores. Those cute little things have SD cards for storage, thus prone to failures so we need some good backup concept obviously. Heres a photo of my test setup (green=32bit, black=64bit). For the Orange PIs, I currently plan to use blocksync-fast as nightly image backup. This uses Linux device mapper, LUKS encryption and stuff. May be enriched e.g. by "dm-era" if I understand how to integrate device mapper write logging with LVM2. Here's snippet of a concept do I wrote earlier if you are interested. Best // Sven-Ola Backups (english)The SD card holds two partitions:
Later during the user installation you need to set a backup / user password on keyslot 0 while deleting the standard password in keyslot 6. So if the SD card is removed from the Orange Pi gadget, you can decrypt the second partition with your user password, e.g. when inserting the SD card in another Linux PC. Both the standard Linux partition and the encrypted LUKS partition are bound together as a united file system ("unionfs"). The standard Linux files resides in the lower part and the LUKS partition with the user files forms the overlay / upper part. All user data thus is stored encrypted. Also, we only need to backup the encrypted user data, because we can restore the underlying standard Linux simply by downloading and installing. Note, that the upper /boot is a bind mount to the lower /boot. With this, updates to the kernel or to the initramfs / armbianEnv.txt are written to the standard Linux ready for the next boot. Also, swap files are incompatible with unionfs, so those needs to be stored outside the unionfs but whithin the encrypted area. The backup is done as image backup of the LUKS partition. We use the program "blocksync-fast" for this. A nightly backup works basically with these steps:
Most computing resources are required to check all data blocks of the LVM snapshot images for changes that needs to be written to the backup image. This is done on the Orange Pi gadgets, thus utilization on the central storage device is relatively low. Because we store LVM LUKS images (which can only be decrypted with the user password) no further data security on the friendly backup server is required. With LVM snapshots we can save backups while writing user data concurrently, thus we only have some seconds downtime in the night and around 10-20 minutes of higher CPU utilization / slower answering times which should be tolerable anyhow. |
|
Hi, Your project is very interesting — lots of challenges! I’ve read it with full engagement and understanding of how it works.
As I understand it, I do have a few trivial but curious questions:
I also have a set of improved A quick note on XXH speed: So far, I noticed one odd thing: since version Tests from I'm still not sure what causes that performance regression. |
|
Hey! Appreciate your feedback 😎 I have used this sunday to investigate dm-era and try to get some experience with my backup strategy. Those little things are bound together via a simple VPS, a couple of wireguard tunnels and some haproxy setup, so e.g. you can access them via https://bpi1.privat-in.de or https://opi2-2.privat-in.de (as long as they are switched on). I plan to deploy more than one backup server / NAS gadget, but currently I only have one. The NAS is also a bit flakey (sometimes HDD throws errors, sometimes CPU is too hot), so it's a good proving ground I presume. I played today with dm-era using a blog entry from 2017 and try this out on a virtual box - see https://www.cloudandheat.com/en/block-level-data-tracking-using-davice-mappers-dm-era/ (recommend this as a good read). Not sure how to use this in a fail-safe manner / in production / with end users switching off gadgets at will. OTOH: I currently use 32 GiB SD cards while utilizing only 50% to give the wear levelling of the cards a chance to survive. So we got 14 GiB snapshot images backup that need around 15 minutes to be read and checksummed in the night. Nobody prevents users from buying 256 GiB cards, thus there lurks a 2 hour checksum session to be optimized. To answer you questions: currently, the digest is not stored in a separate LV. There are plenty of other changes during a day (writes to /var/log/journal...) so an extra LV seems not to have an advantage. Yes, I use SSH transfers currently. The backup gadget has a ~/.ssh/authorized_keys that limits the actions, such as command="/usr/local/bin/privat-in-backup bpi1" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINh1i0f4mHnKniYcfwt/iTbq+HspvPHye8hGvYl8yRfn root@bpi1 with the script that limits the possible actions: The plan is to generate a digest on the backup side from time to time, comparing both digests and eventually download the backup side digest before sending a new delta. And you are right: I may need better interrupt / disaster handling on the sending side. Working on a digest copy sounds like an idea to be checked out. Regarding the benchmark speeds: I compiled 1.0.5 on arm32 and compared to current (both compiled with -O3). I don't see a difference (first run is 1.0.5, then started my "fix32" version: |
|
Thanks for the links, I’ll study them carefully. Regarding the performance issue: I’ve compared all changes between versions, and there’s nothing that could explain the drop in speed, especially for just one algorithm: I even copied individual source files from different versions and tested them, but it still doesn’t make sense. One tip if you want to compare digest files created on different machines:
and comparing it to local.digest (for example, on an ARM machine):
The reason is that the operation timestamp is stored in the header so checksums will differ even if the actual data blocks are the same. Caught myself with that one too. 😉 |

I have some ARM boards (32 and 64 bit) that needed massaging...