FreeBSD: The Hidden Cost of Upgrading in Production

The hidden cost mentioned applies to all operating systems and upgrading any fleet. The only thing specific, that I noticed, to FreeBSD of the article was boot environments to boot back to the pre-upgrade version.
 
It's worse if you only have one machine you can use, not 2+ servers or whatever you can use in the meantime. So for desktop users, the costs go up, especially the emotional and intellectual cost. There are no clear roadmaps 14->15, for example, and if you have one machine, you're screwed.
 
Code:
# Before touching anything 
$ bectl create pre-15.1              # bootable clone of today's system 
$ freebsd-update -r 15.1-RELEASE upgrade 
$ freebsd-update install             # reboot, then install again 
# Validation fails? Boot yesterday's system back: 
$ bectl activate pre-15.1 && shutdown -r now
There's no need to create the BE yourself, freebsd-update(8) already does this by default every time you run freebsd-update install. It creates a BE, then proceeds to install the update(s).

Code:
# Create a new boot environment when installing patches
# CreateBootEnv yes
Code:
     CreateBootEnv            The single parameter following this keyword must
                              be “yes” or “no” and specifies whether
                              freebsd-update(8) will create a new boot
                              environment using bectl(8) when installing
                              patches.

                              The name of the new boot environment consists of
                              the current FreeBSD version:

                                    freebsd-version -ku | sort -V | tail -n 1

                              and a timestamp:

                                    date +"%Y-%m-%d_%H%M%S"

                              separated by a single dash, e.g.:

                                    13.0-RELEASE-p7_2022-02-16_141502

                              freebsd-update(8) does not attempt to create a
                              boot environment if any of the following
                              applies:

                              -   ZFS is not used.
                              -   The ZFS root is not set up for boot
                                  environments (see the check command of
                                  bectl(8) for details).
                              -   freebsd-update(8) is running in a jail(8).
                              -   freebsd-update(8) is updating a root
                                  directory selected via the basedir (-b) or
                                  jail (-j) flags.
 
  • Like
Reactions: mer
It's worse if you only have one machine you can use, not 2+ servers or whatever you can use in the meantime. So for desktop users, the costs go up, especially the emotional and intellectual cost. There are no clear roadmaps 14->15, for example, and if you have one machine, you're screwed.
...and we with the one machine desktop users and ufs file sytem are on the sideways :).
 
There's no need to create the BE yourself, freebsd-update(8) already does this by default every time you run freebsd-update install. It creates a BE, then proceeds to install the update(s).
But if one understands the process, one can create a new BE and use the chroot options on freebsd-update and pkg upgrade to do the update and pkg upgrade all without a reboot.

That is my standard procedure across major releases like 12.X to 13.X, 14 to 15. Lets me have a coherent BE when I'm done.
For "regular updates" (-p# or 15.0 to 15.1) I let freebsd-update create the new BE but then I rename the BEs so the "current" one that is the update would reflect what it is and the auto created one renamed to reflect "what it was".

ETA:
This is just my opinion, my way of working that "works" for me. It may or may not work for "you" and if you do things differently, good, do what works for you.
 
Back
Top