linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Lyakas <alex.btrfs@zadarastorage.com>
To: junlion@tormail.org
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Incremental btrfs receive in opposite direction fails
Date: Sat, 29 Dec 2012 15:00:48 +0200	[thread overview]
Message-ID: <CAOcd+r3OjBAGbRN-cSbL7tQP=tTRYakZO3fm9gA_oqSz6KXuYw@mail.gmail.com> (raw)
In-Reply-To: <1ToibV-0001fD-SN@internal.tormail.org>

Hi,

On Sat, Dec 29, 2012 at 12:42 AM,  <junlion@tormail.org> wrote:
> Hi everyone!
>
> (I use kernel 3.7.1 and mason/btrfs-progs.git head + the receive
> lchown patch [1]. Is there a more up to date btrfs-progs repo for
> send/receive enthusiasts?)
There is no special repo, but you may want, in addition to the patch
you mentioned, apply this one as well:
https://patchwork.kernel.org/patch/1604391/
Whether you need it or not depends on how your subvolumes are
organized in a file tree.


>
> What I'm trying is basically:
>
> # Transfer a snapshot of my old system from a backup to the new system
> btrfs send /mnt/bak/.snap | btrfs receive /                 # OK
>
> # Merge the old system's files with the new system's files
> btrfs subvolume snapshot /.snap /.snap-merge                # OK
> mkdir /.snap-merge/.old                                     # OK
> mv /.snap-merge/* /.snap-merge/.old                         # OK
> cp -a --reflink /* /.snap-merge                             # OK
> btrfs subvolume snapshot -r /.snap-merge /.snap-merge-done  # OK
>
> # Incrementally transfer the merged files back to the backup drive
> btrfs send -p /.snap /.snap-merge-done | btrfs receive -p /mnt/bak
>
> The last step fails due to the changed direction of the transfer.
> "ERROR: could not find parent subvolume". It seems like btrfs receive
> cannot find the parent/clone source because it is searching for its UUID
> only by looking through the /mnt/bak snapshots' received_uuid fields.
>
> Is there a way for me to directly change the received_uuid of
> /mnt/bak/.snap to make it identical to the UUID of /.snap? This looks
> like the easiest way if I only need to do it once.
There is no implemented way, but since you debugged this far, you can
put up some code that sends BTRFS_IOC_SET_RECEIVED_SUBVOL, which is
the one setting the received_uuid (and some other small stuff, please
check the kernel code for it).

Thanks,
Alex.


>
> [1] https://patchwork.kernel.org/patch/1606091/
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2012-12-29 13:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-28 22:42 Incremental btrfs receive in opposite direction fails junlion
2012-12-29 13:00 ` Alex Lyakas [this message]
2012-12-30  6:40   ` junlion
2013-01-02 16:57     ` Jan Schmidt
2013-01-02 20:56       ` Jun Lion
     [not found]       ` <20130102205351.GA2242@localhost>
2013-01-02 22:19         ` junlion

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='CAOcd+r3OjBAGbRN-cSbL7tQP=tTRYakZO3fm9gA_oqSz6KXuYw@mail.gmail.com' \
    --to=alex.btrfs@zadarastorage.com \
    --cc=junlion@tormail.org \
    --cc=linux-btrfs@vger.kernel.org \
    /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).