linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rory Campbell-Lange <rory@campbell-lange.net>
To: Arne Jansen <sensille@gmx.net>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: btrfs receive to subdirectory
Date: Tue, 9 Oct 2012 12:18:30 +0100	[thread overview]
Message-ID: <20121009111830.GC31743@campbell-lange.net> (raw)
In-Reply-To: <50733D66.5020600@gmx.net>

On 08/10/12, Arne Jansen (sensille@gmx.net) wrote:
> On 10/08/12 18:30, Rory Campbell-Lange wrote:
> > I can send snapshots to <volume>, but not <volume>/<dir>. Please advise
> > if what I am doing is incorrect.

> > Try and snap to /mnt/<subdir>
> > 	root@orchard:/bkp# mkdir /mnt/snaps
> > 	root@orchard:/bkp# btrfs send snaps/snap_081012_1715 | btrfs receive /mnt/snaps
> > 	> At subvol snaps/snap_081012_1715
> > 	> At subvol snap_081012_1715
> > 	root@orchard:/bkp# btrfs send -p snaps/snap_081012_1715 \
> > 	                   snaps/snap_081012_1716 | btrfs receive /mnt/snaps
> > 	> At subvol snaps/snap_081012_1716
> > 	> At snapshot snap_081012_1716
> > 	> ERROR: open snaps/snap_081012_1715 failed. No such file or directory
> >     root@orchard:/bkp# ls /mnt/snaps
> >     > snap_081012_1715
> 
> The target has to be a subvol also. But interestingly enough, it also
> fails for a subvol. The base send works, the incremental fails, because
> btrfs receive can't find snaps/snap_081012_1715. If you give /mnt/snaps
> as the target for the base and just /mnt for the incremental, it works.
> There's clearly something broken there...

Actually, this does work:

    root@orchard:~# mkfs.btrfs /dev/sdb1
        ...snip...
        > Btrfs v0.20-rc1-37-g91d9eec
    root@orchard:/bkp# ls
        > snaps  subvol
    root@orchard:/bkp# mount /dev/sdb1 /mnt
    root@orchard:/bkp# btrfs subvolume create /mnt/subvol
        > Create subvolume '/mnt/subvol'
    root@orchard:/bkp# btrfs send snaps/snap_081012_1715 | btrfs receive /mnt/subvol
        > At subvol snaps/snap_081012_1715
        > At subvol snap_081012_1715
    root@orchard:/bkp# btrfs send -p snaps/snap_081012_1715 \
                             snaps/snap_081012_1716 | btrfs receive /mnt/subvol
        > At subvol snaps/snap_081012_1716
        > At snapshot snap_081012_1716

It certainly seems to work if the receive target is a subvolume other
than the implicit subvolume at the root of the mount point.

So one can only btrfs receive to a subvolume, which makes sense, and is
I believe the reason one cannot 'btrfs receive to a subdirectory' as set
out in the subject of my original email.

Are there any other problem cases you can see, Arne?

Regards
Rory

-- 
Rory Campbell-Lange
rory@campbell-lange.net

  reply	other threads:[~2012-10-09 11:18 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 [this message]
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
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=20121009111830.GC31743@campbell-lange.net \
    --to=rory@campbell-lange.net \
    --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).