-
Notifications
You must be signed in to change notification settings - Fork 387
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
rsync should support reflink similar to cp --reflink #119
Comments
Rsync is optimized for remote copies, where reflink isn't possible. A future version of rsync might have a more local-optimized copy mode that would allow this, but nothing is likely in the near future. There is already a bugzilla bug about reflink support. |
On Sun, Nov 29, 2020 at 12:24 PM Wayne Davison ***@***.***> wrote:
Rsync is optimized for remote copies, where reflink isn't possible. A future version of rsync might have a more local-optimized copy mode that would allow this, but nothing is likely in the near future. There is already a bugzilla bug about reflink support.
If it can do `--hard-links` I think `--reflink` should be in the same
vein. Would be great for both local rsnapshot usage, and possibly
remote cleverness could be plausible too as a form of deduplication!
Cheers
|
The patch for my version of using reflinks instead of hard-links for linking destination files together is in the rsync-patches repo: "clone-dest.diff" (since I think a clone is a more generic term that can apply to more than just btrfs, and "dest" keeps it grouped with the other --*-dest options). |
On Sun, Nov 29, 2020 at 12:50 PM Wayne Davison ***@***.***> wrote:
The patch for my version of using reflinks instead of hard-links for linking destination files together is in the rsync-patches repo: "clone-dest.diff" (since I think a clone is a more generic term that can apply to more than just btrfs, and "dest" keeps it grouped with the other --*-dest options).
Sweet! Can we merge it??
…
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
People need to test it first. Once it's been proven to be correct then it will be an easy merge. |
FYI, I've done some simple testing of the patch (clone-dest.diff) and made some fixes. |
@WayneD That's awesome!! This is out of my expertise to review unfortunately, but I'd love to see it grow tests and then go upstream. I'll try to ping some people to have a look... It's one of those horrible situations where you (Wayne) are responsible for the tool that everyone uses, but few people contribute to. |
Patch is here if anyone is looking btw: https://github.com/WayneD/rsync-patches/blob/master/clone-dest.diff |
Are there any news about this? Any plans to integrate the patch? |
Nobody has tested and reported back. |
I have tested it now... it seems to be working as described, but this is not really all that useful. |
rsync --reflink option can be remote as well. When I copy bunch of duplicate data from local host (which already reflink locally) to remote host would be nice rsync will prevent duplicate data and create reflink instead on remote. |
reflinks are just links on local filesystem, they literally can not be used on remotes, what you are talking about, is delta transfer, and it is the main feature of rsync |
I think you can just first delete dest file and then just reflink it, problem solved |
Rsync is used on lots of local-only environments, such as rsnapshot, for example. |
I don't think so. Reflinks on COW filesystems are not visible like soft links are, and are still different from hardlinks. Hardlinks are pointing to the same inode, changes on both hardlinks are applied to the same file. Reflinked files can be both changed, they are basically 2 different files, while only the filesystem internally knows about the reflink. cp --reflink advises the filesystem to reflink if supported, rsync locally could do so as well. |
yeah, I know what reflinks are, I use them a lot, they are BASICALLY links to other file on an FS level, with ability to lay changes on top of it |
You didn't explain it. You simply do not understand how it works. That remote filesystem can have reflink support same as local filesystem. When you copy files from local to remote you can copy 1 file + 10 reflink, and get 1 file + 10 reflink. Instead you create 11 files on remove filesystem. Also you do not understand that by saying "links" you are referring to "soft links". |
Yes, I know (even though reflink literally has "link" word in them, but ok), that's why I used them as analogy, that's why I said "basically", even highlighted it in caps, because on a basic level, they are just "linked" files on an FS level, and any changes to those "links" are just "connected", or "laid on top" of that link, and also all those links are "equal", you need to delete all of them to really get rid of file data |
More details in: https://bugzilla.samba.org/show_bug.cgi?id=10170
Manual import:
The text was updated successfully, but these errors were encountered: