<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/default.xsl"?>
<fr:tree xmlns:fr="http://www.forester-notes.org" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xml="http://www.w3.org/XML/1998/namespace" root="false" base-url="/">
  <fr:frontmatter>
    <fr:authors>
      <fr:author>
        <fr:link href="/aram/" title="Aram Hăvărneanu" uri="https://xw.is/aram/" display-uri="aram" type="local">Aram Hăvărneanu</fr:link>
      </fr:author>
    </fr:authors>
    <fr:date>
      <fr:year>2021</fr:year>
      <fr:month>4</fr:month>
      <fr:day>15</fr:day>
    </fr:date>
    <fr:date>
      <fr:year>2022</fr:year>
      <fr:month>5</fr:month>
      <fr:day>18</fr:day>
    </fr:date>
    <fr:date>
      <fr:year>2025</fr:year>
      <fr:month>8</fr:month>
      <fr:day>27</fr:day>
    </fr:date>
    <fr:date>
      <fr:year>2026</fr:year>
      <fr:month>4</fr:month>
      <fr:day>28</fr:day>
    </fr:date>
    <fr:uri>https://xw.is/001J/</fr:uri>
    <fr:display-uri>001J</fr:display-uri>
    <fr:route>/001J/</fr:route>
    <fr:title text="FreeBSD › Upgrade FreeBSD 14.3 to 15.0"><fr:link href="/freebsd-index/" title="FreeBSD" uri="https://xw.is/freebsd-index/" display-uri="freebsd-index" type="local">FreeBSD</fr:link> › Upgrade <fr:link href="/freebsd/" title="FreeBSD" uri="https://xw.is/freebsd/" display-uri="freebsd" type="local">FreeBSD</fr:link> 14.3 to 15.0</fr:title>
  </fr:frontmatter>
  <fr:mainmatter>
    <fr:tree show-metadata="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="/aram/" title="Aram Hăvărneanu" uri="https://xw.is/aram/" display-uri="aram" type="local">Aram Hăvărneanu</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2021</fr:year>
          <fr:month>4</fr:month>
          <fr:day>15</fr:day>
        </fr:date>
        <fr:date>
          <fr:year>2022</fr:year>
          <fr:month>5</fr:month>
          <fr:day>18</fr:day>
        </fr:date>
        <fr:date>
          <fr:year>2025</fr:year>
          <fr:month>8</fr:month>
          <fr:day>27</fr:day>
        </fr:date>
        <fr:date>
          <fr:year>2026</fr:year>
          <fr:month>4</fr:month>
          <fr:day>28</fr:day>
        </fr:date>
        <fr:title text="Introduction">Introduction</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>Everything on this page needs to be done as root unless otherwise specified, so <fr:link href="https://man.freebsd.org/cgi/man.cgi?su(1)" type="external">su(1)</fr:link> to root.</html:p>
        <html:pre>su -</html:pre>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="/aram/" title="Aram Hăvărneanu" uri="https://xw.is/aram/" display-uri="aram" type="local">Aram Hăvărneanu</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2021</fr:year>
          <fr:month>4</fr:month>
          <fr:day>15</fr:day>
        </fr:date>
        <fr:date>
          <fr:year>2022</fr:year>
          <fr:month>5</fr:month>
          <fr:day>18</fr:day>
        </fr:date>
        <fr:date>
          <fr:year>2025</fr:year>
          <fr:month>8</fr:month>
          <fr:day>27</fr:day>
        </fr:date>
        <fr:date>
          <fr:year>2026</fr:year>
          <fr:month>4</fr:month>
          <fr:day>28</fr:day>
        </fr:date>
        <fr:title text="Upgrade the base system">Upgrade the base system</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>We will do the upgrade offline (in a new <fr:link href="/freebsd-be/" title="FreeBSD Boot Environments" uri="https://xw.is/freebsd-be/" display-uri="freebsd-be" type="local">boot environment</fr:link>) so first create the BE using <fr:link href="/bectl.8" title="bectl(8)" uri="https://xw.is/bectl.8" display-uri="bectl.8" type="local">bectl(8)</fr:link> and mount it.</html:p>
        <html:pre>
bectl create 15.0-RELEASE
bectl mount 15.0-RELEASE /mnt</html:pre>
        <html:p>Then run <fr:link href="/freebsd-update.8" title="freebsd-update(8)" uri="https://xw.is/freebsd-update.8" display-uri="freebsd-update.8" type="local">freebsd-update(8)</fr:link>:</html:p>
        <html:pre>
freebsd-update -b /mnt -d /mnt/var/db/freebsd-update -r 15.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</html:pre>
        <html:p>
          <html:mark>Yes, you really need to run it that many times.</html:mark>
        </html:p>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="/aram/" title="Aram Hăvărneanu" uri="https://xw.is/aram/" display-uri="aram" type="local">Aram Hăvărneanu</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2021</fr:year>
          <fr:month>4</fr:month>
          <fr:day>15</fr:day>
        </fr:date>
        <fr:date>
          <fr:year>2022</fr:year>
          <fr:month>5</fr:month>
          <fr:day>18</fr:day>
        </fr:date>
        <fr:date>
          <fr:year>2025</fr:year>
          <fr:month>8</fr:month>
          <fr:day>27</fr:day>
        </fr:date>
        <fr:date>
          <fr:year>2026</fr:year>
          <fr:month>4</fr:month>
          <fr:day>28</fr:day>
        </fr:date>
        <fr:title text="Upgrade the bootloader">Upgrade the bootloader</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p><html:mark>You need to update the bootloader</html:mark>, otherwise the system <fr:link href="https://lwn.net/Articles/852586" type="external">will stop booting eventually</fr:link> (but not immediately). I think this is only necessary after <html:code>zpool upgrade</html:code>, and <html:code>zpool upgrade</html: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 <html:code>zpool upgrade</html:code>.</html:p>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/aram/" title="Aram Hăvărneanu" uri="https://xw.is/aram/" display-uri="aram" type="local">Aram Hăvărneanu</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2021</fr:year>
              <fr:month>4</fr:month>
              <fr:day>15</fr:day>
            </fr:date>
            <fr:date>
              <fr:year>2022</fr:year>
              <fr:month>5</fr:month>
              <fr:day>18</fr:day>
            </fr:date>
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>8</fr:month>
              <fr:day>27</fr:day>
            </fr:date>
            <fr:date>
              <fr:year>2026</fr:year>
              <fr:month>4</fr:month>
              <fr:day>28</fr:day>
            </fr:date>
            <fr:title text="BIOS">BIOS</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>First, determine your boot devices.</html:p>
            <html:pre>
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
	    <html:strong>gpt/zfs0</html:strong>  ONLINE       0     0     0
	    <html:strong>gpt/zfs1</html:strong>  ONLINE       0     0     0

errors: No known data errors</html:pre>
            <html:p>Look for the <fr:link href="/geom/" title="GEOM: Modular Disk Transformation Framework" uri="https://xw.is/geom/" display-uri="geom" type="local">GEOM</fr:link> devices in the <fr:link href="/geom.8" title="geom(8)" uri="https://xw.is/geom.8" display-uri="geom.8" type="local">geom(8)</fr:link> output.</html:p>
            <html:pre>
z800:aram$ geom -t
...
  da0                               PART       da0p3
   da0p3                           DEV
   <html:strong>da0</html:strong>p3                           LABEL      <html:strong>gpt/zfs0</html:strong>
     gpt/zfs0                      DEV
     zfs::vdev                     ZFS::VDEV
...
  da2                               PART       da2p3
   da2p3                           DEV
   <html:strong>da2</html:strong>p3                           LABEL      <html:strong>gpt/zfs1</html:strong>
     gpt/zfs1                      DEV
     zfs::vdev                     ZFS::VDEV
...</html:pre>
            <html:p>In our case, we need to install the new bootloader on <html:code>da0</html:code> and <html:code>da2</html:code> using <fr:link href="/gpart.8" title="gpart(8)" uri="https://xw.is/gpart.8" display-uri="gpart.8" type="local">gpart(8)</fr:link>.</html:p>
            <html:pre>
gpart bootcode -b /mnt/boot/pmbr -p /mnt/boot/gptzfsboot -i 1 <html:strong>da0</html:strong>
gpart bootcode -b /mnt/boot/pmbr -p /mnt/boot/gptzfsboot -i 1 <html:strong>da2</html:strong></html:pre>
            <html:p>Of course, if you already booted into the new system, these become:</html:p>
            <html:pre>
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 <html:strong>da0</html:strong>
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 <html:strong>da2</html:strong></html:pre>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/aram/" title="Aram Hăvărneanu" uri="https://xw.is/aram/" display-uri="aram" type="local">Aram Hăvărneanu</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2021</fr:year>
              <fr:month>4</fr:month>
              <fr:day>15</fr:day>
            </fr:date>
            <fr:date>
              <fr:year>2022</fr:year>
              <fr:month>5</fr:month>
              <fr:day>18</fr:day>
            </fr:date>
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>8</fr:month>
              <fr:day>27</fr:day>
            </fr:date>
            <fr:date>
              <fr:year>2026</fr:year>
              <fr:month>4</fr:month>
              <fr:day>28</fr:day>
            </fr:date>
            <fr:title text="EFI">EFI</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>
              <html:em>TODO.</html:em>
            </html:p>
          </fr:mainmatter>
        </fr:tree>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="/aram/" title="Aram Hăvărneanu" uri="https://xw.is/aram/" display-uri="aram" type="local">Aram Hăvărneanu</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2021</fr:year>
          <fr:month>4</fr:month>
          <fr:day>15</fr:day>
        </fr:date>
        <fr:date>
          <fr:year>2022</fr:year>
          <fr:month>5</fr:month>
          <fr:day>18</fr:day>
        </fr:date>
        <fr:date>
          <fr:year>2025</fr:year>
          <fr:month>8</fr:month>
          <fr:day>27</fr:day>
        </fr:date>
        <fr:date>
          <fr:year>2026</fr:year>
          <fr:month>4</fr:month>
          <fr:day>28</fr:day>
        </fr:date>
        <fr:title text="Upgrade the packages">Upgrade the packages</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>It is unclear why we need <fr:link href="https://man.freebsd.org/cgi/man.cgi?devfs(5)" type="external">devfs</fr:link>, but we need it.</html:p>
        <html:pre>
mount -t devfs devfs /mnt/dev/
pkg -c /mnt update
pkg -c /mnt upgrade
umount /mnt/dev/</html:pre>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:author>
            <fr:link href="/aram/" title="Aram Hăvărneanu" uri="https://xw.is/aram/" display-uri="aram" type="local">Aram Hăvărneanu</fr:link>
          </fr:author>
        </fr:authors>
        <fr:date>
          <fr:year>2021</fr:year>
          <fr:month>4</fr:month>
          <fr:day>15</fr:day>
        </fr:date>
        <fr:date>
          <fr:year>2022</fr:year>
          <fr:month>5</fr:month>
          <fr:day>18</fr:day>
        </fr:date>
        <fr:date>
          <fr:year>2025</fr:year>
          <fr:month>8</fr:month>
          <fr:day>27</fr:day>
        </fr:date>
        <fr:date>
          <fr:year>2026</fr:year>
          <fr:month>4</fr:month>
          <fr:day>28</fr:day>
        </fr:date>
        <fr:title text="Activate the new boot environment">Activate the new <fr:link href="/freebsd-be/" title="FreeBSD Boot Environments" uri="https://xw.is/freebsd-be/" display-uri="freebsd-be" type="local">boot environment</fr:link></fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>Activate the new <fr:link href="/freebsd-be/" title="FreeBSD Boot Environments" uri="https://xw.is/freebsd-be/" display-uri="freebsd-be" type="local">boot environment</fr:link>, then reboot.</html:p>
        <html:pre>
bectl umount 15.0-RELEASE
bectl activate 15.0-RELEASE</html:pre>
        <html:p>If it doesn't work, you can revert to another BE in the bootloader.</html:p>
      </fr:mainmatter>
    </fr:tree>
  </fr:mainmatter>
  <fr:backmatter>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="References">References</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Context">Context</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Backlinks">Backlinks</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Related">Related</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:uri>https://xw.is/freebsd/</fr:uri>
            <fr:display-uri>freebsd</fr:display-uri>
            <fr:route>/freebsd/</fr:route>
            <fr:title text="FreeBSD">FreeBSD</fr:title>
            <fr:taxon>Software</fr:taxon>
            <fr:meta name="external">https://www.freebsd.org</fr:meta>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>Free-software Unix-like operating system descended from the Berkeley Software Distribution (BSD).</html:p>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:uri>https://xw.is/freebsd-be/</fr:uri>
            <fr:display-uri>freebsd-be</fr:display-uri>
            <fr:route>/freebsd-be/</fr:route>
            <fr:title text="FreeBSD Boot Environments"><fr:link href="/freebsd/" title="FreeBSD" uri="https://xw.is/freebsd/" display-uri="freebsd" type="local">FreeBSD</fr:link> Boot Environments</fr:title>
            <fr:taxon>Documentation</fr:taxon>
            <fr:meta name="external">https://wiki.freebsd.org/BootEnvironments</fr:meta>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>Bootable ZFS datasets.</html:p>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:uri>https://xw.is/geom/</fr:uri>
            <fr:display-uri>geom</fr:display-uri>
            <fr:route>/geom/</fr:route>
            <fr:title text="GEOM: Modular Disk Transformation Framework">GEOM: Modular Disk Transformation Framework</fr:title>
            <fr:taxon>Documentation</fr:taxon>
            <fr:meta name="external">https://docs.freebsd.org/en/books/handbook/geom/</fr:meta>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>Modular disk I/O request transformation framework.</html:p>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:uri>https://xw.is/bectl.8</fr:uri>
            <fr:display-uri>bectl.8</fr:display-uri>
            <fr:route>/bectl.8</fr:route>
            <fr:title text="bectl(8)">bectl(8)</fr:title>
            <fr:taxon>Manual</fr:taxon>
            <fr:meta name="external">https://man.freebsd.org/cgi/man.cgi?query=bectl&amp;sektion=8</fr:meta>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>Manage ZFS <fr:link href="/freebsd-be/" title="FreeBSD Boot Environments" uri="https://xw.is/freebsd-be/" display-uri="freebsd-be" type="local">boot enviroments</fr:link> on <fr:link href="/freebsd/" title="FreeBSD" uri="https://xw.is/freebsd/" display-uri="freebsd" type="local">FreeBSD</fr:link>.</html:p>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:uri>https://xw.is/freebsd-update.8</fr:uri>
            <fr:display-uri>freebsd-update.8</fr:display-uri>
            <fr:route>/freebsd-update.8</fr:route>
            <fr:title text="freebsd-update(8)">freebsd-update(8)</fr:title>
            <fr:taxon>Manual</fr:taxon>
            <fr:meta name="external">https://man.freebsd.org/cgi/man.cgi?query=freebsd-update&amp;sektion=8</fr:meta>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>Fetch and install binary updates to <fr:link href="/freebsd/" title="FreeBSD" uri="https://xw.is/freebsd/" display-uri="freebsd" type="local">FreeBSD</fr:link>.</html:p>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:uri>https://xw.is/geom.8</fr:uri>
            <fr:display-uri>geom.8</fr:display-uri>
            <fr:route>/geom.8</fr:route>
            <fr:title text="geom(8)">geom(8)</fr:title>
            <fr:taxon>Manual</fr:taxon>
            <fr:meta name="external">https://man.freebsd.org/cgi/man.cgi?query=geom&amp;sektion=8</fr:meta>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>Universal control utility for <fr:link href="/geom/" title="GEOM: Modular Disk Transformation Framework" uri="https://xw.is/geom/" display-uri="geom" type="local">GEOM</fr:link> classes.</html:p>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:uri>https://xw.is/gpart.8</fr:uri>
            <fr:display-uri>gpart.8</fr:display-uri>
            <fr:route>/gpart.8</fr:route>
            <fr:title text="gpart(8)">gpart(8)</fr:title>
            <fr:taxon>Manual</fr:taxon>
            <fr:meta name="external">https://man.freebsd.org/cgi/man.cgi?query=gpart&amp;sektion=8</fr:meta>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>Control utility for the disk partitioning <fr:link href="/geom/" title="GEOM: Modular Disk Transformation Framework" uri="https://xw.is/geom/" display-uri="geom" type="local">GEOM</fr:link> class.</html:p>
          </fr:mainmatter>
        </fr:tree>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Contributions">Contributions</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
  </fr:backmatter>
</fr:tree>
