borg icon indicating copy to clipboard operation
borg copied to clipboard

borg check: doing a repair using redundant related repos

Open ThomasWaldmann opened this issue 3 years ago • 2 comments

borg2: we can now have multiple "related" repos based on the same key material.

this includes the key for the id hash / MAC and also the chunker secret, thus chunking will happen in the same way and also the chunkid computation will happen in the same way.

so, if you make 2 individual backups (at approximately the same time) into 2 such repos, there will be a huge (although not necessarily 100%) overlap of chunkids with the respective content.

if one would use borg transfer to copy an archive to another related repo, there would be even a 100% overlap of chunkids for this archive.

even if both repos lose some chunks, there would be a good chance that each of these chunks can still be found in one of them.

guess the only missing piece is some code helping with such repairs.

could be something like: borg --repo=REPO_TO_REPAIR check --other-repo=REPO_TO_READ_FROM --repair

ThomasWaldmann avatar Apr 12 '22 22:04 ThomasWaldmann

Interesting - once there is a tool doing such repairs (and checks - e.g. I'd also want to know about discrepancies between chunks which shall be identical but are not), I'll give it a try.

dumblob avatar Apr 13 '22 07:04 dumblob

Likely this is doable more easily / cleanly after we dropped support for old repos.

ThomasWaldmann avatar Aug 11 '22 15:08 ThomasWaldmann