From: Robert White <rwhite@pobox.com>
To: Duncan <1i5t5.duncan@cox.net>, linux-btrfs@vger.kernel.org
Subject: Re: BTRFS messes up snapshot LV with origin
Date: Wed, 26 Nov 2014 14:08:14 -0800 [thread overview]
Message-ID: <54764F4E.80405@pobox.com> (raw)
In-Reply-To: <pan$8a1fe$cae59052$c5e19c35$9858d5fc@cox.net>
On 11/25/2014 07:22 PM, Duncan wrote:
>>From my perspective, however, btrfs is simply incompatible with lvm
> snapshots, because the basic assumptions are incompatible. Btrfs assumes
> UUIDs will be exactly what they say on the label, /unique/, while lvm's
> snapshot feature directly breaks that uniqueness by copying the (former)
> UUID, thus making the former UUID no longer unique and thus no longer
> truly UUID. Thus, part of the lvm /feature/ of snapshots is in direct
> contradiction to a basic assumption of btrfs, that UUIDs are exactly
> that, unique, making that feature directly incompatible with btrfs on a
> very basic level.
A finer point here. LVM doesn't "copy" the UUID. AN LVM snapshot is a
copy-on-write entity so it _exposes_ the single sector(s) of the
superblock(s) in both views of the underlying storage. This is universal
to the idea of a snapshot. Just as a "btrfs subvol snap /old /new"
exposes all the "unique" elements of "/old" under the name "/new" (in
preparation for the user to implement subsequent divergence); "lvmcreate
--snapshot Old New" causes every block-N of Old to be identically
available as block-N of New (in preparation for the user to implement
subsequent divergence).
In point of fact the LVM snapshot operation is a zero-copy operation at
its heart. After the snapshot is established, when a block in modified
in Old, it's original content is saved in New. When blocks are written
in New, they are written in place and the reference to the block content
in Old is overwritten.
This is the reason that fsfreeze is unnecessary for things above LVM
snapshots as the instant-in-time divergence is _instant_. It's not that
LVM goes out and does an fsfreeze equivalent action, its that the switch
to write-divergence is essentially atomic. A bunch of metatdata is setup
and then all-at-once one write behavior is switched with another by
re-mapping the device access routines.
So while you may have a point about btrfs being unprepared for LVM,
neither party is particularly "at fault" in any way.
The "damn you photocopier for making photocopies so identically" nature
of your problem with LVM seems to be leading you to misplaced conclusions.
If you need to harmonize these sorts of things, you need to be able to
re-write blocks in question with disambiguating information (like new
UUIDS) or restrict your accesses in some other manner.
If you are waiting for someone to "code it up" perhaps you should do so.
But it will _never_ be automatic because the use cases that don't match
your expectations may need the founding assumptions to be as they are today.
In other words, your belief that your position is "entirely logical" may
be a little off, particularly if you think LVM is "Copying" things when
it does a snapshot.
As previously stated XFS solved this problem by providing a tool that
would change the UUID of a file system. This tool cold then be pointed
at either (or both) the original and/or snapshot volumes as needed.
I don't see a "re-make the btrfs" option for changing UUIDs and LVM
doesn't care _at_ _all_ about what is actually in its volumes (okay,
lvresize has some fsck nonsense, but that's just messy).
It might even be "wrong" to try to harmonize those features, like trying
to put a manual clutch into a car with an automatic transmission... it
may just not fit.
Given that BTRFS want's to play in the same level of abstraction as LVM,
its kind of a given that they'll butt heads over things like conflicting
definitions of what it means to take a snapshot.
next prev parent reply other threads:[~2014-11-26 22:08 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-16 21:35 BTRFS messes up snapshot LV with origin MegaBrutal
2014-11-17 1:42 ` Duncan
2014-11-17 6:59 ` Brendan Hide
2014-11-17 7:35 ` Daniel Dressler
2014-11-17 9:00 ` Brendan Hide
2014-11-17 19:04 ` Goffredo Baroncelli
[not found] ` <CAE8gLh=VubBbZdeKTAuWRjOxPF7C+ouUeeVvmGfT2ckYWGhQVA@mail.gmail.com>
2014-11-17 19:45 ` Fwd: " MegaBrutal
2014-11-17 20:32 ` Goffredo Baroncelli
2014-11-18 6:16 ` Chris Murphy
2014-11-18 15:42 ` Phillip Susi
2014-11-18 19:17 ` Chris Murphy
2014-11-18 20:17 ` Phillip Susi
2014-11-19 2:54 ` Chris Murphy
2014-11-19 15:20 ` Phillip Susi
2014-11-19 18:35 ` Chris Murphy
2014-11-19 19:23 ` Phillip Susi
2014-11-21 4:28 ` Zygo Blaxell
2014-11-21 6:22 ` Duncan
2014-11-21 11:35 ` Robert White
2014-11-21 11:54 ` Duncan
2014-11-21 17:56 ` Zygo Blaxell
2014-11-21 23:09 ` Duncan
2014-11-21 18:23 ` Chris Murphy
2014-11-21 22:49 ` Duncan
2014-11-21 23:41 ` Duncan
2014-11-21 23:51 ` Duncan
2014-11-22 17:34 ` Goffredo Baroncelli
2014-11-23 0:19 ` Zygo Blaxell
2014-11-25 16:34 ` Goffredo Baroncelli
2014-11-25 20:29 ` Zygo Blaxell
2014-11-25 21:59 ` Goffredo Baroncelli
2014-11-25 22:21 ` Zygo Blaxell
2014-11-25 22:47 ` Chris Murphy
[not found] ` <CAJCQCtQUM=viSoPtcJMcyKquYb1DLmEsqBi=p++uXPy63+r3Ow@mail.gmail.com>
[not found] ` <20141126021134.GR17380@hungrycats.org>
2014-11-26 4:48 ` Chris Murphy
2014-11-26 17:19 ` Goffredo Baroncelli
2014-11-27 4:15 ` Zygo Blaxell
2014-11-28 17:05 ` Goffredo Baroncelli
2014-11-29 1:25 ` Robert White
2014-11-29 7:35 ` Goffredo Baroncelli
2014-11-29 8:02 ` Robert White
2014-11-29 7:37 ` MegaBrutal
2014-11-29 4:59 ` Zygo Blaxell
2014-11-29 7:55 ` Robert White
2014-12-01 15:25 ` Zygo Blaxell
2014-11-26 3:22 ` Duncan
2014-11-26 5:11 ` Chris Murphy
2014-11-26 22:08 ` Robert White [this message]
2014-11-27 9:08 ` Duncan
2014-11-28 7:10 ` Chris Murphy
2014-11-29 7:29 ` Duncan
2014-11-29 8:20 ` Robert White
2014-11-29 9:41 ` Duncan
2014-11-29 16:33 ` Robert White
2014-11-29 16:50 ` Robert White
2014-11-30 6:46 ` Duncan
2014-11-29 21:15 ` Chris Murphy
2014-11-18 20:41 ` MegaBrutal
2014-11-19 1:29 ` Robert White
2014-11-19 3:37 ` Duncan
2014-11-21 4:24 ` Zygo Blaxell
2014-11-18 6:21 ` Chris Murphy
2014-11-18 12:13 ` Duncan
2014-11-18 20:01 ` Goffredo Baroncelli
-- strict thread matches above, loose matches on Subject: below --
2014-11-17 8:00 MegaBrutal
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=54764F4E.80405@pobox.com \
--to=rwhite@pobox.com \
--cc=1i5t5.duncan@cox.net \
--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).