From: Rory Campbell-Lange <rory@campbell-lange.net>
To: Alex Lyakas <alex.btrfs@zadarastorage.com>
Cc: Arne Jansen <sensille@gmx.net>, linux-btrfs@vger.kernel.org
Subject: Re: btrfs receive to subdirectory
Date: Thu, 11 Oct 2012 12:33:59 +0100 [thread overview]
Message-ID: <20121011113359.GD22640@campbell-lange.net> (raw)
In-Reply-To: <CAOcd+r20CmNtpWvJ1KzgiyfTuUk=KMeM9b0okgQRefEhEyGPfA@mail.gmail.com>
On 11/10/12, Alex Lyakas (alex.btrfs@zadarastorage.com) 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@campbell-lange.net
next prev parent reply other threads:[~2012-10-11 11:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-08 16:30 btrfs receive to subdirectory Rory Campbell-Lange
2012-10-08 20:53 ` Arne Jansen
2012-10-09 11:18 ` Rory Campbell-Lange
2012-10-09 13:25 ` Alex Lyakas
2012-10-10 22:11 ` Rory Campbell-Lange
2012-10-11 9:10 ` Alex Lyakas
2012-10-11 11:33 ` Rory Campbell-Lange [this message]
2012-10-11 12:51 ` Alex Lyakas
2012-10-11 14:56 ` Rory Campbell-Lange
2012-10-11 18:38 ` Alex Lyakas
2012-10-12 11:26 ` Alex Lyakas
2012-10-12 16:10 ` Rory Campbell-Lange
2012-10-13 17:00 ` Alex Lyakas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121011113359.GD22640@campbell-lange.net \
--to=rory@campbell-lange.net \
--cc=alex.btrfs@zadarastorage.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=sensille@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).