kdave / btrfs-progs

Development of userspace BTRFS tools
GNU General Public License v2.0
557 stars 242 forks source link

send: incremental send fails on #441

Open marcochiodo opened 2 years ago

marcochiodo commented 2 years ago

The some problem fixed in issue #122 returned in btrfs-progs v5.10.1.

The problem appear during incremental backup


btrfs subvolume snapshot -r /home /home-BACKUP // OK
btrfs send /home-BACKUP | btrfs receive /media/backup-disk/ // First send OK
btrfs subvolume snapshot -r /home /home-BACKUP-new // OK

btrfs send -p /home-BACKUP /home-BACKUP-new | btrfs receive /media/backup-disk/
ERROR: not on mount point: /home
ERROR: empty stream is not considered valid

My system Linux version 5.11.0-49-generic Ubuntu 21.04

kdave commented 2 years ago

v5.10.1

Can you please try that on the latest version 5.16?

marcochiodo commented 2 years ago

I discovered that unlike issue #122 if I create the snapshot inside the mountpoint /home the problem with the send command does not exist.

btrfs subvolume snapshot -r /home /home-BACKUP // not work incremental send
btrfs subvolume snapshot -r /home /home/BACKUP // work!

I don't know if this was the intention of the creators of btrfs. In fact looking at the wiki https://btrfs.wiki.kernel.org/index.php/Incremental_Backup the backup is created inside the mountpoint.

That's probably okay

ettavolt commented 1 year ago

That's probably okay

Not really. Consider an extension of this backup thing to also perform a sync, like device1 → external drive → device2 → external drive → device1. I'll have to remove home subvolume to replace it with an rw snapshot of recent ro snapshot. But then after I remove the rw subvolume (/home), I lose access to ro snapshots (/home/BACKUP-xyz).