Jan 212019
 

Today I will upgrade knew from FreeBSD 11.2 to FreeBSD 12.0. It so happens that this is my last server at home which is still running 11.2, but I do have another server still on 11.2, but that one is at NYI.

This post isn’t so much about beadm or about freebsd-update. I have written about moving to a beadm layout, but if your zfs list output looks something like this, you’re good to go:

[dvl@nagios02:~] $ zfs list
NAME                      USED  AVAIL  REFER  MOUNTPOINT
zroot                    8.17G  9.15G    19K  none
zroot/ROOT               8.13G  9.15G    19K  none
zroot/ROOT/default       8.13G  9.15G  5.86G  legacy
zroot/tmp                 193K  9.15G   193K  /tmp
zroot/usr                4.31M  9.15G    19K  /usr
zroot/usr/home           4.25M  9.15G  4.24M  /usr/home
zroot/usr/ports            19K  9.15G    19K  /usr/ports
zroot/usr/src              19K  9.15G    19K  /usr/src
zroot/var                28.9M  9.15G    19K  /var
zroot/var/audit            19K  9.15G    19K  /var/audit
zroot/var/crash            19K  9.15G    19K  /var/crash
zroot/var/log            28.7M  9.15G  28.7M  /var/log
zroot/var/mail             34K  9.15G    34K  /var/mail
zroot/var/tmp            77.5K  9.15G  77.5K  /var/tmp

This is, more or less, the default layout with recent FreeBSD installs.

This server has a boot environment configuration, meaning that you can use beadm to save a copy of your current configuration and then upgrade. Should anything happen, you can go back to what you had before.

In this screenshot, I list the existing boot environments, create a new one, and then list again.

With beadm, I always save the existing environment with the release version in the name, such as this:

[dan@knew:~] $ beadm list
BE           Active Mountpoint  Space Created
default      NR     /            9.5G 2017-09-28 21:37
11.1-RELEASE -      -          397.0K 2018-07-31 20:07
[dan@knew:~] $ sudo beadm create 11.2-RELEASE                                                                                                                 
Created successfully
[dan@knew:~] $ beadm list
BE           Active Mountpoint  Space Created
default      NR     /            9.5G 2017-09-28 21:37
11.1-RELEASE -      -          397.0K 2018-07-31 20:07
11.2-RELEASE -      -          207.0K 2019-01-21 21:58
[dan@knew:~] $ 

Then I move onto the upgrade:

$ sudo freebsd-update -r 12.0-RELEASE upgrade
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 11.2-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Inspecting system... done.

The following components of FreeBSD seem to be installed:
kernel/generic world/base world/doc

The following components of FreeBSD do not seem to be installed:
kernel/generic-dbg world/base-dbg world/lib32 world/lib32-dbg

Does this look reasonable (y/n)? y

Fetching metadata signature for 12.0-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Fetching files from 11.2-RELEASE for merging... done.
Preparing to download files... done.
Fetching 8311 patches.....10....20....
...

I will be total skipping huge parts of the upgrade process. Merging of patches for configuration files is skipped, for example.

The first reboot went just fine:

[dan@knew:~] $ uname -a
FreeBSD knew.int.unixathome.org 12.0-RELEASE-p2 FreeBSD 12.0-RELEASE-p2 GENERIC  amd64

Now it’s time to install world.

OK, that’s done.

Next upgrade, the packages:

pkg-static install -f pkg
pkg upgrade -fa

The first, ensures you have the correct pkg. The second upgrades everything.

After my packages are upgraded, I like to look at what didn’t get upgraded:

$ pkg info -fa | grep Architecture | grep -v FreeBSD:12
Architecture   : FreeBSD:11:amd64
Architecture   : FreeBSD:11:amd64
Architecture   : FreeBSD:11:amd64
Architecture   : FreeBSD:11:amd64
Architecture   : freebsd:9:x86:64
Architecture   : FreeBSD:9:amd64
Architecture   : FreeBSD:11:*
Architecture   : FreeBSD:11:amd64

Then I run this and searach for the values found above. In this case, I wound up deleting a bunch of stuff which I no longer used. This is from my command history:

$ history | grep 'pkg delete'
  474  sudo pkg delete ezjail
  500  sudo pkg delete automake-wrapper
  502  sudo pkg delete libexecinfo
  505  sudo pkg delete logstash-forwarder
  507  sudo pkg delete p5-Cache
  509  sudo pkg delete portmaster
  511  sudo pkg delete procmail
  516  sudo pkg delete p5-Text-CSV
  518  sudo pkg delete p5-Text-CSV
  520  sudo pkg delete p5-Time-HiRes

I also refer you to this command, from Thomas Hurst which shows me any packages installed more than 6 hours ago:

[dan@knew:~] $ pkg query -a '%n %t' | awk -v t=$(date -v -6H +%s) '$2 < t { print $1 }'
[dan@knew:~] $ 

There, that's proof that I have upgraded all the packages.

And with that, this server is now running on FreeBSD 12.0 and all the jails came back online just file.

The jails however, are all on FreeBSD 11.2, which is just what I want. I do not want to upgrade them yet.

Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive