Bug 69401
Summary: | btrfs send fails: No such file or directory | ||
---|---|---|---|
Product: | File System | Reporter: | Gabriel Hege (gabriel+kernel) |
Component: | btrfs | Assignee: | Josef Bacik (josef) |
Status: | RESOLVED PATCH_ALREADY_AVAILABLE | ||
Severity: | normal | CC: | kernel.org, xavier |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 3.13.0 | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
Gabriel Hege
2014-01-24 23:10:05 UTC
Here's a "me too". Ubuntu by default does an install on btrfs with root stored on the subvolume @ and /home stored on @home. Newer versions of btrfs send refuse to send snapshots stored beneath / or /home/ as described. Kernel version appears to be irrelevant; it's the btrfs-progs version. Btrfs send was working properly in 3.11, 3.12, and 3.14 before upgrading the btrfs-tools package; after upgrading the package to the newest in Debian Sid (3.12-1) the described behavior appeared (and occurs regardless of kernel version). Note that btrfs send DOES still work properly for filesystems mounted directly rather than as subvolumes; for example I have an entirely separate btrfs filesystem mounted to /data and btrfs send from /data/.snapshots works fine with the newer version of btrfs-progs. As a workaround, it's also possible to simply mount the root filesystem directly and send snapshots from there: you@box:~$ sudo mount /dev/sda1 /mnt/test you@box:~$ cd /mnt/test/@/.snapshots you@box:~$ sudo btrfs send snapshot-name | pv > /dev/null The above will work as expected. Having to do that to send a snapshot, though, is definitely sub-par - you have to be wary of locate database blowing up and all sorts of other potential weirdnesses, not to mention some ueless cluser with sudo possibly going "what's all this crap under /mnt/test/@? DELETE!", etc. This bug has been reported earlier on the mailing list (http://www.spinics.net/lists/linux-btrfs/msg29564.html) and has received a fix from Wang Shilong called "Btrfs-progs: avoid using btrfs internal subvolume path to send". This patch is in the integration branch of btfrs-progs official git repository (meant to become v3.13). Alternatively the workaround given by Jim Salter is the way to go with current progs. In his example i think the 'cd' is not required and one can also type: btrfs send /mnt/test/@/.snapshots/snapshot-name ... Ok, thanks. I can confirm that the problem is fixed with the commit from Wang Shilong on the integration branch. |