FreeBSD 13/stable and zpool upgrade

Warner Losh imp at bsdimp.com
Fri Feb 19 21:07:48 UTC 2021


On Fri, Feb 19, 2021 at 1:49 PM Greg Rivers via freebsd-stable <
freebsd-stable at freebsd.org> wrote:

> On Friday, 19 February 2021 12:24:24 CST Kurt Jaeger wrote:
> > > > Unfortunately it contains an old version of the boot loader:
> > [...]
> > > We should be better about upgrading boot blocks, but EFI is kinda new
> and
> > > kinda different than the other out-of-root-filesystem boot blocks
> we've had
> > > in the past, so there's still some rough edges.
> >
> > We run many systems at remote sites. If we can't remotely upgrade
> > without drama from 12.x to 13.x, that would be a catastrophe.
> >
> > Any chance this can be fixed before 13.0-REL ?
> >
> Informed by reading the bsdinstall(8) scripts, I've been creating my own
> boot1.efifat thusly:
>
> #!/usr/bin/env sh
> TMPDIR=/mnt
> rm -f /boot/boot1.efifat
> newfs_msdos -F 32 -c 1 -L EFISYS -C 200m /boot/boot1.efifat
> MD=$(mdconfig -f /boot/boot1.efifat)
> mount -t msdosfs /dev/${MD} ${TMPDIR}
> mkdir -p ${TMPDIR}/efi/boot ${TMPDIR}/efi/freebsd
> cp -a /boot/loader.efi ${TMPDIR}/efi/boot/bootx64.efi
> cp -a /boot/loader.efi ${TMPDIR}/efi/freebsd/
> umount ${TMPDIR}
> mdconfig -d -u ${MD}
>
> Then I use `gpart bootcode -p /boot/boot1.efifat ...` as usual.
>
> To avoid confusion and errors, I think a proper boot1.efifat should be put
> back into the base system so that people don't have to track the above
> recipe (which is likely to change).
>

There's no safe way to do this. The old process has been deprecated because
it is dangerous and inflexible.

For upgrading from an old-style installation, the new process is actually
fairly simple:

mount -t msdos /dev/daXsY /mnt
cp /boot/loader.efi /mnt/efi/boot/bootx64.efi
umount /mnt

Though if you're using eftbootmgr to select things, you'll need to copy to
efi/freebsd/loader.efi. Different BIOS vendors have a number of different
bugs that make this trickier than it should be, alas.

Warner


More information about the freebsd-stable mailing list