SyncThing for syncing a raw block device

Hi!

I love SyncThing! I would really like to be able to use it to synchronize a block device.

Is this feasible? I tried a symlink to a block device and “Junctions as Dirs” but that didn’t work.

Somewhere a Syncthing contributor mentioned that it should work well for block devices, but I think that meant files that represent block devices.

It seems like all of the chunking and syncing logic should be perfectly re-usable with SyncThing, if only I could tell it to read a symlink to a device and honor it.

Can someone let me know how feasible this is, and/or how hard it would be to add this to SyncThing?

It seems like maybe one of the changes would need to be in here.

It seems like this is somewhat near the bottom of the scanner’s walking process, where it handles regular files:

I’ve used rsync --devices /dev/disk/by-partlabel/boot /syncthing/test/boot_node to create another block device node in the /syncthing/test directory and give my user ample permissions to access it.

Any thought so far?

You can probably trick Syncthing into reading the device fairly easily. However it won’t have any useful modification metadata or support notifications so I’m not sure what mechanism you’d use to schedule rescans.

On the receiving end, if you’d like that to be a block device as well, you’d need to implement in place writes as Syncthing currently always uses a temp file that it renames over the destination. This would be a major chunk of work to do properly.

In short, I think you’ll find Syncthing is a bad fit.

1 Like