Openbsd dualbooting

I'm fairly new to OpenBSD and am kind of a distrohopper so to speak. I really like OpenBSD but my one issue is that I can't find a better way to install then running a liveinstall of arch, creating an OpenBSD type partition, running OpenBSD install, and then installing to that partition. Is there a better way of doing this? I'm not familiar with fdisk and drive hardware enough to be able to use OpenBSDs implementation of fdisk in which you must create a partition based on blocks.

Posted Jan 7, 2020, 2:36 AM UTC

47
Kernigh•

There's an fdisk(8) manual: https://man.openbsd.org/fdisk

It is easy to change a partition type (use setpid), but hard to add partitions. This is because OpenBSD uses only one MBR or GPT partition, so there is no easy way to add more. If you want multiple operating systems to share this disk, I would install another OS first, and use the other OS to add an MBR or GPT partition for OpenBSD. If this partition has the wrong type, then OpenBSD fdisk(8) can change the type to OpenBSD.

If you install OpenBSD first, then reinit mbr or reinit gpt the disk, then shrink the OpenBSD partition. Use edit, keep the offset, set the size like 50g for 50 gigabytes, and let fdisk(8) calculate the number of blocks in that many gigs. Then use swap to move the OpenBSD partition to a higher slot.

If you need to add a partition in OpenBSD fdisk(8), then calculate its new offset = last offset + last size. For example, if the last partition had offset 1024 size 104857600, then your new offset is 1024 + 104857600 = 104858624. The new size might be 50g if you have that much room, or * to use the rest of the disk. If you need to add an extended MBR partition, you must manually create the chain of nested MBRs.

3
linboyadminOP•

Thanks for the fdisk manpage. I knew where it was in actual openbsd but it's pretty annoying to read the manpages in shell when ur not in a terminal emulator IMO. Also thanks for the explanation about blocks.

2
2kittens•

The best way is to read the FAQ: Installation Guide and the section Disk Setup. Or use a separate disk just for OpenBSD. Or use a VM.

1
w-a-t-t•

deleted ^^^^^^^^^^^^^^^^0.1546 ^^^What ^^^is ^^^this?

1
w-a-t-t•

deleted ^^^^^^^^^^^^^^^^0.2103 ^^^What ^^^is ^^^this?

2
Art10001•

Use /dev/rdisk, not /dev/disk. rdisk is far faster because it is writing to the raw device instead of passing through a 4K IO filter.

1
linboyadminOP•

Yes I know I have read FAQs I was just wondering if I missed something, or if theirs some great partition manager for OpenBSD that I'm not using

1