From owner-freebsd-current@FreeBSD.ORG Tue Dec 30 17:29:30 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97B4A1065695; Tue, 30 Dec 2008 17:29:30 +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 7C81E8FC1B; Tue, 30 Dec 2008 17:29:30 +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 nmadiraju-t41.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 <0KCP006KR9X51Y70@asmtp014.mac.com>; Tue, 30 Dec 2008 09:29:30 -0800 (PST) Message-id: <6477DA3A-7A75-48BE-B2F5-4C9E1A5AB7DA@mac.com> From: Marcel Moolenaar To: obrien@freebsd.org In-reply-to: <20081230171127.GA18967@dragon.NUXI.org> Date: Tue, 30 Dec 2008 09:29:28 -0800 References: <95872328-4FBF-4DAD-98DE-024FF53A4505@mac.com> <20081226085453.GB26808@dragon.NUXI.org> <20081226210839.GG1081@server.vk2pj.dyndns.org> <193E7722-B42E-4118-86CB-4F389260B430@mac.com> <20081230171127.GA18967@dragon.NUXI.org> X-Mailer: Apple Mail (2.930.3) Cc: Peter Jeremy , freebsd-current@freebsd.org Subject: Re: "geometry does not match label" 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: Tue, 30 Dec 2008 17:29:31 -0000 On Dec 30, 2008, at 9:11 AM, David O'Brien wrote: > On Mon, Dec 29, 2008 at 10:31:47PM -0800, Marcel Moolenaar wrote: >> On Dec 26, 2008, at 1:08 PM, Peter Jeremy wrote: >>>> # disklabel /dev/ad8s4f >>>> # /dev/ad8s4f: >>>> 8 partitions: >>>> # size offset fstype [fsize bsize bps/cpg] >>>> c: 83441610 150994935 unused 0 0 # "raw" >>>> part, >>>> don't edit >>>> f: 83441610 150994935 4.2BSD 0 0 0 >>>> partition c: offset past end of unit >>>> partition c: partition extends past end of unit >>>> disklabel: partition c doesn't start at 0! >>>> disklabel: An incorrect partition c may cause problems for standard >>>> system utilities >>>> partition f: offset past end of unit >>>> partition f: partition extends past end of unit >>> >>> It looks like GEOM_PART_BSD reports partition information that is >>> incompatible with bsdlabel. >> >> disklabel reads the label from the disk. It's wrong on the >> disk. > > Given the number of existing disks that folks will use with > GEOM_PART_BSD, can you whip up a utility to read the existing disk > label > and write out a "proper" one? (most preferably is a label that > releng7 > and releng6 kernels + utils will tolerate too). I'll change bsdlabel to not ask GEOM_BSD what the MBR offset is. Instead it'll make the label relative in the same way the kernel does it. This fixes the "disklabel: partition c doesn't start at 0!" and "disklabel: An incorrect partition c may cause problems for standard system utilities" The "partition c: partition extends past end of unit" can be fixed by the kernel in-memory so that you only have to run "gpart commit /dev/ad8s4" to write it to the disk. The kernel already does it, but doesn't yet mark the in-memory label as dirty. You need to make an unrelated change right now to cause the label to be rewritten. Unfortunately, there's no quick way to fix "partition f: partition extends past end of unit" if it's really larger than the slice size. If the warning is the result of having an offset of !0, then it'll will be fixed by fixing bsdlabel to make the label relative on its own. FYI, -- Marcel Moolenaar xcllnt@mac.com