💾 Archived View for aaoth.xyz › rss.xml captured on 2023-01-29 at 02:17:20.

View Raw

More Information

⬅️ Previous capture (2022-04-28)

➡️ Next capture (2023-03-20)

🚧 View Differences

-=-=-=-=-=-=-

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<atom:link href="/rss.xml" rel="self" type="application/rss+xml" />
<title>aaoth.xyz - feed</title>
<description>various notes about things.</description>
<link>/rss.xml/</link>
<lastBuildDate>Wed, 21 Dec 2022 00:00:00 +0100</lastBuildDate>

<item>
<guid>/2021-11-03-dualboot-linux-and-openbsd-with-grub.html</guid>
<link>/2021-11-03-dualboot-linux-and-openbsd-with-grub.html</link>
<pubDate>Wed, 03 Nov 2021 00:00:00 +0100</pubDate>
<title>dualboot linux and openbsd with grub</title>
<description><![CDATA[

<h1 id="dualboot-linux-and-openbsd-with-grub">dualboot linux and openbsd with grub</h1>

<pre><code class="language-data">
date: 2021-11-03
author: la-ninpre
tags: openbsd, linux, grub, tutorial
</code></pre>

<p>i&#8217;ve been trying to dualboot openbsd with linux using grub on both bios and
uefi machines and here&#8217;s a solution that i&#8217;ve come up with.</p>

<!--more-->

<p>there are some guides about this on the internet, but there&#8217;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&#8217;s specifying drives
in a grub config using relative drive and partition numbers, such as
<code>(hd0,gpt2)</code>. 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).</p>

<p>all partitions and drives have their unique identifier &#8211; uuid. there&#8217;s no
direct way to specify uuid in grub configuration, but there is a workaround.</p>

<p>grub manual describes the <code>search</code> command which has an option to set root
device if it is found. so we can use it for our purposes.</p>

<h2 id="steps-for-dualbooting-in-bioslegacy-mode">steps for dualbooting in bios&#47;legacy mode</h2>

<ol>
<li><p>install linux system on one of your drives</p></li>
<li><p>reboot and boot from openbsd install media and install openbsd to other drive
or partition.</p></li>
<li><p>reboot and login to your linux system</p></li>
<li><p>open a terminal and run <code>blkid</code> or <code>lsblk -f</code> to get an output partition
uuids.</p></li>
<li><p>write the following at the bottom of <code>&#47;etc&#47;grub.d&#47;40_custom</code>:</p>

<pre><code class="language-grub.cfg">
menuentry &#39;OpenBSD&#39; {
  search -su --no-floppy *UUID*
  chainloader +1
}
</code></pre>

<p>where <em>UUID</em> is the uuid of your openbsd partition (with type &#8216;ufs2&#8217;)</p></li>
<li><p>run either <code>update-grub</code> or <code>grub-mkconfig</code> depending on what distribution
you are using. consult your distro&#8217;s wiki to find a way to update your grub
configuration with recent changes.</p></li>
<li><p>now reboot and you should see an openbsd&#8217;s boot option in grub menu.</p></li>
</ol>

<h2 id="steps-for-uefi-system">steps for uefi system</h2>

<p>for boot in uefi mode there are few differences. after installing openbsd
don&#8217;t reboot, but choose <strong>shell</strong>. now cd into <code>&#47;mnt</code> directory and
download <code>BOOTX64.EFI</code> from your desired openbsd mirror. for example:</p>

<pre><code class="language-sh">
# cd &#47;mnt
# ftp https:&#47;&#47;cdn.openbsd.org&#47;pub&#47;OpenBSD&#47;7.0&#47;amd64&#47;BOOTX64.EFI
# reboot
</code></pre>

<p>after that the only other difference is that <code>chainloader</code> directive should
be <code>chainloader &#47;BOOTX64.EFI</code>.</p>

<p>all other steps are the same.</p>

]]></description>
</item>
</channel></rss>