Contributed by phessler on from the installs in a flash, baby! dept.
Luke Tymowski said on Twitter that if you search the Google for instructions on how to create a bootable USB flash OpenBSD installer, you get lots of conflicting instructions. So I thought I'd set the record straight, at least for i386/amd64. It's easy if you already have OpenBSD installed.
1. Download install55.iso from http://ftp.openbsd.org/pub/OpenBSD/snapshots/amd64/ and mount the ISO as a disk:
vnconfig vnd0 install55.iso mount /dev/vnd0a /mnt
2. Setup your new disk image. Right now the amd64 install55.iso is almost 250MB, so we'll make our disk.img 250MB. (This is the simplest way, although perhaps not the most efficient as you have to write 250MB of zeros!)
dd if=/dev/zero of=disk.img bs=1m count=250 vnconfig vnd1 disk.img fdisk -i vnd1 echo "a\n\n\n\n\nw\nq\n" | disklabel -E vnd1 newfs /dev/rvnd1a mkdir /mnt2 mount /dev/vnd1a /mnt2
3. Copy the installer. Ready? Go.
cp -r /mnt/* /mnt2/
4. Make it bootable!
Host OpenBSD 5.5-beta or later:
installboot -r /mnt2 vnd1 /usr/mdec/biosboot /usr/mdec/boot
Host OpenBSD 5.4 or earlier:
cp /usr/mdec/boot /mnt2/boot /usr/mdec/installboot /mnt2/boot /usr/mdec/biosboot vnd1
5. Clean up
umount /mnt umount /mnt2 vnconfig -u vnd1 vnconfig -u vnd0
Go ahead and use disk.img! You are now a ninja USB image creator.
You might ask, how do some systems create a single ISO image that works on CD/DVD and on USB/disk? They use mkhybrid/mkisofs to create a hybrid ISO+MBR+partition image booting with isolinux boot blocks. How to do something like this under OpenBSD? That's a future story.
(Comments are closed)