💾 Archived View for aaoth.xyz › rss.xml captured on 2023-01-29 at 02:17:20.
⬅️ Previous capture (2022-04-28)
-=-=-=-=-=-=-
<?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’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.</p> <!--more--> <p>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 <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 – uuid. there’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/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>/etc/grub.d/40_custom</code>:</p> <pre><code class="language-grub.cfg"> menuentry 'OpenBSD' { search -su --no-floppy *UUID* chainloader +1 } </code></pre> <p>where <em>UUID</em> is the uuid of your openbsd partition (with type ‘ufs2’)</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’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’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’t reboot, but choose <strong>shell</strong>. now cd into <code>/mnt</code> directory and download <code>BOOTX64.EFI</code> from your desired openbsd mirror. for example:</p> <pre><code class="language-sh"> # cd /mnt # ftp https://cdn.openbsd.org/pub/OpenBSD/7.0/amd64/BOOTX64.EFI # reboot </code></pre> <p>after that the only other difference is that <code>chainloader</code> directive should be <code>chainloader /BOOTX64.EFI</code>.</p> <p>all other steps are the same.</p> ]]></description> </item> </channel></rss>