Frank Groeneveld's blog

Remote Installation of OpenBSD From Linux

Using a trick documented here, I switched this server from Linux to OpenBSD, without a support installation method for OpenBSD from my ISP. In the original article, the author created a VM disk image and installed OpenBSD in it. The server was then rebooted into rescue mode (from a LiveCD) and the VM was uploaded and written to disk using dd. I modified the documented method a bit to speed up the process.

First I resized the Linux partition and added a new EXT2 partition at the end of the disk. EXT2 can be read and written from OpenBSD, this might be useful later. I created a small Linux installation with Qemu on that new partition. Next I installed Grub and configured it to use only the new partition. After a reboot in the new installation I booted Qemu with the old partition as its main disk, an OpenBSD installation ISO as its CD device and an ethernet card that uses the same driver (to avoid problems where hostname.if would be configured for the virtual card). Installation was just as simple when using a normal method. When the installation finished, I configured Grub to boot from the OpenBSD partition again and luckily had a succesfully booting system.

The biggest help for this process is the ability to remotely switch to a PXE booted kernel or rescue LiveCD. My ISP, OVH, has this and I now always have the ability to boot the Linux partition in case of emergency by switching to PXE boot and setting the Linux partition as root device.

For OVH it is also mandatory to set your IPv6 prefixlen to 56 instead of the default 64. Not doing so will result in problems when trying to reach their gateway.