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>

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

[-- Attachment #1 --]
mike tancsa wrote:
> In the past when replacing a disk in a zfs pool that I boot from, simply
> doing
> 
> gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
> 
> where
>     p1 = freebsd-boot
>     p2 = freebsd-swap
>     p3 = freebsd-zfs
> 
> 
> works just fine (ie. replacing ada0).  However, on this one box, I
> noticed the disk has both freebsd-boot and efi
> 
>     p1 = efi
>     p2 = freebsd-boot
>     p3 = freebsd-swap
>     p4 = freebsd-zfs
> 
> 
> 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" 
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.

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


-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJduU+JAAoJEA2k8lmbXsY0q7kH/ih3Y1rIZAIp99Ek4MAGZTHI
ybPkyMcq5geSmvnCn6O9wc+8HUpxGQKUA3mvGxa1VrqDUVr21h2EqKtik5Ir40md
wLokLSl+9nuBOiMSlFEFqT14hRg9dvVanzSOOgFHz1TdH1/6/O4iK04Oj8G5KIQ4
Q2pQYQUmJFz5wR+WXHK3XwmVPNNkR45MDTJBzJCHUWiwBuyLjLGEeL4SmvDFlkd5
RAoJvpRBaVT55dhAtsHYIFczuRzTwcXCxJnIg0QDX3hc0TplnWAyMVr5lpKzDHSB
3sT5WYZj0/0wv+WiMw2NctA0fZ+pySFxg1t3C0ot4y1dsx1rvmDmiA3XJ2xIFWU=
=kSBw
-----END PGP SIGNATURE-----
help

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