From owner-freebsd-stable@FreeBSD.ORG Tue Jan 26 01:34:12 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E72B51065679; Tue, 26 Jan 2010 01:34:12 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from gizmo.2hip.net (gizmo.2hip.net [64.74.207.195]) by mx1.freebsd.org (Postfix) with ESMTP id 85B8C8FC1A; Tue, 26 Jan 2010 01:34:12 +0000 (UTC) Received: from [192.168.1.4] (adsl-149-142-141.bna.bellsouth.net [70.149.142.141]) (authenticated bits=0) by gizmo.2hip.net (8.14.3/8.14.3) with ESMTP id o0Q1Y9dk091619 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 25 Jan 2010 20:34:10 -0500 (EST) (envelope-from rnoland@FreeBSD.org) From: Robert Noland To: Matthew Seaman In-Reply-To: <4B5D6833.6050200@infracaninophile.co.uk> References: <20100122041237.GA22312@gothschlampen.com> <20100124092947.B72039@starfire.mn.org> <201001242057.o0OKvHUE089237@drugs.dv.isc.org> <1264387282.2869.24.camel@balrog.2hip.net> <4B5D6207.9090105@icyb.net.ua> <4B5D6833.6050200@infracaninophile.co.uk> Content-Type: text/plain Organization: FreeBSD Date: Mon, 25 Jan 2010 19:34:04 -0600 Message-Id: <1264469644.2869.49.camel@balrog.2hip.net> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.2 required=5.0 tests=AWL, BAYES_00, FH_DATE_PAST_20XX, RCVD_IN_PBL,RDNS_DYNAMIC,SPF_SOFTFAIL autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on gizmo.2hip.net Cc: FreeBSD-STABLE Mailing List , Andriy Gapon , freebsd-questions@freebsd.org Subject: Re: Loader, MBR and the boot process X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2010 01:34:13 -0000 On Mon, 2010-01-25 at 09:45 +0000, Matthew Seaman wrote: > Andriy Gapon wrote: > > on 25/01/2010 04:41 Robert Noland said the following: > >> On Mon, 2010-01-25 at 07:57 +1100, Mark Andrews wrote: > >>> offset The offset of the start of the partition from the beginning of > >>> the drive in sectors, or * to have bsdlabel calculate the correct > >>> offset to use (the end of the previous partition plus one, ignor- > >>> ing partition `c'. For partition `c', * will be interpreted as > >>> an offset of 0. The first partition should start at offset 16, > >>> because the first 16 sectors are reserved for metadata. > >> Ok, now this has my attention... My gut feeling right now is that this > >> is a bug in geom_part_bsd. I don't understand why the label isn't > >> protected. (Adding -b 16 when adding the swap partition fixes this) > >> Another project to goes on my list... > >> > >> If anyone knows why this is done like this... please share. > > > > I presume that this is for purely historic reasons. > > > > I believe this has been known about since 5.x days: > > http://www.freebsd.org/cgi/query-pr.cgi?pr=72812 > > As far as I recall, sometime around 6.1-RELEASE this should have been > fixed. It certainly seems to be the case that it is harmless to have > a plain swap partition start at offset 0, but anything else, like encrypted > swap or putting a filesystem there needs the 16 sector offset. When the first partition (whatever it is), starts at offset 0, if you dd into that partition you wipe out the label entirely, which just doesn't make sense to me. Trying to manage this in the file system code and the swap pager or whatever other consumer might make use of the partition seems like madness to me. robert. > Cheers, > > Matthew > -- Robert Noland FreeBSD