Updating FreeBSD 9.0

A few days ago I wrote about installing FreeBSD on a Hetzner VPS.

As you may know FreeBSD 9.1 has recently been released and while not (yet) officially supported by the Hetzner installer you can already upgrade your instance using the built-in tool freebsd-update. It is worth noting that nothing I'm about to do is specific to Hetzner and will apply to any FreeBSD 9.0 installation.

Before following along I'd strongly recommend you take a moment to read through the freebsd-update documentation, and the official FreeBSD 9.1 release notes to familiarize yourself with how it works.

Note: a recent FreeBSD errata advisory (FreeBSD-EN-12:01.freebsd-update) requires us to first upgrade to 9.0-RELEASE-p5 before ugrading to 9.1. If you run freebsd-update fetch and see something like: "No updates needed to update system to 9.0-RELEASE-p5" then you can skip the rest of the first step.

(Step #1) First update the existing FreeBSD 9.0 to get the lastest bug fixes

> freebsd-update fetch
> freebsd-update install
> shutdown -r now

Once your system is done rebooting we'll now run the freebsd-update tool again to upgrade to 9.1

Note: after running freebsd-update install you should see the following message: Kernel updates have been installed. Please reboot and run /usr/sbin/freebsd-update install again to finish installing updates. ... so keep that second step post-reboot in mind

> freebsd-update upgrade -r 9.1-RELEASE
> freebsd-update install
> shutdown -r now

After the reboot is done you'll (hopefully) have a running FreeBSD 9.1 instance. To verify that run uname -a. The output should look like this (the key bit being 9.1-RELEASE).

FreeBSD freebsd 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec  4 09:23:10 
UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

At this point it is important to remember the instructions we noted down to run freebsd-update install post-reboot. Let's do that now.

> freebsd-update install

At this point I rebooted once more just to make sure -- but that probably wasn't required. Also worth nothing -- although it is probably Hetzner specific -- is that during the upgrade from 9.0 p0 to p5 the instance might have hung during reboot. I emphasize might have because I also might have typed "shutdown -h now" instead of "shutdown -r now" like a klutz...not sure but worth noting. I simply hard-reset via the Hetzner console.

That's it. Happy hacking!