From owner-freebsd-geom@FreeBSD.ORG Sun Mar 7 23:31:47 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 D58E1106564A for ; Sun, 7 Mar 2010 23:31:47 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout026.mac.com (asmtpout026.mac.com [17.148.16.101]) by mx1.freebsd.org (Postfix) with ESMTP id BE4E28FC0C for ; Sun, 7 Mar 2010 23:31:47 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67]) by asmtp026.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KYX00D7PQOJ2080@asmtp026.mac.com> for freebsd-geom@freebsd.org; Sun, 07 Mar 2010 15:31:32 -0800 (PST) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0908210000 definitions=main-1003070226 From: Marcel Moolenaar In-reply-to: <4B940018.5050809@icyb.net.ua> Date: Sun, 07 Mar 2010 15:31:30 -0800 Message-id: <530847A8-D9F7-4A9F-9578-6A9282688EC1@mac.com> References: <4B9389C1.9000102@icyb.net.ua> <4B940018.5050809@icyb.net.ua> To: Andriy Gapon X-Mailer: Apple Mail (2.1077) 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 23:31:47 -0000 On Mar 7, 2010, at 11:35 AM, Andriy Gapon wrote: > 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? It's a hybrid setup. I can't recall if there's a slice of type 0xEE or not in all cases, but we stopped checking for that... > 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? The best of all worlds doesn't exist anymore. It was how it was designed to be and not how it's used at this time. -- Marcel Moolenaar xcllnt@mac.com