Difference between revisions of "Upgrading FreeBSD 12.2 to 13.0"

From Aram's Wiki
Jump to: navigation, search
(Upgrade the bootloader)
(Upgrade the bootloader)
Line 27: Line 27:
 
=== Upgrade the bootloader ===  
 
=== Upgrade the bootloader ===  
  
We need to update the bootloader, otherwise the system [https://lwn.net/Articles/852586 will stop booting eventually] (but not immediately). I think this is only necessary after <code>zpool upgrade</code>, and <code>zpool upgrade</code> used to warn us about this, but apparently not anymore? (Maybe it's related to the switch to OpenZFS — unclear.)
+
We need to update the bootloader, otherwise the system [https://lwn.net/Articles/852586 will stop booting eventually] (but not immediately). I think this is only necessary after <code>zpool upgrade</code>, and <code>zpool upgrade</code> used to warn us about this, but apparently not anymore? (Maybe it's related to the switch to OpenZFS — unclear.) Presumably you can do this after booting into the new system, but before <code>zpool upgrade</code>.
  
 
==== BIOS ====
 
==== BIOS ====

Revision as of 14:27, 15 April 2021


Introduction

We assume root on ZFS.

Everything on this page needs to be done as root, unless specified, so su to root.

su -

Upgrade base system

We will do the upgrade offline, in a new BE, so first, create the BE and mount it.

bectl create 13.0-RELEASE
bectl mount 13.0-RELEASE /mnt

Then run freebsd-update(8):

freebsd-update -b /mnt -d /mnt/var/db/freebsd-update -r 13.0-RELEASE upgrade
freebsd-update -b /mnt -d /mnt/var/db/freebsd-update install
freebsd-update -b /mnt -d /mnt/var/db/freebsd-update install
freebsd-update -b /mnt -d /mnt/var/db/freebsd-update install

Yes, you really need to run it that many times.

Upgrade the bootloader

We need to update the bootloader, otherwise the system will stop booting eventually (but not immediately). I think this is only necessary after zpool upgrade, and zpool upgrade used to warn us about this, but apparently not anymore? (Maybe it's related to the switch to OpenZFS — unclear.) Presumably you can do this after booting into the new system, but before zpool upgrade.

BIOS

First, determine your boot devices.

z800:aram$ zpool status zroot
  pool: zroot
 state: ONLINE
  scan: scrub repaired 0B in 00:01:46 with 0 errors on Mon Feb  5 17:48:15 2018
config:

	NAME          STATE     READ WRITE CKSUM
	zroot         ONLINE       0     0     0
	  mirror-0    ONLINE       0     0     0
	    gpt/zfs0  ONLINE       0     0     0
	    gpt/zfs1  ONLINE       0     0     0

errors: No known data errors

Look for the devices in the GEOM output.

z800:aram$ geom -t
...
  da0                               PART       da0p3
   da0p3                           DEV       
   da0p3                           LABEL      gpt/zfs0
     gpt/zfs0                      DEV       
     zfs::vdev                     ZFS::VDEV 
...
  da2                               PART       da2p3
   da2p3                           DEV       
   da2p3                           LABEL      gpt/zfs1
     gpt/zfs1                      DEV       
     zfs::vdev                     ZFS::VDEV 
...

In our case, we need to install the new bootloader on da0 and da2.

gpart bootcode -b /mnt/boot/pmbr -p /mnt/boot/gptzfsboot -i 1 da0
gpart bootcode -b /mnt/boot/pmbr -p /mnt/boot/gptzfsboot -i 1 da2

EFI

TODO.

Upgrade the packages

It is unclear why we need devfs, but we need it:

mount -t devfs devfs /mnt/dev/
pkg -c /mnt update
pkg -c /mnt upgrade
unmount /mnt/dev/

Activate the new BE

bectl umount 13.0-RELEASE
bectl activate 13.0-RELEASE

And reboot. If it doesn't work, you can revert to another BE in the bootloader.

References