5

Is it possible to have rsync respect copy-on-write files from filesystems like btrfs?

I've been trying some tests of syncing a 1GB file and a copy-on-write clone of this file (so 1GB shared between them) from one btrfs fs to another but rsync will send 2GB of data and when I do btrfs filesystem du on the received files there are 0 bytes shared. So rsync is just creating a new copy rather than a CoW copy on the receiving end.

1

This is not a feature that rsync currently supports.

However, you could work around this in a few ways:

  • Let rsync transfer both files, then deduplicate them on the remote end with a btrfs deduplication tool.
  • Place the files on their own btrfs subvolume, and use btrfs send with btrfs receive.
  • rsync one of the files, create a clone of it, then use --checksum --inplace --no-whole-file to force rsync to patch the second file with just the differences from the first file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.