[Borgbackup] How to fix corrupted index or hints?

Thomas Waldmann tw at waldmann-edv.de
Thu Nov 17 15:51:56 EST 2022


> I will rerun the check and will provide the full log.

"borg check -v REPO" please, so it runs repository AND archives checks.

But first check your rsync command, see below.

> Could that be produced by a merge of an backup repo to the original one? 
> At the end I did an rsync -a from the backup to the original repo so the 
> state should be the state of the backup + newer files of the original 
> repo.

Uhoh, you can not do it like that and mix ("merge") stuff together.

If you want to rsync a valid repo from location SRC to location DST, you 
need something like:

rsync -a --delete SRC/ DST/

The --delete is important to delete files in DST that are not any more 
in SRC, otherwise you might get a weird mix up.

Did you forget the --delete?

>>> I tried to remove the hints file on the repo side, deleted the client 
>>> cache via "borg delete --cache-only" and run "borg check --debug 
>>> --progress --repair":

I just checked in the code: borg check --repair rebuilds the hints and 
index from information found in the segment files only.

>>> Remote: compacting segment 2000 with usage count -84 (maybe freeable: 
>>> 197.06% [276754300 bytes])
>>
>> Uhoh, that looks weird. :-( ^^^
> 
> 
> What should be the expected output if that is weird?

A usage count is how many valid (not deleted) PUTs are still in a 
segment file. And a count obviously can not be negative.

Also freeable space can be 100% max.

>> That's bad, I would have thought that your approach (deleting hints 
>> and cache, running borg check --repair) would fix the issue.

Still think so. ^^^

> Do you think it can be caused by the different borg versions of client 
> and server?

No.



More information about the Borgbackup mailing list