From owner-freebsd-current@FreeBSD.ORG Thu Nov 12 06:06:06 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93B4E106566C for ; Thu, 12 Nov 2009 06:06:06 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout028.mac.com (asmtpout028.mac.com [17.148.16.103]) by mx1.freebsd.org (Postfix) with ESMTP id 7F6D78FC13 for ; Thu, 12 Nov 2009 06:06:06 +0000 (UTC) MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Received: from macbook-pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67]) by asmtp028.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KSZ00M80FL6BN60@asmtp028.mac.com> for current@freebsd.org; Wed, 11 Nov 2009 22:05:32 -0800 (PST) From: Marcel Moolenaar In-reply-to: <4AFB953C.8030607@elischer.org> Date: Wed, 11 Nov 2009 22:05:30 -0800 Content-transfer-encoding: quoted-printable Message-id: <8DB6C1EB-939D-4128-A15B-A86F4FA63F65@mac.com> References: <86tyx0mxjw.fsf@ds4.des.no> <94D5F246-3413-4256-A0FB-6DF2D3BFE9D0@mac.com> <86d43omsb0.fsf@ds4.des.no> <4AFB953C.8030607@elischer.org> To: Julian Elischer X-Mailer: Apple Mail (2.1077) Cc: =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= , current@freebsd.org Subject: Re: How to confuse geom_part_mbr X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2009 06:06:06 -0000 On Nov 11, 2009, at 8:55 PM, Julian Elischer wrote: > Dag-Erling Sm=F8rgrav wrote: >> Marcel Moolenaar writes: >>> Dag-Erling Sm=F8rgrav writes: >>>> The machine won't boot, even though you have a valid partition = table >>>> on ad0 that points to a valid bsdlabel in ad0s1. >>> No, you don't have a valid partition table on ad0, because >>> you didn't remove the BSD disklabel in sector 2 on ad0. >> Yes, I do have a valid partition table. It is exactly byte-by-byte >> identical to the one I get after I zero sector two and re-run fdisk. >> The fact that there is unwanted data in sector 2 does *not* make it = any >> less valid. >> What's more, this could have easily been avoided if geom_whatever = gave >> the partition table precedence over the label it found in sector 2. >> DES >=20 > The dummy MBR on a disklabel can be relatively easily identified, and = the regular MDR tasting code should note it and give it a lower priority = than a real MBR. (and a disklabel) Fuzzy logic. How do you distinguish an empty MBR from a dummy one? The exists of the BSD disklabel in sector 2 is obviously and non-fuzzily a much better identifier. The problem with tools like fdisk and disklabel is that they work well to create metadata, but they don't deal with the removal of metadata. Combine that with the ignorance of one tool towards the other and you get what des@ points out: stale data that cause problems. Note also that there is no ordering or priority mechanism between the old GEOM_MBR and GEOM_BSD. It just so happens that GEOM_MBR tastes first. But this is not at all a given. In fact, if you remove GEOM_MBR from your kernel config you'll see that GEOM_BSD attaches. The bottomline: gpart implements the correct algorithm because it's the only one that stable and reliable. --=20 Marcel Moolenaar xcllnt@mac.com