Hi Rory,
all your tests work perfectly for me (really, I swear:)), with exact
same mount points and subvol/snap/dir names.
Just to make that the patch some how did not get messed up in the
mail, I attach it.
Can you pls post the output of "cat /proc/mounts" and "mount" (if
you're willing to debug this further).
Other than that, I will probably need to see the contents of your
source subvol (at least file names, not necessarily the content). So
if you can expose it, can you perhaps do something like:
tree -A --inodes --noreport -s /bkp/subvol
and also
tree -A --inodes --noreport -s /mnt
before you start the test (I assume that two subvolumes at /mnt are
empty, right).
However, I doubt the contents will really help, because it seems to
fail very early, even before it starts processing the commands.
Thanks,
Alex.
On Thu, Oct 11, 2012 at 1:33 PM, Rory Campbell-Lange
<rory@xxxxxxxxxxxxxxxxxx> wrote:
> On 11/10/12, Alex Lyakas (alex.btrfs@xxxxxxxxxxxxxxxxx) wrote:
>> I am using the latest code from Chris's repo (
>> git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git),
>> which has been updated recently (latest commit
>> 91d9eec1ff044394f2b98ee7fcb76713dd33b994).
>> Do you think you can try the following patch on top of this commit? (I
>> made another small fix).
>
> I had to fix the line wrapping, but your patch applies fine now.
>
>> Basically, the idea is that the path that you give to "btrfs receive"
>> should be the destination directory, in which the received subvolume
>> will be created. And this directory should be somewhere under a mount
>> point, where destination btrfs is mounted (it can also be the same as
>> the mount point, but not above it). Does this make sense?
>> Also it should not matter where the sent subvolume resided in the
>> source fs, and, if this is a diff-send, where you have received the
>> parent snapshot to (as long as it is on/under the same mount point).
>
> I don't think the receive pathing works. Please note below the following issues:
> [aa] ERROR: open snapdir/subvol_20121011_1214 failed. No such file or directory
> [bb] ERROR: open <FS_TREE>/snapdir/subvol_20121011_1214 failed. No such file or directory
> [cc] ERROR: open <FS_TREE>/snapdir/subvol_20121011_1214 failed. No such file or directory
>
> I tested this with the following:
>
> send mount point /bkp
> receive mount point /mnt
>
> The 'send' mount point has the following structure:
>
> root@orchard:/bkp# ls
> > snaps subvol
> (subvol a btrfs subvolume, snaps a directory for holding snapshots)
>
> I then made a directory and two subvolumes in /mnt to receive 'sends':
>
> root@orchard:/bkp# ls /mnt
> > arbitrary_subvol snapdir subvol
>
> I applied your patch to progs 91d9eec1, then did the following rooted in /bkp:
>
> 1. Create snapshots
>
> root@orchard:/bkp# btrfs subvolume snapshot -r subvol snaps/subvol_20121011_1214
> > Create a readonly snapshot of 'subvol' in 'snaps/subvol_20121011_1214'
>
> root@orchard:/bkp# mutt -f subvol/INBOX
> > 1573 kept, 39 deleted.
>
> root@orchard:/bkp# btrfs subvolume snapshot -r subvol snaps/subvol_20121011_1216
> > Create a readonly snapshot of 'subvol' in 'snaps/subvol_20121011_1216'
>
> 2. Send base snapshots to /mnt/{snapdir,arbitrary_subvol,subvol}
>
> root@orchard:/bkp# btrfs send snaps/subvol_20121011_1214 | btrfs receive /mnt/snapdir
> > At subvol snaps/subvol_20121011_1214
> > At subvol subvol_20121011_1214
>
> root@orchard:/bkp# btrfs send snaps/subvol_20121011_1214 | btrfs receive /mnt/arbitrary_subvol
> > At subvol snaps/subvol_20121011_1214
> > At subvol subvol_20121011_1214
>
> root@orchard:/bkp# btrfs send snaps/subvol_20121011_1214 | btrfs receive /mnt/subvol
> > At subvol snaps/subvol_20121011_1214
> > At subvol subvol_20121011_1214
>
> 3. Send incremental changes
>
> root@orchard:/bkp# btrfs send -p snaps/subvol_20121011_1214
> snaps/subvol_20121011_1216/ | btrfs receive /mnt/snapdir
> At subvol snaps/subvol_20121011_1216/
> At snapshot subvol_20121011_1216
> ERROR: open snapdir/subvol_20121011_1214 failed. No such file or directory [aa]
>
> root@orchard:/bkp# btrfs send -p snaps/subvol_20121011_1214
> snaps/subvol_20121011_1216/ | btrfs receive /mnt/arbitrary_subvol
> At subvol snaps/subvol_20121011_1216/
> At snapshot subvol_20121011_1216
> ERROR: open <FS_TREE>/snapdir/subvol_20121011_1214 failed. No such file or directory [bb]
>
> root@orchard:/bkp# btrfs send -p snaps/subvol_20121011_1214
> snaps/subvol_20121011_1216/ | btrfs receive /mnt/subvol
> At subvol snaps/subvol_20121011_1216/
> At snapshot subvol_20121011_1216
> ERROR: open <FS_TREE>/snapdir/subvol_20121011_1214 failed. No such file or directory [cc]
>
>
> root@orchard:/bkp# btrfs subvolume list /bkp
> ID 256 gen 9 top level 5 path subvol
> ID 260 gen 7 top level 5 path snaps/subvol_20121011_1214
> ID 261 gen 9 top level 5 path snaps/subvol_20121011_1216
>
> root@orchard:/bkp# btrfs subvolume list /mnt
> ID 301 gen 66 top level 5 path arbitrary_subvol
> ID 302 gen 69 top level 5 path subvol
> ID 303 gen 66 top level 5 path snapdir/subvol_20121011_1214
> ID 304 gen 69 top level 5 path arbitrary_subvol/subvol_20121011_1214
> ID 305 gen 72 top level 5 path subvol/subvol_20121011_1214
>
>
>
> --
> Rory Campbell-Lange
> rory@xxxxxxxxxxxxxxxxxx
Attachment:
rory.patch
Description: Binary data
