Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Oct 2019 15:53:29 +0700
From:      Victor Sudakov <vas@sibptus.ru>
To:        freebsd-questions@freebsd.org
Subject:   Re: replacing zfs disk (freebsd-boot vs freebsd-efi)
Message-ID:  <20191030085329.GA77044@admin.sibptus.ru>
In-Reply-To: <5bf91c8b-a101-a174-a08b-cda42a43a0b5@sentex.net>
References:  <5bf91c8b-a101-a174-a08b-cda42a43a0b5@sentex.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20191030085329.GA77044>