<?php include('HEADER.php'); ?>

<h1>OpenBSD</h1>

<p>Here are a few notes on the installation and administration of OpenBSD. This was written for version 5.6, circa 2015.</p>

<h2>Documentation</h2>

<p>OpenBSD has good documentation that comes in two forms: the <a href="http://www.openbsd.org/faq/index.html">OpenBSD FAQ</a> and its <a href="http://www.openbsd.org/cgi-bin/man.cgi">manual pages</a>. The FAQ's <a href="http://www.openbsd.org/faq/faq2.html">Getting Started</a> page has good links.</p>

<p>These man pages are good introductory material: <code>afterboot, hier, daily, sysctl</code>.</p>

<p><a href="https://www.michaelwlucas.com/nonfiction/absolute-openbsd-2nd-edition">Absolute OpenBSD</a> is a very good book. Note the discount code on the author's page.</p>

<h2>Installation</h2>

<p>How do we get OpenBSD? Download an ISO from one of the <a href="http://www.openbsd.org/ftp.html">mirrors</a>. Which ISO? Probably either cd56.iso or install56.iso. The former is the minimal net-based install, the later includes more software on the image. Unless we're installing more than a couple of boxes, go with the net-based cd56.iso, because it's likely to save bandwidth overall, and it sets our default source to the net rather than CD for when we want to add additional packages post-install.</p>

<p>OpenBSD installation is straightforward. It asks only a dozen or so questions of the user. The only potentially tricky bit is partitioning the disk.</p>

<p>Partitioning. OpenBSD uses various partitions, with a greater number and granularity (particularly /usr partitions) than seen on other *nixes. These are: / (root), swap, /tmp, /var/, /usr, /usr/local, /usr/X11R6, /usr/src, /usr/obj, and /home. The /usr/src and /usr/obj partitions are used in OpenBSD's update process, where the updated source tree is pulled into /usr/src and compiled binaries placed in /usr/obj. The size and necessity of these partitions vary with system type. A firewall, for example, may not have a compiler for security reasons, so separate /usr/src and /usr/obj partitions become unnecessary. An embedded system may not have the horsepower or disk space for compiling. However, where practical, it's a good idea to have all these partitions, because OpenBSD uses them (among other reasons) as security mechanisms.</p>

<p>We may well want to edit the suggested/automatic partition scheme to better suit our needs. Once editing the partition table, <code>?</code> gives help. If we want to print the partition table in gigabytes, use <code>p g</code>. The partitions are identified by letter, and the swap partition is always "b".</p>

<p>One final detail. When the installer asks you which bits of the base system to install, you can use wildcards. For example, to deselect all the X Window bit, enter <code>-X*</code>, or <code>+X*</code> to select it all.</p>

<p>The installation process is short, about ten minutes in all. There's little time cost in restarting it if we screw it up.</p>

<h2>The boot loader</h2>

<p>The boot loader waits a few seconds before loading the kernel. Hit the space bar to stay at the boot loader prompt. The boot loader has a <code>help</code> command. If you want to resume normal booting, enter the <code>boot</code> command.</p>

<p>To boot into single-user mode, enter <code>boot -s</code>. To do anything useful, we'll want to mount one or more filesystems. But first, if we have any reason to believe the filesystem may not be clean (e.g. the system crashed), run <code>fsck -p</code> to check and make any very minor repairs on any filesystems listed in fstab. Run <code>mount -a </code> to mount any filesystems listed in fstab which are not already mounted.</p>

<p>To start the network in single-user mode, run <code>sh /etc/netstart</code>.</p>

<p>It's possible to boot alternate kernels (e.g. <code>boot /bsd.rd</code>), or boot from other disks.</p>

<h2>UPDATES</h2>

OpenBSD 6.1 introduced `syspatch`, and official binary patch system for core.
This eliminates the need for third-party `openup`.

	$ doas syspatch

To update non-core binary packages:

	$ doas pkg_add -Uu

- http://man.openbsd.org/syspatch
- http://man.openbsd.org/pkg_add

<h2>References</h2>

<ul>
<li><a href="http://www.openbsd.org/faq/index.html">OpenBSD FAQ</a></li>
<li><a href="http://www.undeadly.org/">OpenBSD Journal (Undeadly)</a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
</ul>

<?php include('../FOOTER.php'); ?>
