From owner-freebsd-questions@freebsd.org Wed Oct 30 08:53:37 2019 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 32FF017E429 for ; Wed, 30 Oct 2019 08:53:37 +0000 (UTC) (envelope-from vas@sibptus.ru) Received: from admin.sibptus.ru (admin.sibptus.ru [IPv6:2001:19f0:5001:21dc::10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4732L81GdMz4cJn for ; Wed, 30 Oct 2019 08:53:35 +0000 (UTC) (envelope-from vas@sibptus.ru) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sibptus.ru; s=20181118; h=In-Reply-To:Message-ID:Subject:To:From:Date; bh=Z5jkbJHhZe1b82ETlXEaphj3c8Xka/NFRjG8EidQP/Q=; b=kITQ93clUYiKA8PAsKcI5LILCe 9ED+dc+oIgvfAfm0tqeb9qnUzD7FuoPhos8OHnguLg2rXyTDXRcFDv6Z5kr3cyAvVxDid6pvfEYeO OUe6HWWVsWvQHERolrlBF3J0A8PBdn/FbbzyAmXlugOytKOM4VQVAVWu//eUPpTX+sHs=; Received: from vas by admin.sibptus.ru with local (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1iPjjN-000KEk-88 for freebsd-questions@freebsd.org; Wed, 30 Oct 2019 15:53:29 +0700 Date: Wed, 30 Oct 2019 15:53:29 +0700 From: Victor Sudakov To: freebsd-questions@freebsd.org Subject: Re: replacing zfs disk (freebsd-boot vs freebsd-efi) Message-ID: <20191030085329.GA77044@admin.sibptus.ru> References: <5bf91c8b-a101-a174-a08b-cda42a43a0b5@sentex.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline In-Reply-To: <5bf91c8b-a101-a174-a08b-cda42a43a0b5@sentex.net> X-PGP-Key: http://admin.sibptus.ru/~vas/ X-PGP-Fingerprint: 10E3 1171 1273 E007 C2E9 3532 0DA4 F259 9B5E C634 User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 4732L81GdMz4cJn X-Spamd-Bar: -------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=sibptus.ru header.s=20181118 header.b=kITQ93cl; dmarc=pass (policy=none) header.from=sibptus.ru; spf=pass (mx1.freebsd.org: domain of vas@sibptus.ru designates 2001:19f0:5001:21dc::10 as permitted sender) smtp.mailfrom=vas@sibptus.ru X-Spamd-Result: default: False [-8.36 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[sibptus.ru:s=20181118]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; TO_DN_NONE(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(-3.26)[ip: (-9.83), ipnet: 2001:19f0:5000::/38(-4.92), asn: 20473(-1.51), country: US(-0.05)]; DKIM_TRACE(0.00)[sibptus.ru:+]; DMARC_POLICY_ALLOW(-0.50)[sibptus.ru,none]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:20473, ipnet:2001:19f0:5000::/38, country:US]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 08:53:37 -0000 --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable mike tancsa wrote: > In the past when replacing a disk in a zfs pool that I boot from, simply > doing >=20 > gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0 >=20 > where > =A0=A0=A0 p1 =3D freebsd-boot > =A0=A0=A0 p2 =3D freebsd-swap > =A0=A0=A0 p3 =3D freebsd-zfs >=20 >=20 > works just fine (ie. replacing ada0).=A0 However, on this one box, I > noticed the disk has both freebsd-boot and efi >=20 > =A0=A0=A0 p1 =3D efi > =A0=A0=A0 p2 =3D freebsd-boot > =A0=A0=A0 p3 =3D freebsd-swap > =A0=A0=A0 p4 =3D freebsd-zfs >=20 >=20 > If I replace ada0, what do I need to do in order to full restore boot > functionality to the disk ? May I suggest that if it's really a UEFI system, you probably don't need the freebsd-boot partition at all, nor any boot blocks or {P,M,V}BRs. Just make sure that the EFI (p1) partition is formatted as FAT (even FAT16 would do) and contains the \EFI\BOOT\BOOTX64.EFI loader. The command "gpart bootcode -p /boot/boot1.efifat -i 1 ada0"=20 may be a convenient way of copying the FAT partition image to the p1 partition, but certainly not the only one to format and populate it. You could use an MS-DOS floppy as well for the purpose. >=20 > gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 ada0 The above ^^^^^ should be unnecessary. Your UEFI firmware will find the partition of the "efi" type and try to load /EFI/BOOT/BOOTX64.EFI from there, which in turn will sniff your ZFS filesystems for the loader. man 8 uefi --=20 Victor Sudakov, VAS4-RIPE, VAS47-RIPN 2:5005/49@fidonet http://vas.tomsk.ru/ --J2SCkAp4GZ/dPZZf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJduU+JAAoJEA2k8lmbXsY0q7kH/ih3Y1rIZAIp99Ek4MAGZTHI ybPkyMcq5geSmvnCn6O9wc+8HUpxGQKUA3mvGxa1VrqDUVr21h2EqKtik5Ir40md wLokLSl+9nuBOiMSlFEFqT14hRg9dvVanzSOOgFHz1TdH1/6/O4iK04Oj8G5KIQ4 Q2pQYQUmJFz5wR+WXHK3XwmVPNNkR45MDTJBzJCHUWiwBuyLjLGEeL4SmvDFlkd5 RAoJvpRBaVT55dhAtsHYIFczuRzTwcXCxJnIg0QDX3hc0TplnWAyMVr5lpKzDHSB 3sT5WYZj0/0wv+WiMw2NctA0fZ+pySFxg1t3C0ot4y1dsx1rvmDmiA3XJ2xIFWU= =kSBw -----END PGP SIGNATURE----- --J2SCkAp4GZ/dPZZf--