From owner-freebsd-stable@freebsd.org Fri Dec 16 19:00:30 2016 Return-Path: Delivered-To: freebsd-stable@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 C7325C8336E for ; Fri, 16 Dec 2016 19:00:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77F32CCD; Fri, 16 Dec 2016 19:00:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::4ccf:cb4c:3c45:4bd1] (unknown [IPv6:2001:7b8:3a7:0:4ccf:cb4c:3c45:4bd1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 6364014EB3; Fri, 16 Dec 2016 20:00:27 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_EAA0DB25-C410-4B79-B169-BE326F269818"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: Upgrading boot from GPT(BIOS) to GPT(UEFI) From: Dimitry Andric In-Reply-To: Date: Fri, 16 Dec 2016 20:00:16 +0100 Cc: Eric van Gyzen , =?utf-8?Q?Fernando_Herrero_Carr=C3=B3n?= , freebsd-stable , Slawa Olhovchenkov Message-Id: <85F3F813-D821-439B-B700-DCE51C53E035@FreeBSD.org> References: <20161216173930.GD90401@zxy.spb.ru> To: Antony Uspensky X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2016 19:00:30 -0000 --Apple-Mail=_EAA0DB25-C410-4B79-B169-BE326F269818 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 16 Dec 2016, at 18:53, Antony Uspensky wrote: >=20 > On Fri, 16 Dec 2016, Eric van Gyzen wrote: >> On 12/16/2016 11:39, Slawa Olhovchenkov wrote: >>> On Fri, Dec 16, 2016 at 06:08:34PM +0100, Fernando Herrero Carr?n = wrote: >>>> Hi everyone, >>>>=20 >>>> A few months ago I got myself a new box and I have been happily = running >>>> FreeBSD on it ever since. I noticed that the boot was not as fast = as I had >>>> expected and I've realized that, while my disk is GPT partitioned, = the boot >>>> process is still BIOS based: >>>>=20 >>>> % gpart show >>>> =3D> 34 976773101 ada0 GPT (466G) >>>> 34 6 - free - (3.0K) >>>> 40 1024 1 freebsd-boot (512K) >>>> 1064 984 - free - (492K) >>>> 2048 67108864 2 freebsd-swap (32G) >>>> 67110912 909662208 3 freebsd-zfs (434G) >>>> 976773120 15 - free - (7.5K) ... > I would shrink ada0p1 down to 128K (size of gptzfsboot =3D 88K now) = and place efi partition (~800K) on free space between new p1 and p2. No = need to touch swap partition. Yes, this is almost exactly what I have done on a machine that was originally installed with gptzfsboot on the first partition, which was 512K. Since all the partitions on this SSD were aligned to 1M, I reduced the size of the first partition to 224K, freeing up a hole of exactly 800K for an EFI partition: =3D> 40 976773088 ada0 GPT (466G) 40 2008 - free - (1.0M) 2048 448 1 freebsd-boot (224K) 2496 1600 4 efi (800K) 4096 33554432 2 freebsd-swap (16G) 33558528 943214592 3 freebsd-zfs (450G) 976773120 8 - free - (4.0K) Then I wrote the preformatted boot1.efifat image to it, using: gpart bootcode -p /boot/boot1.efifat -i 4 ada0. You can also use dd of course, but I prefer using gpart for these kinds of manipulations. This way, you can choose between booting in old school BIOS mode, or UEFI mode. If the UEFI mode works flawlessly, you can always decide later to dump the freebsd-boot partition, and use only an EFI partition. -Dimitry P.S.: The only thing that triggers my OCD here is that the EFI partition has index 4, but is physically the second. But I can live with that, until I finally delete the freebsd-boot partition. :) --Apple-Mail=_EAA0DB25-C410-4B79-B169-BE326F269818 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAlhUOcoACgkQsF6jCi4glqNQFwCguhWa+Wf6DJQZaQmhVZsd//wY JJIAn0ZK+50vRfq6oQ1HjCxhRIMADvPu =7O/C -----END PGP SIGNATURE----- --Apple-Mail=_EAA0DB25-C410-4B79-B169-BE326F269818--