Wednesday, May 1, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 560  / 2 Years ago, sat, august 6, 2022, 11:28:42

I have 2 usb sticks, 8GB each:



usb1 = /dev/sdb
usb2 = /dev/sdc


usb1 is a full dm-crypted drive and I am currently using usb2 as a backup, just incase usb1 fails. I am cloning usb1 to usb2 using the following command:



dd if=/dev/sdb of=/dev/sdc


This works as I have tested usb2 and everything seems intact.



What I don't like about this method is that it takes about an hour to run the dd command.



Once I have cloned usb1 once, is it possible to keep usb1 and usb2 in sync without having to clone the whole drive using dd each time a text file is changed?



Can I use something like rsync to sync 2 usb sticks which are fully dm-crypted drives?



I can dd usb1 to usb2 without decrypting usb1. I'm hoping a solution exists where I don't have to decrypt both usb1 and 2 to sync them. I'm hoping the sync program can figure out the differences at binary level?


More From » backup

 Answers
4

Block devices can be synchronized using bdsync — a fast block device synchronizing tool.

bdsync was built to do the only thing rsync isn’t able to do: synchronize block devices.



bdsync "bdsync -s" /dev/LOCDEV /dev/REMDEV > DEV.bdsync  


This generates a diff DEV.rsync of the /dev/LOCDEV and the /dev/REMDEV devices which both are local.



bdsync --patch  DEV.bdsync /dev/DSTDEV  


will make the devices synchronized.


[#24888] Monday, August 8, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
olltea

Total Points: 238
Total Questions: 115
Total Answers: 107

Location: Moldova
Member since Tue, Feb 7, 2023
1 Year ago
;