From owner-freebsd-current@FreeBSD.ORG Thu Jun 14 16:05:43 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 5A38A1065674 for ; Thu, 14 Jun 2012 16:05:43 +0000 (UTC) (envelope-from olivier@gid0.org) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id C83B58FC14 for ; Thu, 14 Jun 2012 16:05:42 +0000 (UTC) Received: by laai10 with SMTP id i10so1692137laa.13 for ; Thu, 14 Jun 2012 09:05:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-gm-message-state; bh=l+n9ZC7j8Sl4+19X7cz7OdapzREBLchZuSjXF3Po1Ak=; b=OaoPdXLPG0l0pxbwpvQjtj6moQPcJC6soFrJtQgwsSZpuO1pZJOphqNgsBBaaJxg3U 7S8e2/2r+ztc2KRNgzGpq2RR2kHhsH9c1+LBx04ezUe41xgwBmNtUBO03S88L3x3SWQO fRD37bvErhijWfnlLHIhR4F+Pdu36sFKrOxTUzXs5T+/nur9ab/2casNDkI89vWIWYR+ bbYY+iMnU7r2IZlNE32lD9O08aKJPEWYYuGJP7CWliswngPFukyvbouCjJ6kFSl6rnV0 vAsiDwU5e76cpv0NVgafXF064QP9eTl/fbuf+gfFEMAHlkHQcR/NLxjA0xFmtX4PKa8a vfBQ== MIME-Version: 1.0 Received: by 10.112.36.225 with SMTP id t1mr1246892lbj.67.1339689941298; Thu, 14 Jun 2012 09:05:41 -0700 (PDT) Received: by 10.112.100.68 with HTTP; Thu, 14 Jun 2012 09:05:41 -0700 (PDT) In-Reply-To: <4FD9EC14.8070203@FreeBSD.org> 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> Date: Thu, 14 Jun 2012 18:05:41 +0200 Message-ID: From: Olivier Smedts To: "Andrey V. Elsukov" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQlL1E6Eig+VUQ7OkTO5JL+t4M38LJWz2Klf2r+fEo4zu4a+omjnSJfLeywER3Z2DP92DSyq Cc: 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 16:05:43 -0000 2012/6/14 Andrey V. Elsukov : > 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. IMO, GEOM_PART_GPT should not depend on the MBR do detect GPT. That's the problem which should be fixed ; adding a partition to the MBR is only a workaround (and what would happen if the sector 0 was permanently damaged on disk ?). Why does GEOM_PART_GPT depends on the sector LBA 0 while the GPT header is located at sector LBA 1 ? Don't know the feasability of this, just saying... :-) --=20 Olivier Smedts=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0 _ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 ASCII ribbon campaign ( ) e-mail: olivier@gid0.org=A0 =A0 =A0 =A0 - against HTML email & vCards=A0 X www: http://www.gid0.org=A0 =A0 - against proprietary attachments / \ =A0 "Il y a seulement 10 sortes de gens dans le monde : =A0 ceux qui comprennent le binaire, =A0 et ceux qui ne le comprennent pas."