Skip to content
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

borg init: add a --additional-free-space=X option? default? #6288

Closed
fschulze opened this issue Feb 12, 2022 · 13 comments · Fixed by #8332
Closed

borg init: add a --additional-free-space=X option? default? #6288

fschulze opened this issue Feb 12, 2022 · 13 comments · Fixed by #8332
Milestone

Comments

@fschulze
Copy link

On a remote backup the disk quota was reached and borg failed to connect because borg serve just dies and locally I get:
Connection closed by remote host. Is borg working on the server?

I couldn't find a way to get it working again, so I ended up having to delete the full backup and loose all history.

I found the storage_quota and additional_free_space options, but no way to set them on an existing backup except by manually using sftp. It seems only --storage-quota is exposed via the init command, but not the other option (which from what I read seems more useful).

Locally I have borg 1.1.17, not sure what version Hetzner has on its storage boxes/backup spaces.

Shouldn't additional_free_space be set by default to prevent unrecoverable errors like this?

@ThomasWaldmann
Copy link
Member

Did you try borg config?

@ThomasWaldmann
Copy link
Member

About a default additional_free_space: how would you compute the default value to fit most future scenarios?

@fschulze
Copy link
Author

I tried borg config, but it is local only for security reasons according to the docs.

As I understand it the size of additional_free_space mostly depends on the segment size. But it doesn't really matter as long as there is enough space to let borg serve still run and let borg prune --save-space work to be able to recover.

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Feb 12, 2022

Right, only local borg config.

But I think there's also some temporary free space needed for repo index, hints, etc - and the size of these depend on the size of the repo.

Also, there could be outside influence on the free space if there is other stuff running on the borg repo server (so even if borg lets some space free / checks for free space according to additional_free_space, that could go away any time).

@ThomasWaldmann ThomasWaldmann changed the title Full disk causes borg serve to die borg init: add a --additional-free-space=X option? default? Feb 14, 2022
@ThomasWaldmann
Copy link
Member

i had a quick look and yes, i think an option --additional-free-space=X similar to --storage-quota=Y would make sense.

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Feb 14, 2022

and even without that, we could also change the repo config default value for additional_free_space to a non-zero value.
just wondering what value would fit most users / scenarios?

@ThomasWaldmann ThomasWaldmann added this to the 1.2.x milestone Feb 14, 2022
@fschulze
Copy link
Author

Maybe ask if not given and suggest 2G with some hints or a pointer to the docs?

And borg config should allow setting these variables. Since the server actually changes the values, I see no security problem, as ssh and the server process stand in between.

@ThomasWaldmann ThomasWaldmann modified the milestones: 1.2.x, 2.0.0b1 Jun 30, 2022
@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Jul 2, 2022

@m3nu I think we should have 2G .. 5G as default value there.

Usually people will have hundreds of GBs local space for their backups. OTOH, there are borg storage providers like borgbase.com with relatively small (10GB) "for free" accounts. Do you have an idea how we can raise the default without impacting such an offer too much?

@ThomasWaldmann
Copy link
Member

Hmm, guess whether that would make a difference for services like borgbase.com depends on whether they are using the borg-based quota (--storage-quota) or some external mechanism.

@m3nu
Copy link
Contributor

m3nu commented Jul 3, 2022

We use both, file system quotas and Borg quotas. The latter don't work on append-only repos, I think.

We also set additional_free_space to 5M to have enough space for the lock file.

@m3nu
Copy link
Contributor

m3nu commented Jul 3, 2022

Keeping 2GB available by default may be too much, since users can set the quota for a repo as low as 1 GB.

@ThomasWaldmann
Copy link
Member

Hmm, difficult to come up with a good value for everybody.

@ThomasWaldmann
Copy link
Member

See also #5313.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants