OpenBSD FAQ - Installation Guide [FAQ Index]

Overview of the installation procedure

OpenBSD has long been respected for its simple and straightforward installation process, which is very consistent across all platforms. You are urged to read the platform-specific INSTALL document in the on the CD-ROM or mirror sites. For example, i386/INSTALL.i386 or sparc/INSTALL.sparc. The OpenBSD installer is a special kernel available on: Not every platform supports all boot options: All platforms can use bsd.rd to reinstall or upgrade.

Once the install kernel is booted, you have several options of where to get the install file sets. Again, not every platform supports every option.

Pre-installation checklist

Before you start, you should have some idea what you want to end up with. You will want to know the following items, at least:

Creating bootable OpenBSD install media

Before creating install media, verify the signatures on your downloads. Consult INSTALL.<plat> if the instructions below are insufficient for your needs.

As an example, these are the installation images available for the i386 platform:

Flash drives

A bootable USB flash drive can be created by attaching the target device and copying over the image with dd(1).

Using OpenBSD, assuming the device was recognized as sd6:

# dd if=/location/install*.fs of=/dev/rsd6c bs=1m
Details of this will vary on other platforms. Note that the raw I/O device is used in its entirety: rsd6c. In some Linux variants, the entire seventh sd disk would be /dev/sdg.


You can create a CD-ROM using the cdXX.iso or installXX.iso files. In OpenBSD, use cdio(1):
# cdio tao cd*.iso


Creating floppies in OpenBSD can be done with fdformat(1) to prep the disk, dd(1) to write the image, then cmp(1) to verify the write was good. A similar process can be used on other Unix platforms.

Booting OpenBSD install media

Booting i386/amd64

Booting install media on the i386 and amd64 PC platforms is nothing new to most people. Your system will have to be instructed to boot from whatever media you have chosen to use, usually through a BIOS setup option. If you want to boot from CD or a USB device, your system BIOS must be able to do so. Some machines are buggy with regard to booting from USB devices; a BIOS update may help.

You can also install by booting bsd.rd from an existing OpenBSD partition, or over the network using the PXE boot process.

Booting sparc/sparc64

NOTE: On the sparc64 platform, only the SBus machines (Ultra 1, Ultra 2) are bootable from floppy.

You will need the system to be at a monitor ROM prompt, which typically looks like ok. If you are using a Sun keyboard, press and hold STOP while tapping A. If using a serial console, a BREAK should return you to the monitor prompt.

Use the following commands to boot from a floppy or a CD-ROM:

ok boot floppy
ok boot cdrom

Performing a simple install

The installer is designed to install OpenBSD in a very usable default configuration with a minimum of user intervention. In fact, you can often just hit <Enter> to get a good OpenBSD install, moving your hands to the rest of the keyboard only to enter the root password and to reboot at the end.

The installer will create a partitioning plan based on the size of your hard disk. While this will not be a perfect layout for all people, it provides a good starting point for figuring out what you need.

Installation notes for each platform are on the install CDs and the mirrors, in the file INSTALL.<plat>, where <plat> is your platform, for instance, i386. Read it.

Whatever your means of booting is, it is now time to use it. When your boot is successful, you will see a lot of text messages scroll by. This text is the dmesg(8), the kernel telling you what devices have been found and how they are hooked to other devices.

After the dmesg(8), you will see the first installer question:

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

Welcome to the OpenBSD/i386 X.X installation program.
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell?
Choose (I)nstall and follow the instructions.

What files are needed for installation?

The complete OpenBSD installation is broken up into a number of file sets. New users are recommended to install all of them.

Why do I have to install X for my non-graphical application?

Some libraries from xbaseXX.tgz, like freetype or fontconfig, can be used outside of X by programs that manipulate text or graphics. Such programs will usually need fonts, either from xfontXX.tgz or font packages. For the sake of simplicity, the developers decided against maintaining a minimal xbaseXX.tgz set that would allow most non-X ports to run.

The xservXX.tgz set is rarely needed if you don't intend to run X.

I don't want to install the compilers

Ok, don't, but please don't tell yourself this is for security reasons. By the time someone is far enough into your system that the presence or absence of the compiler matters, they are far enough in they can install a compiler themselves. However, the compXX.tgz file set is relatively big and has a lot of files in it, so it can take a while to install and upgrade. On slow or small systems, this can matter.

How should I partition my disk?

OpenBSD can be installed in as little as 512MB, but using that small of a device is something for advanced users. Until you have some experience, 8GB or more disk space is recommended.

Unlike many other OSs, OpenBSD encourages users to partition their disk into a number of partitions, rather than having just one or two big partitions. Some of the reasons for doing so are:

Read the section on automatic disc allocation in the disklabel(8) manpage and hier(7) before making decisions about custom partitioning schemes.

Additional thoughts on partitioning

Sending your dmesg after the install

A quote from /usr/src/etc/root/root.mail:
If you wish to ensure that OpenBSD runs better on your machines, please do us
a favor (after you have your mail system configured!) and type something like:

# (dmesg; sysctl hw.sensors) | \
   mail -s "Sony VAIO 505R laptop, apm works OK"

so that we can see what kinds of configurations people are running.  As shown,
including a bit of information about your machine in the subject or the body
can help us even further.  We will use this information to improve device driver
support in future releases.  (Please do this using the supplied GENERIC kernel,
not for a custom compiled kernel, unless you're unable to boot the GENERIC
kernel.  If you have a multi-processor machine, dmesg results of both GENERIC.MP
and GENERIC kernels are appreciated.)  The device driver information we get from
this helps us fix existing drivers. Thank you!
Alternatively, save your dmesg output to a text file
$ (dmesg; sysctl hw.sensors) > ~/dmesg.txt
and transfer this file to the system you normally use for email. Since the dmesg output you send in is processed automatically, be sure to check the following:

Adding a file set after install

If you chose to skip some file sets at install time, you might realize later that you really do need them after all.

Simply boot bsd.rd from your root file system. Choose (U)pgrade. When you get to the list of file sets, select the ones you need.

What is bsd.rd?

The bsd.rd RAM disk kernel is a live OpenBSD environment that runs entirely in memory. It contains the install script and a small number of utilities needed to perform a complete installation. These utilities can also be useful for disaster recovery. The installation media automatically boots into bsd.rd and starts the install script for you.

If you have a running OpenBSD system, bsd.rd is all you need to reinstall or upgrade to a newer version of OpenBSD without the need for any removable media. To do so, simply download and verify bsd.rd, place it on an existing filesystem and boot from it.

Booting from bsd.rd on an i386 system:

Using Drive: 0 Partition: 3
reading boot.....
probing: pc0 com0 com1 apm mem[639k 255M a20=on]
disk: fd0 hd0+
>> OpenBSD/i386 BOOT 3.26
boot> boot hd0a:/bsd.rd
The general method of booting bsd.rd is to change your boot kernel from /bsd to /bsd.rd through whatever means used on your platform.

Common installation problems

Problems with signatures

Customizing the install process

The siteXX.tgz file set

The OpenBSD install and upgrade scripts allow the selection of a user-created set called siteXX.tgz, where XX is the release version. Like the official file sets, this is a tar(1) archive rooted in / and untarred with the -xzphf options. It is installed last, so it can be used to complement and modify the files from a default install. Furthermore, it is possible to use hostname(1)-dependent sets named siteXX-$(hostname -s).tgz.

Note: If you intend to provide installation sets over HTTP, place siteXX.tgz in your source directory and include it in your index.txt. It will then be an option at install time.

The and scripts

If the siteXX.tgz file set contains an executable file /, the installer runs it with chroot(8) based at the freshly installed system's root. Similarly, the upgrade script runs / The latter can be placed in the system's root before rebooting for the upgrade.

Example usages:

Multibooting OpenBSD

Multibooting is having several operating systems on one computer, and some means of selecting which OS is to boot. It is not a trivial task! If you don't understand what you are doing, you may end up deleting large amounts of data from your computer.

New OpenBSD users are strongly encouraged to start with a blank hard drive on a dedicated machine.

More information is in the FAQ section on the OpenBSD boot process. An example showing how to use the installer to set up a custom fdisk(8) configuration for dual booting with Windows is in the next section.

Preferably use one of the four primary MBR partitions for booting OpenBSD. Extended partitions may not work.

Here are several ways you might configure multibooting:

Boot loaders

Some boot loaders OpenBSD users have used successfully include rEFInd and GRUB as well as the two dormant projects GAG and the Ranish Partition Manager.

Setting active partitions

Set the active partition in whatever OS you are currently using to be the one you want to boot by default when you next boot. Virtually every OS offers a program to do this. OpenBSD's is fdisk(8), and similarly named programs are in many other operating systems. See also the FAQ section on using OpenBSD's fdisk(8).

Bootable flash drive

Make a bootable flash drive. On that drive create an /etc/boot.conf file with the contents:
   boot hd0a:/bsd
This line instructs boot(8) to load the system from hard drive 0, disklabel(8) partition a and run the kernel file /bsd.

Configure your system to boot from the other OS by default. Booting from the flash drive will load OpenBSD.

Windows Vista and Windows 7

With Vista, Microsoft dropped NTLDR support in favor of their newer Boot Configuration Data (BCD) store used for controlling the boot environment. Microsoft has enhanced BCD since releasing Vista to allow multiple versions of Windows to be booted through bcdedit. For those who find manual configuration daunting, EasyBCD provides a GUI alternative.

Once OpenBSD's PBR is copied to the Windows system partition, issue the following command to initialize the needed registry hive. Use a shell with administrative privileges. Right click on cmd.exe and select "run as administrator".

C:\Windows\system32> bcdedit /create /d "OpenBSD/i386" /application bootsector
The entry {0154a872-3d41-11de-bd67-a7060316bbb1} was successfully created.
The {0154a872-3d41-11de-bd67-a7060316bbb1} GUID is system-dependent. Note the value you receive when executing, and copy it into the following commands:
C:\Windows\system32> bcdedit /set {0154a872-3d41-11de-bd67-a7060316bbb1} device boot
The operation completed successfully.

C:\Windows\system32> bcdedit /set {0154a872-3d41-11de-bd67-a7060316bbb1} path \openbsd.pbr
The operation completed successfully.
Windows Vista users are done at this point. For Windows 7, finish up with:
C:\Windows\system32> bcdedit /set {0154a872-3d41-11de-bd67-a7060316bbb1} device partition=c:
The operation completed successfully.

C:\Windows\system32> bcdedit /displayorder {0154a872-3d41-11de-bd67-7060316bbb1} /addlast
The operation completed successfully.
For more information, consult bcdedit's help by issuing:
C:\Windows\system32> bcdedit /?
or by searching Microsoft's documentation and Website. A good introduction can be found in this TechNet Frequently Asked Questions article.

Time zone issues

OpenBSD expects the computer's real-time clock to be set to Universal Coordinated Time. Some other operating systems expect the real-time clock to be set to local time. See FAQ 8 - Why is my clock off by several hours?

A custom fdisk(8) layout for dual booting

Before working with any system that has data you don't wish to lose, make sure you have a good backup. If you are adding OpenBSD to an existing system, you will probably need to create some free space before installing OpenBSD. In addition to your existing system's native tools, gparted may be useful for deleting or resizing existing partitions.

A brief introduction to fdisk(8) is in the section on using OpenBSD's fdisk(8).

In this example, we will assume we are starting with a blank 40GB disk and wish to create a multiboot system, reserving 5GB at the beginning of the disk for Windows, and the rest for OpenBSD. The process is very much the same for working around an existing partition, you just need to skip over the parts where we create the Windows partition and worry about installing the MBR boot code.

Available disks are: wd0.
Which one is the root disk? (or 'done') [wd0] <Enter>
MBR has invalid signature; not showing it.
Use (W)hole disk or (E)dit the MBR? [whole] e

You will now create a single MBR partition to contain your OpenBSD data. This
partition must have an id of 'A6'; must *NOT* overlap other partitions; and
must be marked as the only active partition.  Inside the fdisk command, the
'manual' command describes all the fdisk commands in detail.

Disk: wd0       geometry: 4998/255/63 [80293248 Sectors]
Offset: 0       Signature: 0x0
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
 0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 3: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
Enter 'help' for information
fdisk: 1>
In the fdisk: 1> prompt, the number 1 indicates the first level of partition tables. If you were editing an extended partition, it would be 2 or higher.

First, we will make partition 0 a 5GB Windows partition using NTFS. Partition 1 will be our OpenBSD partition using the rest of the disk.

fdisk: 1> edit 0
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
 0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
Partition id ('0' to disable)  [0 - FF]: [0] (? for help) 7
NTFS has partition id 7 and OpenBSD partition id a6. Consult the help prompt for a full list.
Do you wish to edit in CHS mode? [n] <Enter>
offset: [0] 64
The fdisk platforms need a gap before the first partition. The exact amount will not matter on modern machines, OpenBSD defaults to 64 sectors.
size: [0] 5g
Rounding to nearest cylinder: 10490381
The size is measured in sectors (512 bytes), or the desired capacity when followed by a k, m, g or t.

We've now created our Windows partition. Note that this partition is just reserved space on the disk, it isn't formatted.

Now we create our OpenBSD partition. Note that the prompt now includes an *, this means there are unsaved changes.

fdisk:*1> e 1
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
Partition id ('0' to disable)  [0 - FF]: [0] (? for help) a6
Do you wish to edit in CHS mode? [n] <Enter>
offset: [0] 10490445
size: [0] *
The offset we chose is the offset of the previous partition plus the size of the partition, in this case, 64+10490381 = 10490445. Entering * for size means: use the rest of the disk.

This disk is not yet bootable. As it was a brand new disk, the disk's MBR is completely blank. We install MBR bootcode using the update command and flag the OpenBSD partition as the bootable partition.

fdisk:*1> update
Machine code updated.
fdisk:*1> flag 1
Partition 1 marked active.
fdisk:*1> print
Disk: wd0       geometry: 4998/255/63 [80293248 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
 0: 07      0   1   1 -    652 254  63 [          64:    10490381 ] NTFS
*1: A6    653   0   1 -   4998   5  63 [    10490445:    69802803 ] OpenBSD
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 3: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
A checklist of things you want to make sure about before you exit fdisk(8): Quit and save current changes:
fdisk:*1> quit
Writing MBR at offset 0.
To discard all unwritten changes, use exit instead.