I asked in btrfs IRC, got suggestion but when I try to actually do it, I got error.
So I am trying to describe my testing setup in full here.
- create a new subvol subvol-A
btrfs subvol create /mnt/send/subvol-A
- Create 8 100MB files
$ for i in 1 2 3 4 5 6 7 8;do dd if=/dev/random of=subvol-A/file0$i.img bs=1M count=100;done
- Create readonly snapshot of subvol-A as Subvol-A-0
btrfs subvol snap -r /mnt/send/subvol-A /mnt/send/readonly/subvol-A-00
- send over
btrfs send /mnt/send/readonly/subvol-A-00 | btrfs receive /mnt/receive/received/
- modify something inside subvol-A and send incrementally
mkdir /mnt/send/subvol-A/f1
mv /mnt/send/subvol-A/file0{1,2,3,4}.img /mnt/send/subvol-A/f1
btrfs subvol snap -r /mnt/send/subvol-A /mnt/send/readonly/subvol-A-01
btrfs send -p /mnt/send/readonly/subvol-A-00 /mnt/send/readonly/subvol-A-01 | btrfs receive /mnt/receive/received/
- Next, convert f1 “from folder to subvol”
mv /mnt/send/subvol-A/f1 /mnt/send/subvol-A/f1.tmp
btrfs subvol create /mnt/send/subvol-A/f1
mv /mnt/send/subvol-A/f1.tmp/* /mnt/send/subvol-A/f1/
rmdir /mnt/send/subvol-A/f1.tmp
- send change of to subvol-A incrementally
btrfs subvol snap -r /mnt/send/subvol-A /mnt/send/readonly/subvol-A-10 #here as f1 is a subvol, it is not included in this snapshot
btrfs subvol send -p /mnt/send/readonly/subvol-A-01 /mnt/send/readonly/subvol-A-10 | btrfs receive /mnt/receive/received/
# so now subvol-A is sent
- Create snapshot of subvol-A/f1
btrfs subvol snap -r /mnt/send/subvol-A/f1 /mnt/send/readonly/f1-10
Now the question:
How to efficiently (in terms of transmitted data volume) send f1-10 over?
Update: add btrfs-mailling list topic link
https://lore.kernel.org/linux-btrfs/CACEy+ETCvJ+cKn6N4maL0Dq1608pKtCXYSX6CO0oz4B8X1=gLw@mail.gmail.com/T/#u