-
-
Notifications
You must be signed in to change notification settings - Fork 743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hardlinked repositories: a bad idea? #4272
Comments
|
For what it's worth, here's the result of the repair on the other repository: ... looks like the repair worked fine, which is interesting. i'm running a backup now to see if things work correctly there as well. presumably those |
|
borg-angela: looks like you have 2 zero-length segment files and lost the data that should be in there. i can not explain why these are zero-length, but as you are not sure that the repo was ok before you did your misc. operations on it, I'ld suggest you try to reproduce the problem starting from a known-valid repo. If you can reproduce, open a new ticket. |
|
The recover_segment code obviously needs to catch the zero-length case though, this is a bug. It does not even need to try to recover if there is nothing left there. |
…#4272 nothing left to recover there, but at least we must not crash in mmap().
…ckup#4272 nothing left to recover there, but at least we must not crash in mmap().
…ckup#4272 nothing left to recover there, but at least we must not crash in mmap().
This is a "short read". borg tried to read 41 bytes from that offset (length of a PUT header), but obviously it got less than that. |
|
Rather fundamental problems one runs into when copying repos and working on multiple of the copies independently:
Even if one fixes above by tweaking the repoid, one still has:
|
|
I guess the unexpected crash when reading the manifest for the repo for borg list comes exactly from that: it used the cached chunks index of the other repo and tried to read data from a location that wasn't valid for this repo. So the root cause here was not changing the repo id to something unique. But even when doing that, there is still the counter reuse security issue. So maybe one just should not do that. |
|
I see. That makes sense! Those repositories are in cleartext, so counter reuse is not a problem. If I understand this right, the repo id is generated with something like: from binascii import hexlify
import os
hexlify(os.urandom(32)).decode('ascii')... is that right? I have just rerun borg check on the I'll try to rename the repository and run a check again on both sides. |
|
Could be. I'ld just change 1 random digit, that's good enough for 1 copy. |
|
i tried renaming the notice the failed mmap on an empty file... the does that mean the files are still missing from the archive? and why does it say "no problems found" even if there are zero'd out files? sorry to be throwing all of that at you like that, I hope that's useful! |
|
mmap: already fixed, see PR. the no problems found refers to new problems (in this check run). |
|
you mean PR #4273? couldn't those empty files be related with with the zero'd out files cleaned up earlier? |
|
yes. all-zero replacement chunks do not have zero size, but \x00 bytes as content. |
|
alright, then i need to test the patch to see if it can repair the repository... it might take a while, my borg-fu is rusty. ;) |
recover_segment: handle too small segment files correctly, see #4272
…ckup#4272 nothing left to recover there, but at least we must not crash in mmap().
|
i've merged it now. use 1.1-maint branch, not master. |
|
thinking back on this issue, shouldn't we add a warning about hardlinked/copied repositories in the FAQ? i'd be happy to provide a PR for that if you wish. |
|
like "don't do that, use borg init"? yes. maybe check if there is something already (like mentioning rsync). |
|
well this FAQ explicitely says:
so there's definitely something more special than just cp, from what i understand. :) |
|
That FAQ section must mention that the only legitimate purpose of such a copy is to have a copy, but that one must never use borg to access multiple copies. |
|
PR done, in #4285. I thought of detailing the config |
…master recover_segment: handle too small segment files correctly, see #4272
add warnings on repository copies to avoid future problem, fixes #4272
Have you checked borgbackup docs, FAQ, and open Github issues?
Yes
Is this a BUG / ISSUE report or a QUESTION?
Bug
System information. For client/server mode post info for both machines.
Your borg version (borg -V).
1.1.8
Operating system (distribution) and version.
Debian buster 10
Hardware / network configuration, and filesystems used.
ext4, external USB 1.5TB HDD
How much data is handled by borg?
Around two 80GB original size sets, 200GB deduplicated, after a dozen archives.
Full borg commandline that lead to the problem (leave away excludes and passwords)
See below.
Describe the problem you're observing.
I am seeing the same error as #3737 after doing some crazy hacks on a repository, but it's probably not due to a memory error and more a user error. Since others might have that trouble (and it might be something we want to avoid in the future), I figured I would report it as a bug, but maybe it could be resolved with a "hell no don't do that" FAQ... (for example here). Here's the story:
I had a repository (
/media/calyx/borg, 1.5TB HDD external USB) where I would backup my workstation (curie) and laptop (angela). It was a nice experiment showing that while you can backup multiple machines to the same repository, and it does save space in the repository, but it implies resyncing caches and files so it felt a bit slow.So I figured I would try to split the repository in two. The plan was simple: copy the repository to
borg-curie(and rename the original one toborg-angela) and remove the "foreign" archives from the other. So I started:That archive was the oldest curie backup, if my memory is exact. Also note that I used hardlinks to avoid using too much space, a technique I took from the originally successful approach taken by
borg upgrade -i. This probably is the cause of all my problems here.I lost the backtrace here, but once the
borg deletecompleted onborg-angela, I couldn't create an archive inborg-curie. It failed with an error similar to #3737 which I can reproduce withcheck, below.Also note that I tried to create a new archive while the delete was happening, but it led to a locking issue (which is fine). I also don't have the backtrace on that, unfortunately.
Can you reproduce the problem? If so, describe how. If not, describe troubleshooting steps you took before opening the issue.
Simple reproducer:
That's pretty close to what happened, except that in the above the
borg-angelarepository is still intact. In my situation, it's also corrupt.Include any warning/errors/backtraces from the system logs
After the crash, I have moved the repositories around and tried to fix my mistake by copying the repository in multiple copies I could work on:
Now I have a copy of a copy of the repository in
borg-curie-corrupt-workwhich I'll try to restore. It fails:What's "funny" is that even the
borg-angelarepository seems corrupt. I attached the output ofborg checkon the angela repository because it's fairly large.angela-check.txt
I'm currently running a
--repairon that one as well, but makes me wonder if those repositories were healthy in the first place. But I was able to make a backup about a month ago without problems, here's the list of archives inborg-angelabefore the fateful move deleting that archive:The text was updated successfully, but these errors were encountered: