From owner-freebsd-current@FreeBSD.ORG Thu Jun 14 15:03:32 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1BD8106566C; Thu, 14 Jun 2012 15:03:32 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 991B18FC12; Thu, 14 Jun 2012 15:03:32 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.5/8.14.5) with ESMTP id q5EF3VbS018198; Thu, 14 Jun 2012 09:03:31 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.5/8.14.5/Submit) with ESMTP id q5EF3Vgd018195; Thu, 14 Jun 2012 09:03:31 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Thu, 14 Jun 2012 09:03:31 -0600 (MDT) From: Warren Block To: "Andrey V. Elsukov" In-Reply-To: <4FD9EC14.8070203@FreeBSD.org> Message-ID: References: <4FCF3021.5070802@FreeBSD.org> <20120606.200735.1551208261335301113.hrs@allbsd.org> <4FD05573.70801@FreeBSD.org> <20120610.224813.710171778841273502.hrs@allbsd.org> <4FD9D4DF.9090609@FreeBSD.org> <4FD9EC14.8070203@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (wonkity.com [127.0.0.1]); Thu, 14 Jun 2012 09:03:31 -0600 (MDT) Cc: Olivier Smedts , current@freebsd.org Subject: Re: CFR: backup GPT header support in pmbr and loader(8) (Re: Handbook mirroring section) 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: Thu, 14 Jun 2012 15:03:33 -0000 On Thu, 14 Jun 2012, Andrey V. Elsukov wrote: > On 14.06.2012 17:08, Olivier Smedts wrote: >> 2012/6/14 Andrey V. Elsukov : >>> Also, our PMBR image doesn't contain any partition entries and >>> writing it to the disk with dd(1) makes the system unbootable. >>> What you think if we will add one partition entry to the PMBR image? >>> I modified your patch (the last hunk added) and it is attached. >> >> Isn't it gpart(8)'s job to write the proper boot code from the pmbr >> image without damaging the partition table ? >> >> ie. "gpart bootcode -b /boot/pmbr ada0" instead of using dd. > > gpart(8) works only when GPT's geom exists, when PMBR is damaged > GEOM_PART_GPT can't detect GPT and thus you can't use it. So the idea is that you could dd this to the first block of any given drive and at least have one active partition marked, even if the start or end is not necessarily correct? That could be useful. However, an empty partition table is clearly empty, but a program won't be able to tell whether a pre-filled partition table is real or not. (Aside from whether to do it: the "partition table" comment is now on the second entry, and it would be nice to have some comments to identify the fields on the new static entry, like 0x80 # active, 0x00 # head, and so on.)