All of lore.kernel.org
 help / color / mirror / Atom feed
From: Forza <forza@tnonline.net>
To: Andrei Borzenkov <arvidjaar@gmail.com>,
	john terragon <jterragon@gmail.com>
Cc: Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: hierarchical, tree-like structure of snapshots
Date: Thu, 31 Dec 2020 11:00:12 +0100	[thread overview]
Message-ID: <4febd23e-94d2-6aa3-8d3f-77731eb83ad0@tnonline.net> (raw)
In-Reply-To: <f472181d-d6a4-f5f4-df7f-03bc7788b45a@gmail.com>



On 2020-12-31 08:05, Andrei Borzenkov wrote:
> 30.12.2020 20:39, john terragon пишет:
>> On Wed, Dec 30, 2020 at 6:24 PM sys <system@lechevalier.se> wrote:
>>>
>>>
>>>
>> [...]
>>> You should simply make a 'read-write' snapshot (Y-rw) of the 'read-only'
>>> snapshot (Y) that is part of your backup/send scheme. Do not modify
>>> read-only snapshots to be rw.
>>>
>>
>> OK, but then could I use Y as parent of the rw snapshot, let's call it
>> W, in a send?
> 
> No
> 
>> So I would have this tree where Y is still the root.
>>
>> Y-W
>>   \
>>    Z-X
>>
>> Can I do a send -p Y W ?
> 
> No. All subvolumes used in send/receive must be read-only. And they must
> remain read-only from the moment they are created - we have seen quite a
> lot of reports when users removed read-only property from subvolume used
> in the past as send source, modified it, set as read-only again and
> tried to continue replication. This resulted in complete mess on receive
> side. Also if you try to modify destination snapshots it will break at
> some point.
> 
> The general rule - everything used for replication must remain
> read-only. If you want to use any snapshot that is part of replication
> you clone it and use its clone.
> 
>> Because I thought it was other way around, that is I do a readonly
>> snapshot W of Y and that will be the base for incrementally sending
>> the future modified Y to another  FS (provided of course W is already
>> there).
>>
> 
> If you want to capture changes in W since it was cloned from Y you
> create another read-only snapshot of W and use it.
> 
> btrfs subvolume snapshot -r W V
> btrfs send -p Y V
> 
> It is possible that btrfs implementation is optimized for sequential
> snapshots from the same subvolume so the send stream size will be
> larger. I am not familiar with these low level details. From the naïve
> end-user point of view there should be no difference between
> 
> btrfs subvolume snapshot -r W R1
> btrfs send R1
> modify W
> btrfs subvolume snapshot -r W R2
> btrfs send -p R1 R2
> 
> and
> 
> btrfs send R1
> btrfs subvolume snapshot R1 W
> modify W
> btrfs subvolume snapshot -r W R2
> btrfs send -p R1 R2
> 

I think you are correct. The man page specifies that all snapshots must 
be read-only, but it is rather unclear if you modify some snaps in between.

https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs-send


  reply	other threads:[~2020-12-31 10:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30 16:56 hierarchical, tree-like structure of snapshots john terragon
2020-12-30 17:03 ` john terragon
2020-12-30 17:24 ` sys
2020-12-30 17:39   ` john terragon
2020-12-31  7:05     ` Andrei Borzenkov
2020-12-31 10:00       ` Forza [this message]
2020-12-31 16:08       ` john terragon
2020-12-31 17:28         ` Zygo Blaxell
2020-12-31 18:19           ` john terragon
2020-12-31 19:42             ` Andrei Borzenkov
2020-12-31 20:48               ` john terragon
2020-12-31 21:36                 ` Zygo Blaxell
2021-01-01  4:54                   ` john terragon
2021-01-01 11:42                   ` Andrei Borzenkov
2021-01-01 20:40                     ` Andrei Borzenkov
2021-01-01 23:11                       ` Zygo Blaxell
2021-01-02  9:25                         ` Andrei Borzenkov

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=4febd23e-94d2-6aa3-8d3f-77731eb83ad0@tnonline.net \
    --to=forza@tnonline.net \
    --cc=arvidjaar@gmail.com \
    --cc=jterragon@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.