From owner-freebsd-geom@FreeBSD.ORG Sun Mar 7 19:36:01 2010 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 CC880106564A for ; Sun, 7 Mar 2010 19:36:01 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 735938FC08 for ; Sun, 7 Mar 2010 19:35:57 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id VAA22985; Sun, 07 Mar 2010 21:35:54 +0200 (EET) (envelope-from avg@icyb.net.ua) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1NoMGX-000NOS-RG; Sun, 07 Mar 2010 21:35:53 +0200 Message-ID: <4B940018.5050809@icyb.net.ua> Date: Sun, 07 Mar 2010 21:35:52 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20100211) MIME-Version: 1.0 To: Marcel Moolenaar References: <4B9389C1.9000102@icyb.net.ua> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-geom@freebsd.org Subject: Re: another gpt vs mbr (sanity) check 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: Sun, 07 Mar 2010 19:36:01 -0000 on 07/03/2010 21:13 Marcel Moolenaar said the following: > On Mar 7, 2010, at 3:10 AM, Andriy Gapon wrote: > > >> Please consider the following scenario: >> - GPT scheme is used on a disk >> - the disk changes hands >> - the disk is repartitioned with MBR without explicitly wiping out any of old >> data and thus GPT >> - GPT data survives undamaged >> >> So now we have the valid GPT but it points to wrong offsets and we have the >> valid and correct MBR. >> Currently FreeBSD would pick GPT scheme over MBR scheme when presented which >> such a disk. I think that this is incorrect. > > Sorry. That ship has sailed. Originally GEOM_GPT at the time checked > for the protective MBR before accepting the GPT. This was changed to > support Apple setups. There's no turning back now. People just need > to learn to wipe out old partitioning information before writing > select sectors in order to create a new one. Hmm, I probably wasn't there when the ship was sailing out :) What is the 'Apple setup'? Is it a some sort of a hybrid scheme? Don't they still use a protective type for the first partition in MBR? Can we perhaps have the best of all words and do some smart autodetection? Or, at least, have some manual lever to control such things? When a friend gives me his SDHC card to copy some files out of it, he wouldn't want me to perform some non-readonly magic with it and he wouldn't bother to listen my explanations because the card works nice for him with Windows. -- Andriy Gapon