From owner-freebsd-geom@FreeBSD.ORG Wed Nov 5 17:28:27 2008 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73CF2106568A for ; Wed, 5 Nov 2008 17:28:27 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout014.mac.com (asmtpout014.mac.com [17.148.16.89]) by mx1.freebsd.org (Postfix) with ESMTP id 5D6C48FC1F for ; Wed, 5 Nov 2008 17:28:27 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp014.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0K9V005XJF77V180@asmtp014.mac.com> for freebsd-geom@freebsd.org; Wed, 05 Nov 2008 09:28:20 -0800 (PST) Message-id: <0244407E-F10C-4374-9D68-557C1DA31EB3@mac.com> From: Marcel Moolenaar To: vadim_nuclight@mail.ru In-reply-to: Date: Wed, 05 Nov 2008 09:28:19 -0800 References: <48FF2607.10807@icyb.net.ua> <63F8346D-0116-4F41-BCAA-C235E9657BD8@mac.com> <48FF82BA.3020309@icyb.net.ua> <48FF913A.9070700@icyb.net.ua> <7334715F-FAE1-40EE-92EB-468041587410@mac.com> X-Mailer: Apple Mail (2.929.2) Cc: freebsd-geom@freebsd.org Subject: Re: gpart oddity X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 17:28:27 -0000 On Nov 5, 2008, at 3:29 AM, Vadim Goncharov wrote: > Hi Marcel Moolenaar! > > On Wed, 22 Oct 2008 14:03:27 -0700; Marcel Moolenaar wrote about > 'Re: gpart oddity': > >>> Then I remembered that I labeled ad4s1 purely through sysinstall and >>> never touched it with disklabel(8), on the other hand I used >>> disklabel to label ad4s2. >> That's good to know; not that there's a lot we can do about all >> those existing installations... >>> My personal conclusions: >>> 1. sysinstall seems to have handled those fields incorrectly, >>> somehow. >>> 2. those fields do not seem to be of any particular use/importance, >>> so g_part_bsd might be overly strict here. >> Being strict is not a bad thing, but given that we put an >> invalid label on all new installations I think it's better >> gpart doesn't check it or otherwise detect and corrects it. >> (we know the absolute sector offset of the label, so if >> secperunit is mediasize + offset, we know the not to flag >> the label as invalid, patch it up and move on). > > The question is, how much strict it is? Currently I have an 6.2-S > system with > gmirror(8)'ed slices, not disks, as it was converted from existing > system > with different sizes of disks. I have had edit their labels that > partition > 'c' doesn't cover entire unit (and last partition was reformatted to > be not > truncated, too). This is needed to be sure that last sector gets not > overwritten by gmirror(8) metadata, but bsdlabel(8) always complains > about it > that it doesn't cover bla-bla-bla. Moreover, labeled partitions and > slices > exist on their own, despite of gmirror(8). And yet more, if I try to > do a > bsdlabel(8) on a gm0, it will complain about 63 sectors boot offset, > while > on ad0s1 it will not, so I need to hack a lot if I need to resize > partitions. > > What is the cause of the trouble? From what you tell, I think the problem is caused by forcing the proverbial square peg into the proverbial round hole. We made it too easy for people to create invalid labels because we simply didn't do any real sanity checking and/or didn't provide any real tools to help the user achieve what they want. The fact that gmirror puts the metadata in the last sector and only adjusts the media size of the provider when in use, means that we have introduced ambiguity in how the GEOMs are stacked and while the gmirror approach is a feature on the one hand, we have done so without regard for the validity of disklabels. We handwaved the problems as unimportant or aesthetic. -- Marcel Moolenaar xcllnt@mac.com