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

Handle sparse files correctly #217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Handle sparse files correctly #217

wants to merge 1 commit into from

Conversation

vxrtns
Copy link

@vxrtns vxrtns commented Nov 24, 2023

See issue #138.
Right now, big sparse files (e.g. log files with big "holes" in them, like /var/log/lastlog when users/groups with large ids exist) take up much space when written to disk, because they are written as regular files, not sparse files.
rsync supports --sparse in combination with --inplace since version 3.1.3 which was published early 2018.

@azlux
Copy link
Owner

azlux commented Dec 5, 2023

Hello,
I didn't knew about this option. Are you sure about it ? When I read the man page, I see:

Try to handle sparse files efficiently so they take up less space on the destination. Conflicts with --inplace because it's not possible to overwrite data in a sparse fashion.

The option inplace is used to avoid overwriting file on the SDcard.

@vxrtns
Copy link
Author

vxrtns commented Dec 6, 2023

Hi,
as I mentioned, version 3.1.3 or later of rsync is needed.
The last supported Debian version, Buster, has rsync 3.1.3 (see here), Bullseye and Bookworm have even newer ones.
So all current Debian versions support the needed rsync version 3.1.3. Because of that checks shouldn't have to be implemented.

You're somewhat right with the man page, but it seems to be an old one.
If you look at these lines in a commit that was merged into rsync version 3.1.3, you can see the man page was updated with a new text that says usage of --sparse in combination with --inplace is possible and just doesn't copy the holes in a file (as it's intended to be with sparse files), starting with rsync 3.1.3.

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

Successfully merging this pull request may close these issues.

None yet

2 participants