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)
By jcp (217.110.62.222) on
By sthen (2001:8b0:648e:cc01:f2de:f1ff:fef9:a752) on
I wish I'd thought of this when the call for gsoc projects went out :)
By grazzolini (177.220.181.200) on
Comments
By Chris Cappuccio (chriscappuccio) on http://www.nmedia.net/chris/
One nice thing about using the official install.iso is that you get full signed image verification.
By Travis Paul (173.165.20.18) on
By Breen Ouellette (207.47.253.253) on www.breeno.net
http://blog.breeno.net/2014/02/creating-flexible-openbsd-usb-installer.html
-Breeno
By Darren Tucker (67.244.100.93) on
will create the equivalent (mostly) sparse file and will be much quicker/