phrozenbyte / iblocksync Goto Github PK
View Code? Open in Web Editor NEWiblocksync incrementally syncs raw disk images.
License: GNU General Public License v3.0
iblocksync incrementally syncs raw disk images.
License: GNU General Public License v3.0
As soon as the local instance has both hashes of the first block, it might request this block from the sender and forward it to the receiver. However, it should be possible to disable parallelization, because reading hashes and reading/writing blocks at the same time will cause a heavy slowdown on HDD storages (unless network speed is slower anyway...).
Remotes then also need threading for computing hashes (async, i.e. we compute the next hash even though we didn't send the previous hash yet) and sending/receiving blocks (sync, i.e. we only send/receive one block at a time). We must furthermore add package identifiers to the network protocol (to distinguish hashes and blocks) and ensure that we don't accidentally mix packages mid-data (this can indeed happen because we use stdout/stdin; maybe with a third thread responsible for communications?).
Trying to sync images of different sizes with a non-divisible block size (e.g. syncing a source image of 10 MiB to a target image of 12 MiB with a block size of 4 MiB) fails with the following error:
RuntimeError: Can't sync images of different sizes with a non-divisible block size
This is expected behaviour for now. You must either switch to a divisible block size (e.g. 2 MiB), or ensure that both images match in size, or sync to a non-existing (or zero-length) target image.
The reason is that the last blocks of the images don't match in size (e.g. 2 MiB for the source image, but 4 MiB for the target image). This will not only cause the last block to be always considered different, but will also confuse communications. Right now we don't really use a network protocol, but rather dump raw data. This works because all components are synced and know how many bytes they must read or write. However, due to the size mismatch the sender will send just 2 MiB for the last block, but the receiver will expect 4 MiB - what will cause the program to hang indefinitely.
The only solution is to implement a proper network protocol with package sizes. Also see #3.
However, make sure that this doesn't break wrapper scripts, because they might not be resumable (i.e. make this an option, not the default behaviour).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.