From owner-freebsd-current@freebsd.org Tue Jul 14 01:19:35 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7A709981D2 for ; Tue, 14 Jul 2015 01:19:35 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D9CA1094; Tue, 14 Jul 2015 01:19:34 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.9/8.14.9) with ESMTP id t6E1JQp8004556 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 13 Jul 2015 19:19:26 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.9/8.14.9/Submit) with ESMTP id t6E1JPrv004552; Mon, 13 Jul 2015 19:19:25 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Mon, 13 Jul 2015 19:19:25 -0600 (MDT) From: Warren Block To: Adrian Chadd cc: Allan Jude , Hans Ottevanger , "Andrey V. Elsukov" , freebsd-current Subject: Re: Lenovo BIOS boot fix In-Reply-To: Message-ID: References: <55A1FFD5.7080008@freebsd.org> <55A2030B.7010405@freebsd.org> <55A2835F.1030004@yandex.ru> <55A2ACDD.408@freebsd.org> <55A36FBE.1020206@beastielabs.net> <55A3D01E.40102@freebsd.org> <55A3DF26.5020602@freebsd.org> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Mon, 13 Jul 2015 19:19:26 -0600 (MDT) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 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: Tue, 14 Jul 2015 01:19:35 -0000 On Mon, 13 Jul 2015, Adrian Chadd wrote: > I'm really confused. Why is the active flag not set again? > > I thought that was the whole point of the active flag in the partition table. At one point, smart people explained this to me. My fault if I do not remember it correctly (not that it will stop me from attempting an explanation): MBR partitions have active flags. The BIOS is supposed to boot from the one that is set active. It is not required that one be set active, though. Most BIOS systems will still boot without any MBR partitions set active, presumably from the first partition. The PMBR on a GPT disk is a simulation of an MBR. However, according to the GPT standard, that simulated first MBR partition in the PMBR must not be set active. A strict UEFI implementation will *not* boot if there is an active flag set for a PMBR partition. Earlier versions of the FreeBSD PMBR had the PMBR partition set active, which was wrong. The current version is correct. I'm fairly sure we've seen people with both problems on the mailing lists and in the forums: BIOS systems that would not boot without an MBR partition set active, and UEFI systems that would not boot when a PMBR partition was set active. They are rare, but it goes to prove you can't win. (To fix old, incorrect FreeBSD PMBR versions, gpart can be used to set the "active" property on the GPT disk itself, which clears an active flag set on a PMBR partition. So the problem should already be fixed, but this is the "set active" we are talking about.)