From owner-freebsd-questions@FreeBSD.ORG Thu Nov 25 09:11:24 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 755C7106566C for ; Thu, 25 Nov 2010 09:11:24 +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 5675B8FC16 for ; Thu, 25 Nov 2010 09:11:24 +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 oAP9BKd1073203 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 25 Nov 2010 01:11:20 -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 oAP9BKCQ073202; Thu, 25 Nov 2010 01:11:20 -0800 (PST) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA22409; Thu, 25 Nov 10 01:06:30 PST Date: Thu, 25 Nov 2010 01:06:19 -0800 From: perryh@pluto.rain.com To: cyberleo@cyberleo.net Message-Id: <4cee270b.KKnqquLgJdG/1gVq%perryh@pluto.rain.com> References: <4ce8b7ce.qnD6CCAK8thDasFl%perryh@pluto.rain.com> <4ceb40c8.IB5c12O9ZJa3abeh%perryh@pluto.rain.com> <4CEC23D9.6090600@cyberleo.net> <4cecee6a.FUrbpNUbt2xJT/Wf%perryh@pluto.rain.com> <4CED65C1.5040102@cyberleo.net> In-Reply-To: <4CED65C1.5040102@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: Thu, 25 Nov 2010 09:11:24 -0000 CyberLeo Kitsana wrote: > ... I hope it makes sense! No problem with the explanation making sense; what I don't follow is the behavior of bsdlabel. Given the way I set it up this drive _should_ contain _two_ labels, but for some unfathomable reason bsdlabel seems to be using the second (inner) one while ignoring the first (outer) one entirely. The device itself is ad0. Its MBR contains a slice table, defining ad0s1 and ad0s2. (ad0s1 is FAT32 and AFAIK need not be considered further at this point.) ad0s2 starts with a bsdlabel, which defines ad0s2a and ad0s2b. (ad0s2b is intended to be used as swap and, like ad0s1, need not be considered further at this point -- but it _should_ be instantiated along with ad0s2a.) ad0s2a is supposed to be the provider for gm0, and it starts with a bsdlabel that is intended to partition gm0 into gm0[ade], but since geom_mirror.ko hasn't been loaded yet gm0 doesn't exist and ad0s2a is just a partition that happens to start with a bsdlabel and end with gmirror metadata. I could understand if bsdlabel tasted ad0s2a, found the label, and (recursively) instantiated ad0s2aa, ad0s2ad, and ad0s2ae; but that doesn't seem to happen. Instead, bsdlabel seems to ignore (or forget) the first label it tasted -- the one on ad0s2 -- and treats the one on ad0s2a as applying to ad0s2. We end up with ad0s2a containing the disk blocks intended for gm0a, ad0s2d containing the disk blocks intended for gm0d, ad0s2e containing the disk blocks intended for gm0e; and the blocks intended for ad0s2b (swap) -- which were not supposed to have been involved with any mirror or journal -- seem to have disappeared entirely. This seems like a bug. Now gjournal gets into the act, consuming the phony ad0s2[ade] before gmirror gets a chance to taste the real ad0s2a and instantiate gm0. That explains why gm0 and /dev/mirror are missing, but not why ad0s2b is missing, nor why we have ad0s2[ade] (and the corresponding .journal's) rather than ad0s2a[ade] (and their .journal's). > > (This machine is likely too old to understand GPT.) > > The machine's bios does not need to understand GPT to use it on a > pure data disk; only as a boot disk. This is, however, intended as a boot disk -- gm0a, gm0d, and gm0e are supposed to be root, /var, and /usr respectively -- and it does seem to boot OK until it tries find the root FS (because /etc/fstab is set up to use gm0[ade].journal instead of ad0s2[ade].journal). I suppose I could try partitioning ad0s2a with gpt instead of with bsdlabel, but would the loader still be able to find the kernel?