borg icon indicating copy to clipboard operation
borg copied to clipboard

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

Open fschulze opened this issue 3 years ago • 13 comments

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?

fschulze avatar Feb 12 '22 12:02 fschulze

Did you try borg config?

ThomasWaldmann avatar Feb 12 '22 12:02 ThomasWaldmann

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

ThomasWaldmann avatar Feb 12 '22 12:02 ThomasWaldmann

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.

fschulze avatar Feb 12 '22 13:02 fschulze

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 avatar Feb 12 '22 16:02 ThomasWaldmann

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

ThomasWaldmann avatar Feb 14 '22 19:02 ThomasWaldmann

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 avatar Feb 14 '22 19:02 ThomasWaldmann

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.

fschulze avatar Feb 15 '22 07:02 fschulze

@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 avatar Jul 02 '22 21:07 ThomasWaldmann

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.

ThomasWaldmann avatar Jul 02 '22 21:07 ThomasWaldmann

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 avatar Jul 03 '22 05:07 m3nu

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

m3nu avatar Jul 03 '22 05:07 m3nu

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

ThomasWaldmann avatar Jul 03 '22 12:07 ThomasWaldmann