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

Merged
merged 1 commit into from
Jun 10, 2024
Merged

Handle sparse files correctly #217

merged 1 commit into from
Jun 10, 2024

Conversation

vxrtns
Copy link
Contributor

@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
Contributor 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.

@azlux
Copy link
Owner

azlux commented Jun 8, 2024

Sorry for the long delay.
If still actual, We can test the feature for log2ram testers on the next beta release.

@vxrtns
Copy link
Contributor Author

vxrtns commented Jun 9, 2024

Yes, the problem still persists. Would be nice if you could include it for testing.

@azlux azlux merged commit 1ad5f1b into azlux:master Jun 10, 2024
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.

2 participants