LiveUSB with OpenBSD - Installing LiveUSB to disk

feature-image

Intro

The purpose of this project is to give you a bootable OpenBSD instance.

Something that is persistent on a USB disk or pendrive. Hence portable.

You can carry that with you wherever you go.

To help you launch into the exciting world of OpenBSD all you need to figure out is if you are making the leap from Linux, Mac or Windows.

Hopefully this document will help you get there and taste OpenBSD first hand for first time ever.


Installing LiveUSB to a USB stick on UNIX/Linux or Mac OS

Please be aware that your USB stick could be sd0 .. sdn depending upon in what order you insert into your computer 💻

Please check with dmesg boot messages and find out whether your USB stick is identified as sdb or sdc or whatever else.

This is crucial.

If you get this wrong, then you could end up damaging or overwriting in the wrong place. 😟

Please ensure the brand name and size match.

You can burn/flash the LiveUSB XFCE image to a USB stick with this command on Linux or Mac.

   root# dd if=LiveUSB-XFCE.img of=/dev/sdb bs=1m status=progress

Tip

If you downloaded the Gnome or Minimal flavor instead then please replace the file name above.

The first argument to dd is the image file name. The second is the target medium, the path to the USB device.

THE ABOVE COMMAND WILL WIPE EVERYTHING IN USB STICK SO BEWARE!!!

Note that there is no need to mount, create a file system or any such thing.

Once you write the image you can test the USB stick without rebooting the computer with this qemu command on Linux.

   root# qemu-system-x86_64 -usb -hda /dev/sdb

The sdb device is only for example purposes. Yours will be different.

Reboot and enjoy LiveUSB.


Linux/MacOS installation instructions [dd method]

In Linux dd aka disk dump would do to flash the image

Please be aware that your USB stick could be sd0 .. sdn depending upon in what order you insert into your computer.

There are several USB enumeration programs on Linux these days. Even some graphical ones.

This procedure will take several minutes depending upon the speed of the bus and the medium.

Once you write the image you can test the USB stick without rebooting the computer with qemu.

That will ensure that the boot signature is recognized by the BIOS once you reboot.

Once you find that things work fine you can reboot and enjoy LiveUSB.

You can do something similar to Linux on Microsoft Windows too.


Microsoft Windows installation instructions

There is rufus , Windd and many more.

In fact you could install MingW or Cygwin in Windows and use plain dd itself.

How is it created? Why does it work this way?

LiveUSB works by way of a process called OS ghosting.

No need to create file system or prepare the USB stick, dd(1) copies the entire OS image through ghosting.

So dd is all you need.

This creates the boot loader, the BSD file system and sets up the

  • OS kernel
  • userland
  • packages

et al. automagically.

If you are too lazy to burn it into a USB stick you could run this off a qemu emulator on Linux.

   root# qemu-system-x86_64 -hda LiveUSB-XFCE.img

You can use VMware player or Virtualbox emulator or any other emulator in lieu of qemu before rebooting to test the medium.

Please go to BIOS and change boot order to boot from USB pendrive and not hard disk of your laptop.

Most modern laptops have a boot sequence that looks for a boot signature on the removable media.

So you may not need to go to the BIOS to change boot order after flashing.

If your bootup sequence is setup to boot from USB medium first then the BIOS change is not needed of course.

Steps before installing

It is vital that you download the flavor of choice,

  • Minimal
  • Gnome
  • XFCE

and unzip it first.

The program to unzip is Winzip on Windows or unzstd on Linux/Mac.

You can optionally test the checksum and size to ensure integrity of download.

Once you are done downloading and unzipping you can proceed to flash using dd .

With a little bit of elbow grease and common sense you succeed.

🌈