Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Nov 2010 02:52:26 -0800
From:      perryh@pluto.rain.com
To:        cyberleo@cyberleo.net
Cc:        freebsd-questions@freebsd.org, kraduk@gmail.com
Subject:   Re: a gmirror disappears after adding gjournals to its partitions
Message-ID:  <4cecee6a.FUrbpNUbt2xJT/Wf%perryh@pluto.rain.com>
In-Reply-To: <4CEC23D9.6090600@cyberleo.net>
References:  <4ce8b7ce.qnD6CCAK8thDasFl%perryh@pluto.rain.com> <AANLkTimb8qHPj9HTY_jpy_vzVnB27stKxXO%2BjZjhnnSd@mail.gmail.com> <4ceb40c8.IB5c12O9ZJa3abeh%perryh@pluto.rain.com> <4CEC23D9.6090600@cyberleo.net>

next in thread | previous in thread | raw e-mail | index | archive | help
CyberLeo Kitsana <cyberleo@cyberleo.net> wrote:

> > If the kldstat Id numbers are assigned sequentially, it looks as
> > if geom_journal got loaded first and this may somehow be related
> > (although I don't entirely see how -- absent geom_mirror to make
> > gm0 and its partitions visible, I'd think that geom_journal
> > "should not" be able to find its metadata at all).
>
> From what I've found, this is because there is no taste difference
> between a bsdlabel on a gmirror and a bsdlabel on a non-mirror.

... which seems like a bug, unless I misunderstand how geoms work --
see diagram below:

* If gjournal stores its metadata at the end of its provider, it
  should not be finding anything recognizable at the end of ad0s2a,
  because that block contains gmirror's metadata.

* OTOH, if gjournal is looking for something at the beginning of
  its provider, it should be finding a bsdlabel -- not gjournal
  metadata -- at the beginning of ad0s2a and that should keep it
  from recognizing anything in ad0s2a (which is already known to
  be a partition, thus finding another bsdlabel at its beginning
  cannot be legitimate).

It looks to me as if gjournal is confused:  it claims to have found
data and journal on each of ad0s2a, ad0s2d, and ad0s2e but in fact
only the first of those even exists!  The actual partitioning of
ad0s2 is into ad0s2a and ad0s2b (plus the conventional ad0s2c entry
covering all of ad0s2).  It is gm0 (whose provider is ad0s2a) that
is partitioned into gm0a, gm0d, and gm0e; if gm0's bsdlabel were
interpreted as being directly on ad0s2a, shouldn't those partitions
be named ad0s2aa, ad0s2ad, and ad0s2ae?

 __________________________________________
| ad0s2  bsdlabel (on ad0s2)
| ad0s2c  _________________________________
|        | ad0s2a | gm0  bsdlabel (on gm0)
|        |        | gm0c  _________________
|        |        |      | gm0a  |  data
|        |        |      |       |
|        |        |      |       |_________
|        |        |      |       | journal
|        |        |      |       |_________
|        |        |      |_______|_________gjMeta
|        |        |      | gm0d  |  data
|        |        |      |       |
|        |        |      |       |
|        |        |      |       |
|        |        |      |       |
|        |        |      |       |_________
|        |        |      |       | journal
|        |        |      |       |_________
|        |        |      |_______|_________gjMeta
|        |        |      | gm0e  |  data
|        |        |      |       |
|        |        |      |       |
|        |        |      |       |
|        |        |      |       |
|        |        |      |       |
|        |        |      |       |
|        |        |      |       |
|        |        |      |       |
|        |        |      |       |
|        |        |      |       |
|        |        |      |       |
|        |        |      |       |
|        |        |      |       |_________
|        |        |      |       | journal
|        |        |      |       |_________
|        |        |______|_______|_________gjMeta
|        |_________________________________gmMeta
|        | ad0s2b
|        |
|        |
|________|_________________________________


> ... either make the two look different somehow (use a different
> geom that stores its metadata at the beginning of the provider,
> instead of the end, thus eliminating ambiguity in the bsdlabel
> taste),

When I asked earlier how to subdivide gm0, bsdlabel was recommended.
Is there something else that would work better?  (This machine is
likely too old to understand GPT.)

> or to make the inner geom avoid the outer devices (hardcode
> provider names in metadata). Since you have an outer geom that
> provides a static name, hardcoding the name of the gmirror into
> the gjournal metadata shouldn't cause anything to break if your
> disks change places, either.

But I suspect this may not scale well.  Suppose I later decide to
mirror the swap instead of using ad0s2b and ad8s2b as separate swap
partitions.  Is there not a 50/50 chance of the swap mirror becoming
gm0 and my current gm0 becoming gm1, thereby breaking any metadata
that depends on hard-coded provider names?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4cecee6a.FUrbpNUbt2xJT/Wf%perryh>