<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>jutty.dev - zfs</title>
    <subtitle>Computer nerd memory leaks</subtitle>
    <link rel="self" type="application/atom+xml" href="https://blog.jutty.dev/tags/zfs/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://blog.jutty.dev"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2024-06-09T00:00:00+00:00</updated>
    <id>https://blog.jutty.dev/tags/zfs/atom.xml</id>
    <entry xml:lang="en">
        <title>Void on ZFS</title>
        <published>2024-06-09T00:00:00+00:00</published>
        <updated>2024-06-09T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Juno Takano
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.jutty.dev/posts/void-on-zfs/"/>
        <id>https://blog.jutty.dev/posts/void-on-zfs/</id>
        
        <content type="html" xml:base="https://blog.jutty.dev/posts/void-on-zfs/">&lt;p&gt;&lt;img src=&quot;&#x2F;assets&#x2F;img&#x2F;posts&#x2F;void-on-zfs&#x2F;desk.jpg&quot; alt=&quot;An L-shaped desk with two laptops, an external monitor, a router and a third headless computer in a tower case with several power cables connected to a power strip on top of it. Next to the power strip are two cellphones, a long red box, and a charging case for Bluetooth headphones with a red LED on. The tower case has three stickers on it: one with the machine specifications, one the FreeBSD logo, and one reading “platform feodalism (sic) is so 1492”. Scattered around the machines are some office supplies, medicine containers, a screwdriver, a notepad, a small notebook, an NVMe SSD card on top of its packaging, a mug, a water bottle and a scarf. Hanging on the wall are a small painting of a dead tree before the twilight, prayer beads, a sunflower-pattern keychain and a calendar. Between the desk and the camera, a green plastic chair has a pillow and blanket on top of it. A few wires and cardboard boxes are visible under the desk.&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;June is here. It brings the usual cold weather and some extra rhinitis complications. With that I find myself in a recovery mood Sunday, wrapped in a blanket with a mug of tea, a screwdriver, some notes on paper, a flash drive, a couple of NVMe cards and the trio of Unix-powered machines that will help me get this done.&lt;&#x2F;p&gt;
&lt;p&gt;The mission is to get a root-on-ZFS EFI installation of Void Linux with ZFSBootMenu on a Dell Latitude 7480.&lt;&#x2F;p&gt;
&lt;p&gt;To my left, a ceiling-collapse-survivor Sony VAIO is running NetBSD with spectrwm. It’s split with sakura and tmux on a terminal to one side, where Neovim is storing these words, and Firefox on the other, ready to fetch all the docs. In the middle, the object of today’s operation. And to my right, a headless PC board runs FreeBSD with ZFS, holding all the backups needed for the post-install tasks.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;assets&#x2F;img&#x2F;posts&#x2F;void-on-zfs&#x2F;duo.jpg&quot; alt=&quot;Two laptops side-by-side on a desk, each with a USB keyboard plugged in. Writing utensils inside a holder and post-its are between the two. A sunflower-patterned keychain and prayer beads hang from the wall. The computer on the left has a brown cloth for a wrist rest in front of its USB keyboard, to the left of which lies a small blue Campus notebook.&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This lengthy post, written not after the fact but during it, is my way of documenting and also sharing how it all went. Additionally, it’s a way to delve deeper into many of the things the ZFSBootMenu docs leave unexplained, an urge I already had yesterday as I just tried it out without much modification.&lt;&#x2F;p&gt;
&lt;p&gt;Last night, I ran through the &lt;a class=&quot;out-link&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;docs.zfsbootmenu.org&#x2F;en&#x2F;latest&#x2F;guides&#x2F;void-linux&#x2F;uefi.html&quot;&gt;ZFSBootMenu documentation guide for Void&lt;&#x2F;a&gt; and followed it both on a VM and then on an external SATA HDD plugged through a USB case, taking some notes and getting a general idea of the process.&lt;&#x2F;p&gt;
&lt;p&gt;The Void installer does not support ZFS out of the box, so the &lt;a class=&quot;out-link&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;docs.voidlinux.org&#x2F;&quot;&gt;Void Handbook&lt;&#x2F;a&gt; itself recommends the ZFSBootMenu documentation before &lt;a class=&quot;out-link&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;docs.voidlinux.org&#x2F;installation&#x2F;guides&#x2F;zfs.html&quot;&gt;its own&lt;&#x2F;a&gt; (a manual chroot installation) when it comes to doing a ZFS-on-root install. This guide from ZFSBootMenu is what we’ll be following throughout this post.&lt;&#x2F;p&gt;
&lt;p&gt;Do note that, while comprehensive, my account is no replacement for &lt;a class=&quot;out-link&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;docs.zfsbootmenu.org&#x2F;en&#x2F;latest&#x2F;guides&#x2F;void-linux&#x2F;uefi.html&quot;&gt;the original guide&lt;&#x2F;a&gt;. Although more concise, it contains certain notes not included in this post and covers a larger set of possibilities than I did here. Some of the code blocks you’ll see here are identical to the ones from the guide, but many others are specific to how I did things, so keep that in mind and try things before going with your final installation.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-void&quot;&gt;Why Void?
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#why-void&quot; aria-label=&quot;Anchor link for: why-void&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;I don’t really enjoy distro-hopping. I usually will spend a few years on the same OS and only switch for good reason and after some thorough testing. And after some Debian time, I felt interested in trying Void for a few reasons:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;rolling, but stable&lt;&#x2F;li&gt;
&lt;li&gt;runit init system&lt;&#x2F;li&gt;
&lt;li&gt;BSD-like rc files&lt;&#x2F;li&gt;
&lt;li&gt;BSD-like handbook documentation&lt;&#x2F;li&gt;
&lt;li&gt;numerous, up to date, but stable packages&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;After trying it, some other features made me settle:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;fast and feature-packed package manager&lt;&#x2F;li&gt;
&lt;li&gt;very fast startup time (kudos to runit)&lt;&#x2F;li&gt;
&lt;li&gt;first-class support in ZFSBootMenu&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The Void package manager, &lt;a class=&quot;out-link&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;docs.voidlinux.org&#x2F;xbps&#x2F;index.html&quot;&gt;xbps&lt;&#x2F;a&gt;, has several interesting features. One of my favorites, for a taste, is &lt;code&gt;xbps-query --cat&lt;&#x2F;code&gt;, which shows the original contents of a given file in a package.&lt;&#x2F;p&gt;
&lt;p&gt;For example, &lt;code&gt;xpbps-query --cat &#x2F;etc&#x2F;zfsbootmenu&#x2F;config.yaml zfsbootmenu&lt;&#x2F;code&gt; will show you the original content of the &lt;code&gt;config.yaml&lt;&#x2F;code&gt; file in the &lt;code&gt;zfsbootmenu&lt;&#x2F;code&gt; package. You can use it for very core packages like &lt;code&gt;base-system&lt;&#x2F;code&gt; or &lt;code&gt;runit-void&lt;&#x2F;code&gt; to determine the original version of files shipped by them.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;and-why-zfs&quot;&gt;And why ZFS?
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#and-why-zfs&quot; aria-label=&quot;Anchor link for: and-why-zfs&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;My first contact with ZFS was when using FreeBSD, which provides it as an option in its installer, making it a bit too easy not to try. Having a server on ZFS means all the data it holds can be safeguarded and transferred in robust ways, and mistakes are also easier to recover from.&lt;&#x2F;p&gt;
&lt;p&gt;Aside from all the data integrity features and flexibility it brings, the features that interest me the most are the ones for managing snapshots.&lt;&#x2F;p&gt;
&lt;p&gt;ZFS snapshots allow you to store the filesystem state at a given point in time, and to compare against, access the content of, and fully revert to this state. After the guide has been followed throughout, an extra section at the end of this post has some snapshot basics.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;getting-in&quot;&gt;Getting in
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#getting-in&quot; aria-label=&quot;Anchor link for: getting-in&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;So, first things first, open the machine up and swap the NVMe cards. For me, that means getting my 128 GB NVMe stick, which I use basically for tests, and replace it with the 256 GB one which currently has Debian on it. Yes, I get by just fine with that much.&lt;&#x2F;p&gt;
&lt;p&gt;While a bit dusty, the machine was overall in good state. The release date for the model is 2017, which for my computing standards is very recent.&lt;&#x2F;p&gt;
&lt;p&gt;It has a single NVMe slot, one 16 GB RAM stick and one unused RAM slot. If you look closely, you can notice a dent on the vent tube connecting the cooler to the CPU. Despite this, it very rarely heats up.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;assets&#x2F;img&#x2F;posts&#x2F;void-on-zfs&#x2F;karu-inside.jpg&quot; alt=&quot;The Dell laptop seen from above, lid closed, with the screen against the desk and the bottom cover removed, exposing the motherboard.&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Next up is to boot up &lt;a class=&quot;out-link&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;leahneukirchen&#x2F;hrmpf&quot;&gt;hrmpf&lt;&#x2F;a&gt; in EFI mode.&lt;&#x2F;p&gt;
&lt;p&gt;hrmpf is a Void-based rescue system maintained by a Void team member and distributed as a bootable image that can accomplish many things, some of them being a full Void installation, entering a proper chroot, and being ZFS-ready with the needed drivers and tools.&lt;&#x2F;p&gt;
&lt;p&gt;Once booted into it, EFI support can be confirmed by filtering the output of &lt;code&gt;dmesg&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;dmesg&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt; |&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; efivars&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The output should contain “Registered efivars operations”.&lt;&#x2F;p&gt;
&lt;p&gt;Make sure you have an Internet connection at this point. Most of the following steps will run fine without one, but closer to the end, when installing the Void base system, it will all go to waste if we can’t reach a package mirror.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;setting-up-the-installation-environment&quot;&gt;Setting up the installation environment
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#setting-up-the-installation-environment&quot; aria-label=&quot;Anchor link for: setting-up-the-installation-environment&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;The ZFSBootMenu guide uses some variables in order to avoid mistakes and make the instructions more portable across the different storage types and supported operating systems.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;etc-os-release&quot;&gt;&lt;code&gt;&#x2F;etc&#x2F;os-release&lt;&#x2F;code&gt;
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#etc-os-release&quot; aria-label=&quot;Anchor link for: etc-os-release&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;The &lt;code&gt;&#x2F;etc&#x2F;os-release&lt;&#x2F;code&gt; file typically contains information on the operating system you are running.&lt;&#x2F;p&gt;
&lt;p&gt;In the hrmpf live system, these are its contents:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;NAME&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;Void&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;ID&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;void&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;PRETTY_NAME&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;Void Linux&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;HOME_URL&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;https:&#x2F;&#x2F;voidlinux.org&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;DOCUMENTATION&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;https:&#x2F;&#x2F;docs.voidlinux.org&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;LOGO&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;void-logo&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;ANSI_COLOR&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;0;38;2;71;128;97&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;DISTRIB_ID&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;For comparison, here is FreeBSD’s &lt;code&gt;os-release&lt;&#x2F;code&gt; file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;NAME&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;FreeBSD&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;VERSION&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;14.0-RELEASE&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;VERSION_ID&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;14.0&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;ID&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;freebsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;ANSI_COLOR&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;0;31&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;PRETTY_NAME&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;FreeBSD 14.0-RELEASE&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;CPE_NAME&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;cpe:&#x2F;o:freebsd:freebsd:14.0&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;HOME_URL&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;https:&#x2F;&#x2F;FreeBSD.org&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;BUG_REPORT_URL&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;https:&#x2F;&#x2F;bugs.FreeBSD.org&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In contrast, NetBSD has no such file.&lt;&#x2F;p&gt;
&lt;p&gt;For the purposes of the ZFSBootMenu guide, only the &lt;code&gt;$ID&lt;&#x2F;code&gt; value appears to be used. And because the file already is structured as shell-compatible variable assignments, we just source it:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-support z-function&quot;&gt;source&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; &#x2F;etc&#x2F;os-release&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-storage&quot;&gt;export&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt; ID&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;hostid&quot;&gt;&lt;code&gt;hostid&lt;&#x2F;code&gt;
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#hostid&quot; aria-label=&quot;Anchor link for: hostid&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Required by ZFS intallations, a host ID is a 32-bit hexadecimal value that, supposedly, will uniquely identify a machine. Considering the number of existing machines and the 32-bit range, you might guess why I say &lt;em&gt;supposedly&lt;&#x2F;em&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;If your machine has the &lt;code&gt;hostid&lt;&#x2F;code&gt; utilities, you can see the host ID by simply running &lt;code&gt;hostid&lt;&#x2F;code&gt;. Prior to generation, my hrmpf live system reports &lt;code&gt;00000000&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;It can’t provide a real guarantee that it will be unique, so it’s up to you to take care that it is unique among &lt;em&gt;your&lt;&#x2F;em&gt; machines. Read on for why that’s hardly an issue.&lt;&#x2F;p&gt;
&lt;p&gt;From the &lt;code&gt;gethostid(3)&lt;&#x2F;code&gt; man page:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;[…] a unique 32-bit identifier for the current machine. The 32-bit identifier was intended to be unique among all UNIX systems in existence. This normally resembles the Internet address for the local machine, as returned by &lt;code&gt;gethostbyname(3)&lt;&#x2F;code&gt;, and thus usually never needs to be set.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;This seems to be more or less a legacy feature. In Void’s man page for &lt;code&gt;gethostid(3)&lt;&#x2F;code&gt;, you see this in the history section:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;4.2BSD; dropped in 4.4BSD. SVr4 and POSIX.1-2001 include gethostid() but not sethostid().&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Still, it is something that OpenZFS requires to be set:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;At time of import or creation, the pool stores the system’s unique host ID and for the purposes of supporting multipath, import into other systems will fail unless forced. &lt;br&#x2F;&gt;&lt;br&#x2F;&gt;
— &lt;a class=&quot;out-link&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;openzfs.readthedocs.io&#x2F;en&#x2F;latest&#x2F;introduction.html&quot;&gt;OpenZFS docs, Introduction to ZFS: Storage pools&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;&lt;code&gt;zgenhostid&lt;&#x2F;code&gt;, which is shipped by OpenZFS, according to its man page “emulates the &lt;code&gt;genhostid(1)&lt;&#x2F;code&gt; utility and is provided for use on systems which do not include the utility or do not provide the &lt;code&gt;sethostid(3)&lt;&#x2F;code&gt; function.”&lt;&#x2F;p&gt;
&lt;p&gt;When used without arguments, these commands will generate a random host ID. But they can also be passed a hexadecimal value, which gets stored by default in &lt;code&gt;&#x2F;etc&#x2F;hostid&lt;&#x2F;code&gt; unless another path is given with &lt;code&gt;-o&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Considering this information, it threw me off a bit that the ZFSBootMenu guide tells you to specify an arbitrary host ID rather than generate a random one:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zgenhostid&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric&quot;&gt; 0x00bab10c&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If they must be unique, that seems odd.&lt;&#x2F;p&gt;
&lt;p&gt;The value &lt;code&gt;0x00bab10c&lt;&#x2F;code&gt; actually has significance in the context of OpenZFS as an identifier (and leetspeak) for its uberblock. However, it apparently is totally unrelated to host IDs.&lt;&#x2F;p&gt;
&lt;p&gt;Should you be curious still, you can refer to &lt;a class=&quot;out-link&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;zbm-dev&#x2F;zfsbootmenu&#x2F;discussions&#x2F;465&quot;&gt;this GitHub discussion&lt;&#x2F;a&gt; where a ZFSBootMenu user brought this exact question to the developers.&lt;&#x2F;p&gt;
&lt;p&gt;According to the answer given above, the uniqueness of host IDs is useful for “multipathed SAS enclosures with two discrete head unis attached”, which is an enterprise-grade storage solution.&lt;&#x2F;p&gt;
&lt;p&gt;The value &lt;code&gt;0x00bab10c&lt;&#x2F;code&gt; is indeed unrelated and chosen for easy identification. Any value may be used, but when using the pre-built ZFSBootMenu images it may make the process slightly slower (around 250ms) as ZFSBootMenu will have to “discover the hostid every boot”.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;disk-variables&quot;&gt;Disk variables
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#disk-variables&quot; aria-label=&quot;Anchor link for: disk-variables&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Here too, the ZFSBootMenu guide &lt;a class=&quot;out-link&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;docs.zfsbootmenu.org&#x2F;en&#x2F;latest&#x2F;guides&#x2F;void-linux&#x2F;uefi.html#define-disk-variables&quot;&gt;works with a set of variables&lt;&#x2F;a&gt; to make it easier covering different possible storage types:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;BOOT_DISK&lt;&#x2F;code&gt;, &lt;code&gt;BOOT_PART&lt;&#x2F;code&gt; and &lt;code&gt;BOOT_DEVICE&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;POOL_DISK&lt;&#x2F;code&gt;, &lt;code&gt;POOL_PART&lt;&#x2F;code&gt; and &lt;code&gt;POOL_DEVICE&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;My target device is an NVMe at &lt;code&gt;nvme0n1&lt;&#x2F;code&gt;, so I’ll have:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;BOOT_DISK=&quot;&#x2F;dev&#x2F;nvme0n1&quot;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;BOOT_PART=&quot;1&quot;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;BOOT_DEVICE=&quot;${BOOT_DISK}p${BOOT_PART}&quot;&lt;&#x2F;code&gt;
&lt;ul&gt;
&lt;li&gt;which evaluates to &lt;code&gt;&#x2F;dev&#x2F;nvme0n1p1&lt;&#x2F;code&gt;
&lt;br&#x2F;&gt;&lt;br&#x2F;&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;POOL_DISK=&quot;&#x2F;dev&#x2F;nvme0n1&quot;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;POOL_PART=&quot;2&quot;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;POOL_DEVICE=&quot;${POOL_DISK}p${POOL_PART}&quot;&lt;&#x2F;code&gt;
&lt;ul&gt;
&lt;li&gt;which evaluates to &lt;code&gt;&#x2F;dev&#x2F;nvme0n1p2&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;While this may seem silly at first, it allows using the values separately in the next steps. It also makes the docs a lot more concise while covering several possible disk setups.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;confirming-the-environment-setup&quot;&gt;Confirming the environment setup
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#confirming-the-environment-setup&quot; aria-label=&quot;Anchor link for: confirming-the-environment-setup&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;At this point, we should be able to print something like this in our environment:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-comment&quot;&gt;# env | grep ID&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;ID&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;void&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-comment&quot;&gt;# hostid&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;00bab10c&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-comment&quot;&gt;# echo $BOOT_DEVICE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;&#x2F;dev&#x2F;nvme0n1p1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-comment&quot;&gt;# echo $POOL_DEVICE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;&#x2F;dev&#x2F;nvme0n1p2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Take care to keep this same environment for all the next steps as they depend on it. For instance, the hrmpf live system ships tmux. While that is great  and I have used it throughout, you must be careful to use a single pane for all the actual steps, and the other panes just for secondary things like looking up man pages or checking file contents.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;filesystem-setup&quot;&gt;Filesystem setup
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#filesystem-setup&quot; aria-label=&quot;Anchor link for: filesystem-setup&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;wiping&quot;&gt;Wiping
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#wiping&quot; aria-label=&quot;Anchor link for: wiping&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;The first step is to clear the current ZFS label information from the device:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zpool&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; labelclear&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;$POOL_DISK&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The &lt;code&gt;-f&lt;&#x2F;code&gt; option will “treat exported or foreign devices as inactive”, per the man page.&lt;&#x2F;p&gt;
&lt;p&gt;This step fails consistenly for me, which I assume is because the previous filesystem was not ZFS to begin with.&lt;&#x2F;p&gt;
&lt;p&gt;Next, we will use &lt;code&gt;wipefs&lt;&#x2F;code&gt; to erase the current filesystem signature.&lt;&#x2F;p&gt;
&lt;p&gt;This command is not ZFS-specific, but part of the kernel utilities. It does not erase the filesystems themselves, nor their content, but the signatures that aid in their detection.&lt;&#x2F;p&gt;
&lt;p&gt;Without any options, it will list all the filesystems that are still visible:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-comment&quot;&gt;# wipefs &amp;quot;$BOOT_DISK&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;DEVICE&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;  OFFSET          TYPE    UUID    LABEL&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;nvme0n1&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric&quot;&gt; 0x200&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;           gpt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;nvme0n1&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric&quot;&gt; 0x3d9e655e00&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;    gpt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;nvme0n1&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric&quot;&gt; 0x1fe&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;           PMBR&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The &lt;code&gt;-a&lt;&#x2F;code&gt; option is for erasing all signatures. This means it will “scan the device again after each modification until no magic string [signature] is found”, as per its man page.&lt;&#x2F;p&gt;
&lt;p&gt;In my case:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;wipefs&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -a&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;$POOL_DISK&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;wipefs&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -a&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;$BOOT_DISK&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Along the guide, commands are sometimes repeated for both &lt;code&gt;$POOL_DISK&lt;&#x2F;code&gt; and &lt;code&gt;$BOOT_DISK&lt;&#x2F;code&gt;. If you are using the same disk for both, this may be redundant, although also harmless.&lt;&#x2F;p&gt;
&lt;p&gt;This is my case, so I am not typically running it twice. I’ll still leave it as is however, so as not to mislead the reader.&lt;&#x2F;p&gt;
&lt;p&gt;Now, when listing the signatures again with &lt;code&gt;wipefs &quot;$BOOT_DISK&quot;&lt;&#x2F;code&gt;, there should be no output.&lt;&#x2F;p&gt;
&lt;p&gt;Finally, the current MBR and GPT tables must be destroyed. For this, the ZFSBootMenu guide uses &lt;code&gt;sgdisk&lt;&#x2F;code&gt;. This is also not ZFS-specific.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;sgdisk&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; --zap-all&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;$POOL_DISK&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;sgdisk&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; --zap-all&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;$BOOT_DISK&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The &lt;code&gt;--zap-all&lt;&#x2F;code&gt; option contrasts with &lt;code&gt;--zap&lt;&#x2F;code&gt; in that it will destroy both MBR and GPT partition tables.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;partitioning&quot;&gt;Partitioning
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#partitioning&quot; aria-label=&quot;Anchor link for: partitioning&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;In the ZFSBootMenu guide, &lt;code&gt;sgdisk&lt;&#x2F;code&gt; is used again for creating the partitions:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;sgdisk&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-character z-escape&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-constant z-other&quot;&gt;    -n&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;${&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;BOOT_PART&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;}:1m:+512m&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-character z-escape&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-constant z-other&quot;&gt;    -t&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;${&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;BOOT_PART&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;}:ef00&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;$BOOT_DISK&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;sgdisk&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-character z-escape&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-constant z-other&quot;&gt;    -n&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;${&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;POOL_PART&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;}:0:-10m&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-character z-escape&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-constant z-other&quot;&gt;    -t&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;${&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;POOL_PART&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;}:bf00&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;$POOL_DISK&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In the commands above, option &lt;code&gt;-n&lt;&#x2F;code&gt; is short for &lt;code&gt;--new&lt;&#x2F;code&gt;, and is specifying the start and end sectors by using relative kibibyte measures. The format is &lt;code&gt;--new partnum:start:end&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Breaking it down:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;1m&lt;&#x2F;code&gt; 1 mebibyte from the start of the disk&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;+512m&lt;&#x2F;code&gt; 512 mebibytes after the default start sector&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;-10m&lt;&#x2F;code&gt; 10 mebibytes before the last available sector&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;0&lt;&#x2F;code&gt; the default value&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;In the list above, “default” is “the start of the largest available block for the start sector and the end of the same block for the end sector”, as per the &lt;code&gt;sgdisk&lt;&#x2F;code&gt; man page.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;1:1m:+512m&lt;&#x2F;code&gt;, therefore, means that partition 1 will start 1 mebibyte from the start of the disk and end 512 mebibytes after the start of the largest available block.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;2:0:-10m&lt;&#x2F;code&gt;, in turn, means partition 2 will begin at the start of the largest available block and end 10 mebibytes before the last available sector.&lt;&#x2F;p&gt;
&lt;p&gt;Option &lt;code&gt;-t&lt;&#x2F;code&gt; is for setting the typecode for each partition. Typecode &lt;code&gt;ef00&lt;&#x2F;code&gt; is for the EFI system partition, and typecode &lt;code&gt;bf00&lt;&#x2F;code&gt; is for “Solaris root”, the Unix system upon whose ZFS implementation OpenZFS was based.&lt;&#x2F;p&gt;
&lt;p&gt;For a list of typecodes, see &lt;code&gt;sgdisk -L&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;While just running these commands as-is is your safest option, you might have a different layout in mind or prefer an interactive UI.&lt;&#x2F;p&gt;
&lt;p&gt;For one thing, I’ve had issues in the past with the boot partition being too small, so I’ll be using &lt;code&gt;2g&lt;&#x2F;code&gt; instead of &lt;code&gt;512m&lt;&#x2F;code&gt; for it.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;sgdisk&lt;&#x2F;code&gt; has a friendlier counterpart named &lt;code&gt;gdisk&lt;&#x2F;code&gt;, which you can use just by passing it the disk path, as in &lt;code&gt;gdisk &#x2F;dev&#x2F;sda&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;At this point, you should be safe to try partitioning and going back to wiping as needed until you are satisfied.&lt;&#x2F;p&gt;
&lt;p&gt;When you are done, you can use &lt;code&gt;lsblk&lt;&#x2F;code&gt; to confirm the results. The following will show you the options just configured:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;lsblk&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -o&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; NAME,SIZE,TYPE,PARTTYPENAME&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;creating-the-pool&quot;&gt;Creating the pool
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#creating-the-pool&quot; aria-label=&quot;Anchor link for: creating-the-pool&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;This part of the guide was the one that actually made me want to delve deeper and understand what each option meant.&lt;&#x2F;p&gt;
&lt;p&gt;With little knowledge about ZFS still, I wanted to understand precisely what was happening here, but also what a pool even is and what its creation meant.&lt;&#x2F;p&gt;
&lt;p&gt;Here’s the &lt;code&gt;zpool(8)&lt;&#x2F;code&gt; man page:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;A storage pool is a collection of devices that provides physical storage and data replication for ZFS datasets. All datasets within a storage pool share the same space.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;The definition of a dataset is then indicated to be at &lt;code&gt;zfs(8)&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;A dataset is identified by a unique path within the ZFS namespace: &lt;br&#x2F;&gt;
&lt;code&gt;pool[&#x2F;component]&#x2F;component&lt;&#x2F;code&gt; for example: &lt;code&gt;rpool&#x2F;var&#x2F;log&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Here, it’s also explained that a dataset can be a file system, logical volume, snapshot or bookmark.&lt;&#x2F;p&gt;
&lt;p&gt;Further information is also hinted to be found at &lt;code&gt;zpoolconcepts(7)&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;At this point you start to notice the breadth of knowledge available in the documentation. The man pages are not only comprehensible, but sometimes contain several examples on how to apply their concepts. Each command has their own man page  named with a hyphen for separation, as in &lt;code&gt;zpool-create&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;We’ll be exploring only the &lt;code&gt;zpool-create(8)&lt;&#x2F;code&gt; command in depth, in particular the options used in the ZFSBootMenu guide:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-f&lt;&#x2F;code&gt; force the use of virtual devices, even if they appear in use&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;-o feature=value&lt;&#x2F;code&gt; set a pool feature&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;-O property=value&lt;&#x2F;code&gt; set a file system property in the root file system of the pool&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;-o compatibility=off|legacy|file[,file]&lt;&#x2F;code&gt; specify a compatibility feature set&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;-m mountpoint&lt;&#x2F;code&gt; the mountpoint (default: &lt;code&gt;&#x2F;pool&lt;&#x2F;code&gt;)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;pool&lt;&#x2F;code&gt; the pool&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;vdev&lt;&#x2F;code&gt; the virtual device&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The listing with pool features (including compatibility feature sets) is at &lt;code&gt;zpool-features(7)&lt;&#x2F;code&gt;. Pool properties are at &lt;code&gt;zpoolprops(7)&lt;&#x2F;code&gt; and file system properties at &lt;code&gt;zfsprops(7)&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;In the guide, these are the options given:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zpool&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; create&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-character z-escape&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -o&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; ashift=&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric z-constant z-character z-escape&quot;&gt;12 \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -O&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; compression=lz4&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-character z-escape&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -O&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; acltype=posixacl&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-character z-escape&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -O&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; xattr=sa&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-character z-escape&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -O&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; relatime=on&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-character z-escape&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -o&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; autotrim=on&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-character z-escape&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -o&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; compatibility=openzfs-2.1-linux&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-character z-escape&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -m&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; none zroot&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;$POOL_DEVICE&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Among the options above, several pool features and system properties are set:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-o ashift=12&lt;&#x2F;code&gt; “Alignment shift”, used to calculate physical sector sizes.This is discussed at greater length in the &lt;a class=&quot;out-link&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;openzfs.github.io&#x2F;openzfs-docs&#x2F;Performance%20and%20Tuning&#x2F;Workload%20Tuning.html#alignment-shift-ashift&quot;&gt;online documentation on Workload Tuning&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;-O compression=lz4&lt;&#x2F;code&gt; Sets the compression algorithm used (&lt;a class=&quot;out-link&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;LZ4_(compression_algorithm)&quot;&gt;LZ4&lt;&#x2F;a&gt;)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;-O acltype=posixacl&lt;&#x2F;code&gt; Whether &lt;a class=&quot;out-link&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Access-control_list&quot;&gt;ACLs&lt;&#x2F;a&gt; are enabled and what type to use. The value &lt;code&gt;posixacl&lt;&#x2F;code&gt; is equivalent to &lt;code&gt;posix&lt;&#x2F;code&gt; (default on Linux: off)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;-O xattr=sa&lt;&#x2F;code&gt; Enables extended attributes. If value is &lt;code&gt;on&lt;&#x2F;code&gt;, uses directory-based extended attributes, while &lt;code&gt;sa&lt;&#x2F;code&gt; uses system-attribute-based. The latter has performance benefits, and is important for ACLs and SELinux usage&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;-O relatime=on&lt;&#x2F;code&gt; “Causes the access time to be updated relative to the modify or change time.” Also, “access time is only updated if the previous access time was earlier than the current modify or change time or if the existing access time hasn’t been updated within the past 24hours”&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;-o autotrim=on&lt;&#x2F;code&gt; Automatically reclaims unused blocks from time to time. Can put the filesystem under some stress&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The last option, the compatibility feature set, specifies in this case a relative filename to &lt;code&gt;&#x2F;usr&#x2F;share&#x2F;zfs&#x2F;compatibility.d&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-o compatibility=openzfs-2.1-linux&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;code&gt;zpool-create(8)&lt;&#x2F;code&gt; also states:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;By default, all supported features are enabled on the new pool. The &lt;code&gt;-d&lt;&#x2F;code&gt; option and the &lt;code&gt;-o&lt;&#x2F;code&gt; compatibility property […] can be used to restrict the features that are enabled, so that the pool can be imported on other releases of ZFS.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;The compatibility option &lt;code&gt;openzfs-2.1-linux&lt;&#x2F;code&gt; is described as a “conservative” choice in the ZFSBootMenu guide and in my tests had little impact, so I decided to not use it for this installation.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;creating-the-filesystems&quot;&gt;Creating the filesystems
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#creating-the-filesystems&quot; aria-label=&quot;Anchor link for: creating-the-filesystems&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Once the pool is ready, the filesystems can be created.&lt;&#x2F;p&gt;
&lt;p&gt;For this task, the &lt;code&gt;zfs&lt;&#x2F;code&gt; command is used with &lt;code&gt;create&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zfs&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; create&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -o&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; mountpoint=none zroot&#x2F;ROOT&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zfs&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; create&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -o&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; mountpoint=&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -o&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; canmount=noauto zroot&#x2F;ROOT&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;${&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;ID&lt;&#x2F;span&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zfs&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; create&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -o&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; mountpoint=&#x2F;home zroot&#x2F;home&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The ZFSBootMenu guide explains at this point that if &lt;code&gt;canmount=noauto&lt;&#x2F;code&gt; is not set on file systems with the &lt;code&gt;&#x2F;&lt;&#x2F;code&gt; mountpoint, the OS will try to mount them all and fail. It goes on to say:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Automatic mounting of &#x2F; is not required because the root file system is explicitly mounted in the boot process.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;After the filesystems have been created, the boot file system must be set.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zpool&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; set bootfs=zroot&#x2F;ROOT&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;${&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;ID&lt;&#x2F;span&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; zroot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Essentially, this is saying “set &lt;code&gt;zroot&lt;&#x2F;code&gt;’s &lt;code&gt;bootfs&lt;&#x2F;code&gt; property to &lt;code&gt;zroot&#x2F;ROOT&#x2F;void&lt;&#x2F;code&gt;”&lt;&#x2F;p&gt;
&lt;h3 id=&quot;export-reimport-and-mount&quot;&gt;Export, reimport and mount
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#export-reimport-and-mount&quot; aria-label=&quot;Anchor link for: export-reimport-and-mount&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;The next steps consist in exporting and then importing the pool with a given mountpoint.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zpool&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; export zroot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zpool&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; import&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -N -R&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; &#x2F;mnt zroot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;From what I gather, exporting means putting the pool in a more portable state. According to the &lt;code&gt;zpool-export(8)&lt;&#x2F;code&gt; man page, “the devices [marked as exported] can be moved between systems […] and imported as long as a sufficient number of devices are present.”&lt;&#x2F;p&gt;
&lt;p&gt;If &lt;code&gt;zfs import&lt;&#x2F;code&gt; is used without any arguments, it will list the exported pools available to be imported.&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;code&gt;-N root&lt;&#x2F;code&gt; option imports the pool without mounting any of its file systems, the &lt;code&gt;-R&lt;&#x2F;code&gt; option “sets the &lt;code&gt;cachefile&lt;&#x2F;code&gt; property to &lt;code&gt;none&lt;&#x2F;code&gt; and the &lt;code&gt;altroot&lt;&#x2F;code&gt; property to &lt;code&gt;root&lt;&#x2F;code&gt;”. In this case, that &lt;code&gt;root&lt;&#x2F;code&gt; will be &lt;code&gt;&#x2F;mnt&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;altroot&lt;&#x2F;code&gt; stands for the alternate root directory. In &lt;code&gt;zpoolprops(7)&lt;&#x2F;code&gt;, this becomes clearer when it is stated that “this directory is prepended to any mount points within the pool.”&lt;&#x2F;p&gt;
&lt;p&gt;Once re-imported, we can mount:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zfs&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; mount zroot&#x2F;ROOT&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;${&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;ID&lt;&#x2F;span&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zfs&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; mount zroot&#x2F;home&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And verify that all is mounted correctly with &lt;code&gt;mount | grep mnt&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-comment z-comment&quot;&gt;# mount | grep mnt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zroot&#x2F;ROOT&#x2F;void&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; on &#x2F;mnt type zfs&lt;&#x2F;span&gt;&lt;span&gt; (rw,relatime,xattr,posixacl,casesensitive)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zroot&#x2F;home&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; on &#x2F;mnt&#x2F;home type zfs&lt;&#x2F;span&gt;&lt;span&gt; (rw,relatime,xattr,posixacl,casesensitive)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Lastly, we request the device events from the kernel to update the device symlinks:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;udevadm&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; trigger&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;setting-up-void&quot;&gt;Setting up Void
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#setting-up-void&quot; aria-label=&quot;Anchor link for: setting-up-void&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;installation&quot;&gt;Installation
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#installation&quot; aria-label=&quot;Anchor link for: installation&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;So far, not much here was Void-specific. This is when we start bootstrapping the void system into the filesystem we laid out.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;XBPS_ARCH&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;x86_64&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt; xbps-install&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-character z-escape&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-constant z-other&quot;&gt;  -S -R&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; https:&#x2F;&#x2F;repo-fastly.voidlinux.org&#x2F;current&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-character z-escape&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-constant z-other&quot;&gt;  -r&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; &#x2F;mnt base-system&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here, we are passing an environment variable to set the architecture to &lt;code&gt;x86_64&lt;&#x2F;code&gt;, then use &lt;code&gt;xbps-install&lt;&#x2F;code&gt; from the xbps package manager to fetch the Void base system.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;-S&lt;&#x2F;code&gt; takes care of synchronizing the data from the mirror so that package data is fetched, &lt;code&gt;-R&lt;&#x2F;code&gt; allows us to manually specify the repository for this run, and &lt;code&gt;-r&lt;&#x2F;code&gt; allows choosing a different root directory to act upon.&lt;&#x2F;p&gt;
&lt;p&gt;Here, I chose the Fastly mirror over the ServerCentral one. &lt;a class=&quot;out-link&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;xmirror.voidlinux.org&#x2F;&quot;&gt;Any working mirror&lt;&#x2F;a&gt; should do.&lt;&#x2F;p&gt;
&lt;p&gt;Note that not all mirrors have the same content at the root of their URL. Some point directly to a Void repo, some don’t. You can access the mirror in a browser or otherwise inspect it to find the path to the  &lt;code&gt;current&lt;&#x2F;code&gt; directory.&lt;&#x2F;p&gt;
&lt;p&gt;With this done, we can copy the host ID file, which will also be required in our final system, and we are ready to chroot.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;cp&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; &#x2F;etc&#x2F;hostid &#x2F;mnt&#x2F;etc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;chrooting&quot;&gt;chrooting
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#chrooting&quot; aria-label=&quot;Anchor link for: chrooting&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;We will chroot into the system mounted at the &lt;code&gt;&#x2F;mnt&lt;&#x2F;code&gt; directory using &lt;code&gt;xchroot&lt;&#x2F;code&gt;, which is part of the xbps &lt;code&gt;xtools&lt;&#x2F;code&gt; package and should already be available on hrmpf. It provides a &lt;a class=&quot;out-link&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;docs.voidlinux.org&#x2F;config&#x2F;containers-and-vms&#x2F;chroot.html#chroot-usage&quot;&gt;more sane&lt;&#x2F;a&gt; chroot than the plain one, in particular regarding the required mountpoints:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;xchroot&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; &#x2F;mnt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This is a good time to get back to the notes I mentioned taking the day before.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;assets&#x2F;img&#x2F;posts&#x2F;void-on-zfs&#x2F;notes.jpg&quot; alt=&quot;A block of paper with some notes scribbled: “check connection first of all”, “reconfigure after chroot”, “see &#x2F;usr&#x2F;share&#x2F;doc&#x2F;efibootmgr&#x2F;README.voidlinux for automatic EFI entry management”, “superb docs”, “take the first snapshot ASAP”. An arrow points from the last note to “on chroot?” Visible above the block of paper is a keyboard. To the right, the tip of a notebook and a piece of brown cloth are visible. On top of the block, there is a mechanical pencil and a Tombow MONO One plastic eraser.&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;h4 id=&quot;reconfiguring-packages&quot;&gt;Reconfiguring packages
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#reconfiguring-packages&quot; aria-label=&quot;Anchor link for: reconfiguring-packages&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h4&gt;
&lt;p&gt;After chrooting, it may be a good idea to run &lt;code&gt;xbps-reconfigure&lt;&#x2F;code&gt; to make sure packages are properly configured. This is because in the bootstrap process some packets may have tried to configure themselves while relying on directories that were not mounted anywhere.&lt;&#x2F;p&gt;
&lt;p&gt;This is particularly true for &lt;a class=&quot;out-link&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;OSInside&#x2F;kiwi&#x2F;issues&#x2F;1867&quot;&gt;&lt;code&gt;dracut&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;, which is a tool that generates initramfs and initrd images, therefore being critical to the early boot process. You might see error messages related to it in your first run of xbps outside of the chroot, when installing the base system.&lt;&#x2F;p&gt;
&lt;p&gt;To reconfigure &lt;strong&gt;all&lt;&#x2F;strong&gt; packages, just run &lt;code&gt;xbps-reconfigure -fa&lt;&#x2F;code&gt;. If you’d rather only reconfigure &lt;code&gt;dracut&lt;&#x2F;code&gt;, go with &lt;code&gt;xpbs-reconfigure -f dracut&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;root-password&quot;&gt;root password
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#root-password&quot; aria-label=&quot;Anchor link for: root-password&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h4&gt;
&lt;p&gt;As early as possible is a good time to run &lt;code&gt;passwd&lt;&#x2F;code&gt; and set the root password.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;rc-conf&quot;&gt;&lt;code&gt;rc.conf&lt;&#x2F;code&gt;
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#rc-conf&quot; aria-label=&quot;Anchor link for: rc-conf&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h4&gt;
&lt;p&gt;&lt;code&gt;runit&lt;&#x2F;code&gt; reads the &lt;code&gt;&#x2F;etc&#x2F;rc.conf&lt;&#x2F;code&gt; file during startup to configure the system, setting up things like the keymap, hardware clock and terminal font.&lt;&#x2F;p&gt;
&lt;p&gt;For your reference, here is what I added to mine during the installation:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;HARDWARECLOCK&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;UTC&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;KEYMAP&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;br-abnt2&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;FONT&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;ter-120n&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h4 id=&quot;time-zone-and-locale&quot;&gt;Time zone and locale
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#time-zone-and-locale&quot; aria-label=&quot;Anchor link for: time-zone-and-locale&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h4&gt;
&lt;p&gt;To configure your local time zone, create a symlink at &lt;code&gt;&#x2F;etc&#x2F;localtime&lt;&#x2F;code&gt; that points to the corresponding time zone in the &lt;code&gt;&#x2F;usr&#x2F;share&#x2F;zoneinfo&lt;&#x2F;code&gt; directory.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;ln&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -sf&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; &#x2F;usr&#x2F;share&#x2F;zoneinfo&#x2F;&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;timezon&lt;&#x2F;span&gt;&lt;span&gt;e&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; &#x2F;etc&#x2F;localtime&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Unless you are using &lt;code&gt;musl&lt;&#x2F;code&gt;, you also want to set and generate the &lt;code&gt;glibc&lt;&#x2F;code&gt; locales. Edit &lt;code&gt;&#x2F;etc&#x2F;default&#x2F;libc-locales&lt;&#x2F;code&gt; and uncomment the desired locales, then run &lt;code&gt;xbps-reconfigure -f glibc-locales&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;dracut&quot;&gt;dracut
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#dracut&quot; aria-label=&quot;Anchor link for: dracut&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h4&gt;
&lt;p&gt;&lt;code&gt;dracut&lt;&#x2F;code&gt; generates file system images used by the kernel at the very early stages of boot. We have to make it able to identify our ZFS root filesystem by enabling the proper modules. This is accomplished by creating &lt;code&gt;&#x2F;etc&#x2F;dracut.conf.d&#x2F;zol.conf&lt;&#x2F;code&gt; with:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;nofsck&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;yes&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;add_dracutmodules&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;+=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt; zfs &lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-variable&quot;&gt;omit_dracutmodules&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-assignment&quot;&gt;+=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt; btrfs &lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Notice the spaces surrounding the module names.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;installing-and-configuring-zfsbootmenu&quot;&gt;Installing and configuring ZFSBootMenu
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#installing-and-configuring-zfsbootmenu&quot; aria-label=&quot;Anchor link for: installing-and-configuring-zfsbootmenu&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;We are now ready to install both ZFS and ZFSBootMenu. Let’s start with ZFS:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;xbps-install&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -R&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; https:&#x2F;&#x2F;repo-fastly.voidlinux.org&#x2F;current zfs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now, before installing ZFSBootMenu, we set the kernel commandline. This is the command line that will be used by the Linux kernel, so any options you are used to go here.&lt;&#x2F;p&gt;
&lt;p&gt;The ZFSBootMenu guide has only the &lt;code&gt;quiet&lt;&#x2F;code&gt; option. In my case, I added &lt;code&gt;net.ifnames=0&lt;&#x2F;code&gt; to have the classic &lt;code&gt;eth0&lt;&#x2F;code&gt;, &lt;code&gt;wlan0&lt;&#x2F;code&gt; network interface names, and &lt;code&gt;fbcon=nodefer video=efifb:nobgrt&lt;&#x2F;code&gt;, which prevents the manufacturer’s logo from showing after boot and sometimes obscuring the boot process output.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zfs&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; set org.zfsbootmenu:commandline=&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;quiet net.ifnames=0 fbcon=nodefer video=efifb:nobgrt&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; zroot&#x2F;ROOT&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We also need a &lt;code&gt;vfat&lt;&#x2F;code&gt; filesystem on our boot device:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;mkfs.vfat&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -F32&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;$BOOT_DEVICE&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now we can add an &lt;code&gt;&#x2F;etc&#x2F;fstab&lt;&#x2F;code&gt; entry pointing to it, and mount:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-support z-function&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;$(&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;blkid&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt; |&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;$BOOT_DEVICE&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt; |&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt; cut&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;#39; &amp;#39;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric&quot;&gt; 2&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;) &#x2F;boot&#x2F;efi vfat defaults 0 0&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; &#x2F;etc&#x2F;fstab&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; &#x2F;boot&#x2F;efi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;mount&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; &#x2F;boot&#x2F;efi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Into this directory we just mounted, we can now install ZFSBootMenu.&lt;&#x2F;p&gt;
&lt;p&gt;The guide provides two different paths here: a prebuilt image or the Void package, which you can get through xbps.&lt;&#x2F;p&gt;
&lt;p&gt;While there are advantages to both, I decided to go with the prebuilt image since I’d rather the package manager not touch the boot manager on updating. This has the downside of you having to take care of being aware of any relevant versions and when to upgrade to them.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;xbps-install&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; curl&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; &#x2F;boot&#x2F;efi&#x2F;EFI&#x2F;ZBM&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -o&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; &#x2F;boot&#x2F;efi&#x2F;EFI&#x2F;ZBM&#x2F;VMLINUZ.EFI&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -L&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; https:&#x2F;&#x2F;get.zfsbootmenu.org&#x2F;efi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;cp&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; &#x2F;boot&#x2F;efi&#x2F;EFI&#x2F;ZBM&#x2F;VMLINUZ.EFI &#x2F;boot&#x2F;efi&#x2F;EFI&#x2F;ZBM&#x2F;VMLINUZ-BACKUP.EFI&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you’d rather use the repository package, see the &lt;a class=&quot;out-link&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;docs.zfsbootmenu.org&#x2F;en&#x2F;latest&#x2F;guides&#x2F;void-linux&#x2F;uefi.html#install-zfsbootmenu&quot;&gt;corresponding instructions in the guide&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Finally, a second choice has to be made between &lt;code&gt;rEFind&lt;&#x2F;code&gt; or plain &lt;code&gt;efibootmgr&lt;&#x2F;code&gt; for managing the boot entries. I prefer to go with the simpler one, but you may find &lt;code&gt;rEFind&lt;&#x2F;code&gt; more feature-packed.&lt;&#x2F;p&gt;
&lt;p&gt;First, install &lt;code&gt;efibootmgr&lt;&#x2F;code&gt; using &lt;code&gt;xbps-install efibootmgr&lt;&#x2F;code&gt;, then run the following commands:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;efibootmgr&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -c -d&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;$BOOT_DISK&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;$BOOT_PART&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-character z-escape&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-constant z-other&quot;&gt;  -L&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;ZFSBootMenu (Backup)&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-character z-escape&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-constant z-other&quot;&gt;  -l&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;#39;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;\EFI\ZBM\VMLINUZ-BACKUP.EFI&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;efibootmgr&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -c -d&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;$BOOT_DISK&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable&quot;&gt;$BOOT_PART&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-character z-escape&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-constant z-other&quot;&gt;  -L&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;ZFSBootMenu&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-character z-escape&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-constant z-other&quot;&gt;  -l&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;#39;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;\EFI\ZBM\VMLINUZ.EFI&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you’d prefer to use rEFInd, see the &lt;a class=&quot;out-link&quot; rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;docs.zfsbootmenu.org&#x2F;en&#x2F;latest&#x2F;guides&#x2F;void-linux&#x2F;uefi.html#configure-efi-boot-entries&quot;&gt;guide’s relevant section&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;zbm-kcl&lt;&#x2F;code&gt; is mentioned here in passing. This utility allows you, among other things, to set ZFSBootMenu options, such as the delay before automatically booting. I am not sure if it comes included with the ZFSBootMenu package, as I went for the pre-built image, but you can nonetheless get it from GitHub:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -O&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;zbm-dev&#x2F;zfsbootmenu&#x2F;master&#x2F;bin&#x2F;zbm-kcl&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;chmod&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; +x zbm-kcl&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now, if you want to change an option, you can use its &lt;code&gt;-a&lt;&#x2F;code&gt; option to append an argument to the target image’s command line:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zbm-kcl&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -a&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt; &amp;#39;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string z-quoted&quot;&gt;zbm.timeout=2&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-definition z-string&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; &#x2F;boot&#x2F;efi&#x2F;EFI&#x2F;ZBM&#x2F;VMLINUZ.EFI&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In the example above, the timeout before automatically booting is set from its 10 seconds default to 2 seconds.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;getting-out&quot;&gt;Getting out
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#getting-out&quot; aria-label=&quot;Anchor link for: getting-out&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;We are all done. It’s time to exit the chroot, unmount and export the pool.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-support z-function&quot;&gt;exit&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;umount&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -n -R&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; &#x2F;mnt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zpool&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; export zroot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If all above went well, we can now run &lt;code&gt;reboot&lt;&#x2F;code&gt;, remove the flash drive used for installation, and log in for the first time into our new system.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;zfs-snapshot-basics&quot;&gt;ZFS snapshot basics
 &lt;a class=&quot;zola-anchor&quot; href=&quot;#zfs-snapshot-basics&quot; aria-label=&quot;Anchor link for: zfs-snapshot-basics&quot;&gt;#&lt;&#x2F;a&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;Something you might want to do at this point is to take a snapshot of the current state, since it can serve as a baseline before any further tweaking, allowing you to go back or access the files in this state as you make important changes that could potentially break the system.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zfs&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; snapshot&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -r&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; zroot&#x2F;ROOT&#x2F;void@baseline&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Note that, if you followed the ZFSBootMenu guide in creating a separate dataset for your home directory, this snapshot will not include the contents inside and under &lt;code&gt;&#x2F;home&lt;&#x2F;code&gt; (which at this point should be empty anyways).&lt;&#x2F;p&gt;
&lt;p&gt;You can access the contents of a snapshot at any time in the &lt;code&gt;.zfs&lt;&#x2F;code&gt; directory at the root of a given dataset. For the ones we previously set up, those would be &lt;code&gt;&#x2F;.zfs&lt;&#x2F;code&gt; and &lt;code&gt;&#x2F;home&#x2F;.zfs&lt;&#x2F;code&gt;. Note that these directories are not only hidden in the traditional way, but they won’t show up even if you use &lt;code&gt;ls -a&lt;&#x2F;code&gt;. You need to actually &lt;code&gt;cd&lt;&#x2F;code&gt; into the apparently absent directory for it to work.&lt;&#x2F;p&gt;
&lt;p&gt;ZFS snapshots start taking virtually no space at all, but grow with time as the snapshot drifts from the present system state. For that reason, keeping a snapshot of the very first moment of your system can take up significant space. Depending on your storage resources, you might eventually decide to destroy this snapshot:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zfs&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; destroy&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -r&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; zroot&#x2F;ROOT&#x2F;void@baseline&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You may also want to list your current snapshots. While typically you can use &lt;code&gt;zfs list -t snap&lt;&#x2F;code&gt;, I tend to use the following command in order to get more relevant output:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zfs&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; list&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; snap&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -o&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; creation,name,used,written,referenced,refcompressratio&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; creation&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Finally, you might want to rename a snapshot:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zfs&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; rename&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -r&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; zroot&#x2F;ROOT&#x2F;void@baseline @day0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Combined, these commands can get you as far as an automatic, rolling snapshot system. Say, for instance you add the following to &lt;code&gt;rc.local&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zfs&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; destroy&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -r&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; zroot&#x2F;ROOT&#x2F;void@fallbackBoot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zfs&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; rename&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -r&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; zroot&#x2F;ROOT&#x2F;void@previousBoot @fallbackBoot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zfs&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; rename&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -r&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; zroot&#x2F;ROOT&#x2F;void@currentBoot @previousBoot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-function&quot;&gt;zfs&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; snapshot&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-other&quot;&gt; -r&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; zroot&#x2F;ROOT&#x2F;void@currentBoot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This would give you a per-boot snapshot trail to rely on.&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;code&gt;zfs-snapshot(8)&lt;&#x2F;code&gt; man page provides a similar example for daily snapshots. Considering how simple the zfs CLI is, scripting several snapshot schemes can be quite easy, be them per boot, daily, or even every so many minutes using cron. Because ZFS snapshots grow as they drift from the present state, rotating them is optimal when storage space is a concern.&lt;&#x2F;p&gt;
&lt;p&gt;That’s it! I hope this was helpful to you in either learning about ZFS or about Void installations with Root on ZFS.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;&lt;em&gt;Originally written June 2nd, 2024&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
</content>
        
    </entry>
</feed>
