aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorla-ninpre <leobrekalini@gmail.com>2021-11-03 15:41:16 +0300
committerla-ninpre <leobrekalini@gmail.com>2021-11-03 15:41:16 +0300
commitf94f460b5fbd1979af12e0247f318a0ae1964b78 (patch)
tree02d24b6f432b0b80a1730b59ea7762c8232247f0
parentdd37dc8dc09733a78a4166529cb1fc387108fe87 (diff)
downloadaaoth.xyz-f94f460b5fbd1979af12e0247f318a0ae1964b78.tar.gz
aaoth.xyz-f94f460b5fbd1979af12e0247f318a0ae1964b78.zip
add new post
-rw-r--r--_posts/2021-11-03-dualboot-linux-and-openbsd-with-grub.md70
-rw-r--r--tags/grub.md6
-rw-r--r--tags/linux.md6
3 files changed, 82 insertions, 0 deletions
diff --git a/_posts/2021-11-03-dualboot-linux-and-openbsd-with-grub.md b/_posts/2021-11-03-dualboot-linux-and-openbsd-with-grub.md
new file mode 100644
index 0000000..bc24e2f
--- /dev/null
+++ b/_posts/2021-11-03-dualboot-linux-and-openbsd-with-grub.md
@@ -0,0 +1,70 @@
+---
+title: dualboot linux and openbsd with grub
+date: 2021-11-03T15:23:00+03:00
+author: la-ninpre
+tags: openbsd linux grub tutorial
+---
+
+i've been trying to dualboot openbsd with linux using grub on both bios and
+uefi machines and here's a solution that i've come up with.
+
+<!--more-->
+
+there are some guides about this on the internet, but there's no single guide
+that covers both bios and uefi. @rootbsd has a video where he shows how to
+do this, but his solution has one little disadvantage. he's specifying drives
+in a grub config using relative drive and partition numbers, such as
+`(hd0,gpt2)`. since these numbers could be different if one inserts a new drive
+to the computer, or changes drive order, the boot option could fail
+(which happened).
+
+all partitions and drives have their unique identifier -- uuid. there's no
+direct way to specify uuid in grub configuration, but there is a workaround.
+
+grub manual describes the `search` command which has an option to set root
+device if it is found. so we can use it for our purposes.
+
+## steps for dualbooting in bios/legacy mode
+
+1. install linux system on one of your drives
+
+2. reboot and boot from openbsd install media and install openbsd to other drive
+or partition.
+
+3. reboot and login to your linux system
+
+4. open a terminal and run `blkid` or `lsblk -f` to get an output partition
+uuids.
+
+5. write the following at the bottom of `/etc/grub.d/40_custom`:
+
+ ```
+ menuentry 'OpenBSD' {
+ search -su --no-floppy *UUID*
+ chainloader +1
+ }
+ ```
+
+ where *UUID* is the uuid of your openbsd partition (with type 'ufs2')
+
+6. run either `update-grub` or `grub-mkconfig` depending on what distribution
+you are using. consult your distro's wiki to find a way to update your grub
+configuration with recent changes.
+
+7. now reboot and you should see an openbsd's boot option in grub menu.
+
+## steps for uefi system
+
+for boot in uefi mode there are few differences. after installing openbsd
+don't reboot, but choose **shell**. now cd into `/mnt` directory and
+download `BOOTX64.EFI` from your desired openbsd mirror. for example:
+ ```
+ # cd /mnt
+ # ftp https://cdn.openbsd.org/pub/OpenBSD/7.0/amd64/BOOTX64.EFI
+ # reboot
+ ```
+
+after that the only other difference is that `chainloader` directive should
+be `chainloader /BOOTX64.EFI`.
+
+all other steps are the same.
diff --git a/tags/grub.md b/tags/grub.md
new file mode 100644
index 0000000..90b72eb
--- /dev/null
+++ b/tags/grub.md
@@ -0,0 +1,6 @@
+---
+layout: tagsort
+tag: grub
+title: "tags: grub"
+permalink: /tags/grub/
+---
diff --git a/tags/linux.md b/tags/linux.md
new file mode 100644
index 0000000..9500b5a
--- /dev/null
+++ b/tags/linux.md
@@ -0,0 +1,6 @@
+---
+layout: tagsort
+tag: linux
+title: "tags: linux"
+permalink: /tags/linux/
+---