From owner-freebsd-questions@FreeBSD.ORG Wed Nov 24 11:01:01 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD0F0106564A for ; Wed, 24 Nov 2010 11:01:01 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [IPv6:2607:f678:1010::34]) by mx1.freebsd.org (Postfix) with ESMTP id 827BB8FC13 for ; Wed, 24 Nov 2010 11:01:01 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id oAOB0v4D038035 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 24 Nov 2010 03:00:57 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id oAOB0vKS038034; Wed, 24 Nov 2010 03:00:57 -0800 (PST) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA19052; Wed, 24 Nov 10 02:52:35 PST Date: Wed, 24 Nov 2010 02:52:26 -0800 From: perryh@pluto.rain.com To: cyberleo@cyberleo.net Message-Id: <4cecee6a.FUrbpNUbt2xJT/Wf%perryh@pluto.rain.com> References: <4ce8b7ce.qnD6CCAK8thDasFl%perryh@pluto.rain.com> <4ceb40c8.IB5c12O9ZJa3abeh%perryh@pluto.rain.com> <4CEC23D9.6090600@cyberleo.net> In-Reply-To: <4CEC23D9.6090600@cyberleo.net> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org, kraduk@gmail.com Subject: Re: a gmirror disappears after adding gjournals to its partitions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Nov 2010 11:01:01 -0000 CyberLeo Kitsana 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?