From owner-freebsd-geom@FreeBSD.ORG Tue Mar 3 16:58:33 2009 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 764931065696 for ; Tue, 3 Mar 2009 16:58:33 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout022.mac.com (asmtpout022.mac.com [17.148.16.97]) by mx1.freebsd.org (Postfix) with ESMTP id 615A28FC1E for ; Tue, 3 Mar 2009 16:58:33 +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 ambalakkat-mbp.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp022.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0KFX00FNSWHKG270@asmtp022.mac.com> for freebsd-geom@FreeBSD.org; Tue, 03 Mar 2009 08:58:33 -0800 (PST) Message-id: <6E283F9A-30B1-431E-B6F1-142E17647FB2@mac.com> From: Marcel Moolenaar To: Jaakko Heinonen In-reply-to: <20090302195126.GA6974@a91-153-125-115.elisa-laajakaista.fi> Date: Tue, 03 Mar 2009 08:58:32 -0800 References: <20090302195126.GA6974@a91-153-125-115.elisa-laajakaista.fi> X-Mailer: Apple Mail (2.930.3) Cc: freebsd-geom@FreeBSD.org Subject: Re: gpart probing problem 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: Tue, 03 Mar 2009 16:58:35 -0000 On Mar 2, 2009, at 11:51 AM, Jaakko Heinonen wrote: > I noticed a regression after gpart (GEOM_PART_*) was made default. > > I have a disk which has remnants of an old GPT table but which has a > valid MBR table. Previously I got following messages to the log but > the > MBR partition was da0s1 was properly detected. > > GEOM: da0: corrupt or invalid GPT detected. > GEOM: da0: GPT rejected -- may not be recoverable. > GEOM_LABEL: Label for provider da0s1 is msdosfs/FOO. > > Now with gpart as default the MBR table is not detected and I can't > access the da0s1 partition. These messages appear to the log: > > GEOM: da0: corrupt or invalid GPT detected. > GEOM: da0: GPT rejected -- may not be recoverable. > > g_part_gpt_probe() only does a check for GPT header signature > existence > but it doesn't check if the table is actually valid. gpart doesn't try > other schemes after it has decided to use GPT. It's actually not a regression. There's always a MBR in front of a GPT and a corrupted GPT should not be tossed aside and ignored. The behaviour of gpart is correct in that the operator/user needs to remove the ambiguity. Either by fixing the GPT or otherwise by removing it altogether. Under no circumstance should the kernel use the MBR and pretend nothing is wrong. FYI, -- Marcel Moolenaar xcllnt@mac.com