open bsd flash drive boot

17 Jul

Many thanks to Toby Weingartner for the help. The answer (once handed
to me on a silver platter) was dreadfully simple. Boot off a floppy,
and do “machine disk” at the boot prompt. Compare the results with and
without the drive attached. In my case the difference was just one line

with pen drive
==============
disk: fd0 fd1 hd0+ hd1+*
>> OpenBSD/i386 BOOT 2.01
boot> machine disk
Disk BIOS# Type Cyls Heads Secs Flags Checksum
fd0 0x0 floppy 80 2 18 0x2 0x0
fd1 0x1 *none* 80 2 18 0x4 0x0
hd0 0x80 SCSI 63 255 63 0x2 0x8554854f
hd1 0x81 unknown 1022 240 63 0x0 0x34b5ae57

without pen drive
=================
disk: fd0 fd1 hd0+*
>> OpenBSD/i386 BOOT 2.01
boot> machine disk
Disk BIOS# Type Cyls Heads Secs Flags Checksum
fd0 0x0 floppy 80 2 18 0x2 0x0
fd1 0x1 *none* 80 2 18 0x4 0x0
hd0 0x80 unknown 1022 240 63 0x0 0x34b5ae57

Thus, you’d say something like “fdisk -c 63 -h 255 -c 63 -i sd0” and
“/usr/mdec/installboot -h 255 -c 63 -v /mnt/boot /usr/mdec/biosboot sd0”

So now I have a shiny happy usb flash disk I can use to patch up bootblocks,
keep crypto keys on, etc. Thanks Toby!