DEV Community

nabbisen
nabbisen

Posted on • Edited on

Upgrading OpenBSD From 6.3 To 6.4

Summary

This post is about upgrading OpenBSD from 6.3 to 6.4.
What is necessary is to locate bsd.rd of the target version in the root directory and run it on boot.
bsd.rd is "a special ramdisk kernel."

This tutorial is available with not only computers at hand but also VPS services providing OpenBSD image with VNC (Virtual Network Computing) such as Vultr and CloudSigma.

Official Documents

The OpenBSD project always provides rich documentation about their products.
This is also the case of upgrading the OS:

Upgrades are only supported from one release to the release immediately following it. Read through and understand this process before attempting it. For critical or physically remote machines, test it on an identical, local system first.

Start by performing the pre-upgrade steps. Next, boot from the install kernel, bsd.rd: use bootable install media, or place the 6.4 version of bsd.rd in the root of your filesystem and instruct the boot loader to boot this kernel. Once this kernel is booted, choose the (U)pgrade option and follow the prompts. Apply the configuration changes and finish up by upgrading the packages: pkg_add -u.

Alternatively, you can use the manual upgrade process.

You may wish to check the errata page or upgrade to the stable branch to get any post-release fixes.

To my sadness, however, I wasn't matured enough to understand how to "instruct the boot loader to boot this kernel"...
It was found an easy way; I just had to type something while the screen was waiting for some seconds showing "boot>" on boot.

✿ ✿ ✿

Tutorial

Step 1: Preparation

Get bsd.rd of the target version:

# # get bsd.rd
# wget https://cdn.openbsd.org/pub/OpenBSD/6.4/amd64/bsd.rd
# wget https://cdn.openbsd.org/pub/OpenBSD/6.4/amd64/SHA256.sig
# # verify it
# signify -C -p /etc/signify/openbsd-64-base.pub -x SHA256.sig bsd.rd
Signature Verified
bsd.rd: OK
Enter fullscreen mode Exit fullscreen mode

Replace it with that of the previous version in the root directory:

# # create backup of the previous version
# cp /bsd.rd ./bsd.rd.63
# # replace /bsd.rd
# cp bsd.rd /

# # remove downloaded files as needed
# rm ./bsd.rd
# rm ./SHA256.sig
Enter fullscreen mode Exit fullscreen mode

* Note: If you upgraded your system from all the way back 2013 and never deleted the user and group:

# userdel _btd
# # "userdel: No such user `_btd'" is echoed if not applicable to the above
# groupdel _btd
# # "groupdel: No such group: `_btd'" is echoed if not applicable to the above
Enter fullscreen mode Exit fullscreen mode

Step 2: Running bsd.rd

Be sure to connect with the server via direct or VNC connection.

* Note: Using VNC connection, Reminna is one of the useful tools as a client.

Reboot the OS:

# reboot
Enter fullscreen mode Exit fullscreen mode

Wait for the booting console shows "boot>":

booting-console

Now, be quick to type something so the automatic process stops.

And type boot /bsd.rd as above. That's it!

Step 3: Upgrading

OpenBSD 6.4 installation program starts like this:

Welcome to the OpenBSD/amd64 6.4 installation program.
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? u
Enter fullscreen mode Exit fullscreen mode

Choose "u" so questions which are very similar to the initial installation are given.

* Note: Choosing "i" will give the way to install OpenBSD 6.4 in the existing disk or empty space.

Answer them like these ways:

Question Answer
Which disk is the root disk sd0
Force checking of clean non-root filesystems no
Location of sets http
HTTP proxy URL none
HTTP Server cdn.openbsd.org
Server directory pub/OpenBSD/6.4/amd64
Set name(s) -game* done (which is better than "-game* -x* done" if php is used in various scenes)
Location of sets done

Of course, they are up to the environment.

After installation, you will get the congratulations message:

Let's reboot it and OpenBSD 6.4 will be in your hands!

Step 4: Upgrading

I recommend the additional operations when starting the new OS for the first time:

# # apply base system binary patches
# syspatch
# # upgrade packages
# pkg_add -u
Enter fullscreen mode Exit fullscreen mode
✿ ✿ ✿

Happy serving 🕊

Latest comments (0)