how to create a liveusb version of openbsd

this method requires the use of qemu on an existing unix/linux box.

for this example, we’ll assume:

  1. the qemu box is linux

  2. the usb stick is /dev/sdc

  3. the current openbsd version is 5.2

  4. we have a 64 bit standard PC architecture

steps:

  1. download the openbsd iso from http://openbsd.org/ or one of its mirrors:

    curl https://ftp3.usa.openbsd.org/pub/OpenBSD/5.2/amd64/install52.iso >install52.iso
  2. plug in usb stick, and determine its size. as root:

    dmesg|tail       # should say something like: *sdb*, *sdc*, etc.
    fdisk /dev/sdc   # note the line that gives the size:
    ...
      Disk /dev/sdc: 4004 MB, 4004511744 bytes
  3. create qemu disk of same size:

    qemu-img create obsdusb.img  4004511744
  4. run qemu to install from the downloaded .iso to the image:

    qemu-system-i386 -hda obsdusb.img -cdrom install52.iso
  5. copy to the usb:

    dd if=obsdusb.img of=/dev/sdc bs=512