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

True support for sparse files is essential #4886

Closed
kroki opened this issue Dec 18, 2019 · 2 comments
Closed

True support for sparse files is essential #4886

kroki opened this issue Dec 18, 2019 · 2 comments

Comments

@kroki
Copy link

kroki commented Dec 18, 2019

This issue is related to #2562, but not the same.


Current documentation says that Borg doesn't preserve...

...representation of the holes in a sparse file. Archive creation has no special support for sparse files, holes are backed up as (deduplicated and compressed) runs of zero bytes. Archive extraction has optional support to extract all-zero chunks as holes in a sparse file.

Now suppose that the user has a huge (16TB on ext4) sparse file. While it will be stored efficiently in the repo, backup operation will require reading, chunking and MACing all the data.

Supporting efficient reading of sparse files during backup, but not storing information about holes in the repo is not a solution either: now suppose the user also has somewhat big file that is not sparse, but has lots of zero blocks (perhaps the user did fallocate() to ensure the space is available when she writes to file later, maybe she even defragmented the file to meet some real-time requirements).

Borg will backup both files the same way and on restore the user will have the choice: either restore all with holes (thus breaking fallocate()-type files), or restore all as-is, thus running out of space.

Please implement true support for sparse files with lseek(SEEK_DATA) and lseek(SEEK_HOLE) (avoid common mistake of assuming that file begins with data).

@kroki kroki changed the title True support for space files is essential True support for sparse files is essential Dec 18, 2019
@ThomasWaldmann
Copy link
Member

Duplicate of #14? If not, check if it fits there.

@kroki
Copy link
Author

kroki commented Dec 19, 2019

Yup, duplicate of #14, missed it.

@kroki kroki closed this as completed Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants