Basic Installation

Pre-Installation tasks

Minimum requirements

The first step is to determine if the target system meets the minimum installation requirements. A list of supported platforms can be found here. Most recent platforms are supported. Other ones have been dropped for various reasons. This tutorial is for the X86_64, or amd64, platform only and may or may not be applicable to other platforms.

The minimum amount of available space is only 512MB but requires more advanced knowledge and goes beyond the scope of this tutorial. The minimum amount of recommended space is 8GB which should allow for a simple installation.

System/data backup

Consider creating a backup of the system before attempting to install OpenBSD. Especially in case of an intended multiboot system since a mistake in drive number or partition is quickly made. The backup should not be stored on the system that’s the target of the installation but instead on another system like a NAS or NFS share, or on an external hard drive or USB stick.

Schrodinger’s backup: The condition of any backup is unknown until a restore is attempted.

Collect information

The OpenBSD installer will ask you multiple questions during the installation. Although the default answers provided by the installer are normally usable, it’s good to look into the following in anvance.

  • Hostname/domain name
  • Network setup

If the target machine is connected to a network with a DHCP server, the networking information should be provided automatically. If there’s no DHCP server available, you need the following information:

  1. IP address
  2. Subnet mask
  3. IP address of default gateway
  4. Domain name of the network
  5. IP addresses of the network’s DNS servers
  • Disk layout

    • Which disks are available?
    • Is this a multiboot system?
    • Is encryption needed?
    • Is RAID needed?
    • Where will most of the data be stored?

Performing a simple installation

The OpenBSD installer uses a ramdisk kernel named bsd.rd which creates the environment needed to install OpenBSD but also provides tools that can be useful in a disaster recovery scenario.

The kernel can be booted in multiple ways.

  • CD/DVD
  • USB drive or external hard drive
  • An already existing partition
  • Over the network (PXE or other network boot options)
  • Floppy disk

Once the kernel is booted, the installer asks the first question.

root on rd0a swap on rd0b dump on rd0b
erase ^?, werase ^W, kill ^U, intr ^C, status ^T

Welcome to the OpenBSD/amd64 X.X installation program.
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell?

Choose (I)nstall and follow the instructions.

File Sets

One of the questions is about which filesets you want to install. The OpenBSD distribution is broken up into multiple parts called sets. Depending on the intended purpose of the machine, as well as the available space, you can either install all sets or only the required ones. Installing all sets is recommended for new users.

The following file sets are available:

  • bsd The kernel required
  • The multi-processor kernel (only on some platforms)
  • bsd.rd The ramdisk kernel
  • baseXX.tgz The base system required
  • compXX.tgz The compiler collection, headers and libraries
  • manXX.tgz Manual pages
  • gameXX.tgz Text-based games
  • xbaseXX.tgz Base libraries and utilities for X11 (requires xshareXX.tgz)
  • xfontXX.tgz Fonts used by X11
  • xservXX.tgz X11’s X servers
  • xshareXX.tgz X11’s man pages, locale settings and includes

Adding a file set after the installation

In case you realize later that a previously not installed set is needed after all. You can boot the bsd.rd kernel by rerunning the installer and instead of (I)nstall choose (U)pgrade. Move through the installer but select the filesets you need when asked about them.

Disk Partitioning

Unlike some other operating systems, OpenBSD encourages users to split their disk into a number of partitions, rather than just one or two large ones. Some of the reasons for doing so are: OpenBSD recommends users to split their disk into multiple partitions. Rather than the simple layout in for example most Linux distributions like:

  • /boot
  • swap
  • /

The reason OpenBSD encourages users to do so is threefold:

  • Security: Some of OpenBSD’s default security features rely on filesystem mount options such as nosuid, nodev, noexec, or wxallowed. Having multiple mount points allows for a more fine grained application of those options.
  • Stability: A user or a misbehaved program can use up all available space on the partition. If the misbehaving program is using a different partition than the core application of the server is, the server should be able to continue to perform its function despite the misbehaviours of other programs or users on the system.
  • fsck: You can mount partitions that you never or rarely need to write to as readonly most of the time, which will eliminate the need for a filesystem check after a crash or power interruption.

The installer is able to create the partitions automatically based on the available space. This might not be what you want but does provide a good starting point for modifications and should be fine for new OpenBSD users.

  • It’s recommended to have a seperate /usr/local partition because some applications need to be started from a wxallowed filesystem
  • A seperate /home partition shields the system from misbehaving users who fill up their home directories without the need for quota.
  • Very small partitions can cause problems during upgrades.
  • A system directly connected to the internet should have a separate /var and possibly a separate /var/log as the amount of logs could fill up all available space on a partition quickly.
  • Compiling some ports from source can take huge amounts of space on your /usr and /tmp partitions.

Sending your dmesg after the installation

At the end of the installation, the installer asks if you’d like to send information about the machine to the OpenBSD developers. Doing this is completely voluntary but helps the developers understand the type of platforms the software is used on and whether or not there are hardware support issues that should be resolved by modifying or adding drivers.

If you choose not to during the installation, you can still send the information later via:

$ (dmesg; sysctl hw.sensors) | mail -s "Some information about the machine"