linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Eric Levy <contact@ericlevy.name>, linux-btrfs@vger.kernel.org
Subject: Re: receive failing for incremental streams
Date: Thu, 16 Dec 2021 08:36:03 +0300	[thread overview]
Message-ID: <b68822f1-0ad7-8434-6aa1-553e264e232c@gmail.com> (raw)
In-Reply-To: <03e34c5431b08996476408303a9881ba667083ed.camel@ericlevy.name>

On 15.12.2021 23:27, Eric Levy wrote:
> Hello.
> 
> I have been experiencing very confusing problems with incremental
> streams.
> 
> For a subvolume, I have a simple incremental backup created from two
> stages:
> 
> btrfs send old/@ > base.btrfs
> btrfs send new/@ -p old/@ > update.btrfs
> 
> The two source subvolumes are snapshots captured at separate times from
> the same actively mounted subvolume.
> 
> On the target, I attempt to restore:
> 
> btrfs receive ./ < base.btrfs
> btrfs receive ./ < update.btfs
> 
> The expectation is that the prior command would create a restored
> snapshot of the initial backup stage, and that the latter would apply
> the updated stage.
> 
> The prior command succeeds, but the latter fails:
> 
> ERROR: creating snapshot ./@ -> @ failed: File exists
> 

You need to restore it in different directory. Each send stream defines
subvolume and you cannot have two subvolumes with the same name in the
same directory. 

> Since it is obvious I cannot usefully apply the second stage to a
> target that does not exist, I am puzzled about why the process performs
> this check, as well as what is expected to have success applying the
> update.
> 
> How may I apply the update stage to the target generated from restoring
> the initial stage?
> 
> 

You misunderstand what happens. btrfs receive does not update existing subvlume.
It always creates new subvolume by cloning parent replica and applying changes
to this clone. Parent remains in its original state and read-only.

      parent reply	other threads:[~2021-12-16  5:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15 20:27 receive failing for incremental streams Eric Levy
2021-12-15 23:35 ` Graham Cobb
2021-12-15 23:52   ` Eric Levy
2021-12-16  0:55     ` Graham Cobb
2021-12-16  1:13       ` Eric Levy
2021-12-16 10:24         ` Graham Cobb
2021-12-16 11:38           ` Hugo Mills
2021-12-18 23:53             ` Eric Levy
2021-12-16  5:36 ` Andrei Borzenkov [this message]

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=b68822f1-0ad7-8434-6aa1-553e264e232c@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=contact@ericlevy.name \
    --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).