<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
      <title>💾 Software Pie</title>
      <link>https://blog.wayofthepie.dev</link>
      <description></description>
      <generator>Zola</generator>
      <language>en</language>
      <atom:link href="https://blog.wayofthepie.dev/rss.xml" rel="self" type="application/rss+xml"/>
      <lastBuildDate>Sat, 30 Apr 2022 00:00:00 +0000</lastBuildDate>
      <item>
          <title>GPG, Yubikey, and Pass </title>
          <pubDate>Sat, 30 Apr 2022 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://blog.wayofthepie.dev/gpg-keys-with-a-yubikey/</link>
          <guid>https://blog.wayofthepie.dev/gpg-keys-with-a-yubikey/</guid>
          <description xml:base="https://blog.wayofthepie.dev/gpg-keys-with-a-yubikey/">&lt;p&gt;Recently I&#x27;ve wanted to move back to using &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;www.passwordstore.org&#x2F;&quot;&gt;pass&lt;&#x2F;a&gt; as a password manager. In the past, I used &lt;code&gt;pass&lt;&#x2F;code&gt; with my GPG key on a yubikey and it worked out well. I do still have the key I used, but I can&#x27;t remember how I set pass&#x2F;GPG up to use the yubikey. So, I thought I&#x27;d do it from scratch, write about it, and maybe learn something.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;initial-setup&quot;&gt;Initial setup&lt;&#x2F;h1&gt;
&lt;p&gt;The &lt;code&gt;gpg&lt;&#x2F;code&gt; and &lt;code&gt;scdaemon&lt;&#x2F;code&gt; packages need to be installed. Once the yubikey is inserted it should be used immediately by GPG. GPG runs a daemon called &lt;code&gt;gpg-agent&lt;&#x2F;code&gt; which talks through &lt;code&gt;scdaemon&lt;&#x2F;code&gt; to communicate with the yubikey.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;generate-a-key&quot;&gt;Generate a key&lt;&#x2F;h1&gt;
&lt;p&gt;To start, we need to generate some keys! Run &lt;code&gt;gpg --expert --full-gen-key&lt;&#x2F;code&gt; and choose &lt;code&gt;1&lt;&#x2F;code&gt;, &quot;RSA and RSA&quot;, as the key type. The other options should be self-explanatory.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;❯ gpg --expert --full-gen-key&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg (GnuPG) 2.2.20; Copyright (C) 2020 Free Software Foundation, Inc.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;This is free software: you are free to change and redistribute it.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;There is NO WARRANTY, to the extent permitted by law.&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&gt;Please select what kind of key you want:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   (1) RSA and RSA (default)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   (2) DSA and Elgamal&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   (3) DSA (sign only)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   (4) RSA (sign only)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   (7) DSA (set your own capabilities)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   (8) RSA (set your own capabilities)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   (9) ECC and ECC&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  (10) ECC (sign only)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  (11) ECC (set your own capabilities)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  (13) Existing key&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  (14) Existing key from card&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Your selection? 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;RSA keys may be between 1024 and 4096 bits long.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;What keysize do you want? (3072) 4096&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Requested keysize is 4096 bits&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;RSA keys may be between 1024 and 4096 bits long.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;What keysize do you want for the subkey? (3072) 4096&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Requested keysize is 4096 bits&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Please specify how long the key should be valid.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;         0 = key does not expire&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      &amp;lt;n&amp;gt;  = key expires in n days&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      &amp;lt;n&amp;gt;w = key expires in n weeks&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      &amp;lt;n&amp;gt;m = key expires in n months&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      &amp;lt;n&amp;gt;y = key expires in n years&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Key is valid for? (0) 2y&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Key expires at Mon 29 Apr 2024 17:17:40 IST&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Is this correct? (y&#x2F;N) y&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&gt;GnuPG needs to construct a user ID to identify your key.&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&gt;Real name: Stephen OBrien&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Email address: wayofthepie@protonmail.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Comment:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;You selected this USER-ID:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;quot;Stephen OBrien &amp;lt;wayofthepie@protonmail.com&amp;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&gt;Change (N)ame, (C)omment, (E)mail or (O)kay&#x2F;(Q)uit? o&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;We need to generate a lot of random bytes. It is a good idea to perform&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;some other action (type on the keyboard, move the mouse, utilize the&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;disks) during the prime generation; this gives the random number&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;generator a better chance to gain enough entropy.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;We need to generate a lot of random bytes. It is a good idea to perform&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;some other action (type on the keyboard, move the mouse, utilize the&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;disks) during the prime generation; this gives the random number&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;generator a better chance to gain enough entropy.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg: key 01ED8E917ECF4036 marked as ultimately trusted&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg: revocation certificate stored as &amp;#39;&#x2F;home&#x2F;chaospie&#x2F;.gnupg&#x2F;openpgp-revocs.d&#x2F;985DB4AF50F89C5B9ED41803817494BAD88093CB.rev&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;public and secret key created and signed.&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&gt;pub   rsa4096 2022-04-30 [SC] [expires: 2024-04-29]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      985DB4AF50F89C5B9ED41803817494BAD88093CB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;uid                      Stephen OBrien &amp;lt;wayofthepie@protonmail.com&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sub   rsa4096 2022-04-30 [E] [expires: 2024-04-29]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You can run &lt;code&gt;gpg --list-secret-keys&lt;&#x2F;code&gt; to get a list of the secret keys generated:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;❯ gpg --list-secret-keys&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;home&#x2F;chaospie&#x2F;.gnupg&#x2F;pubring.kbx&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;---------------------------------&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sec   rsa4096 2022-04-30 [SC] [expires: 2024-04-29]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      985DB4AF50F89C5B9ED41803817494BAD88093CB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;uid           [ultimate] Stephen OBrien &amp;lt;wayofthepie@protonmail.com&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssb   rsa4096 2022-04-30 [E] [expires: 2024-04-29]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To see the public keys:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;❯ gpg --list-keys&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;home&#x2F;chaospie&#x2F;.gnupg&#x2F;pubring.kbx&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;---------------------------------&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;pub   rsa4096 2022-04-30 [SC] [expires: 2024-04-29]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      985DB4AF50F89C5B9ED41803817494BAD88093CB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;uid           [ultimate] Stephen OBrien &amp;lt;wayofthepie@protonmail.com&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sub   rsa4096 2022-04-30 [E] [expires: 2024-04-29]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;gpg-terminology&quot;&gt;GPG Terminology&lt;&#x2F;h2&gt;
&lt;p&gt;Another thing I always forget when using GPG after some time is what all the jargon means!&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sec   rsa4096 2022-04-30 [SC] [expires: 2024-04-29]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      985DB4AF50F89C5B9ED41803817494BAD88093CB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;uid           [ultimate] Stephen OBrien &amp;lt;wayofthepie@protonmail.com&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssb   rsa4096 2022-04-30 [E] [expires: 2024-04-29]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Let&#x27;s start from the first line &lt;code&gt;sec   rsa4096 2022-04-30 [SC] [expires: 2024-04-29]&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sec&lt;&#x2F;code&gt; means this is a secret key.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;rsa4096&lt;&#x2F;code&gt; is the algorithm and key size.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;[SC]&lt;&#x2F;code&gt; is the &lt;em&gt;capability&lt;&#x2F;em&gt; of the key, in this case &lt;code&gt;SC&lt;&#x2F;code&gt;. &lt;code&gt;S&lt;&#x2F;code&gt; is &lt;code&gt;Sign&lt;&#x2F;code&gt;, &lt;code&gt;C&lt;&#x2F;code&gt; is &lt;code&gt;Certify&lt;&#x2F;code&gt;, &lt;code&gt;A&lt;&#x2F;code&gt; is &lt;code&gt;Authenticate&lt;&#x2F;code&gt;, and &lt;code&gt;E&lt;&#x2F;code&gt; is &lt;code&gt;Encrypt&lt;&#x2F;code&gt;. You can create subkeys (more on this later) that have specific capabilities.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;[expires: 2024-04-29]&lt;&#x2F;code&gt; this just says when the key expires&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The second line, &lt;code&gt;985DB4AF50F89C5B9ED41803817494BAD88093CB&lt;&#x2F;code&gt;, is just the key id. The last line, &lt;code&gt;ssb   rsa4096 2022-04-30 [E] [expires: 2024-04-29]&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ssb&lt;&#x2F;code&gt; says this key is a &lt;em&gt;subkey&lt;&#x2F;em&gt;. The key denoted &lt;code&gt;sec&lt;&#x2F;code&gt; is the primary key, and all &lt;code&gt;ssb&lt;&#x2F;code&gt; keys are subkeys of this.&lt;&#x2F;li&gt;
&lt;li&gt;The rest is similar to the first line.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;move-keys-to-the-yubikey&quot;&gt;Move keys to the yubikey&lt;&#x2F;h1&gt;
&lt;p&gt;Moving the keys to the yubikey is pretty simple. First, you should back up the secret key &lt;em&gt;before&lt;&#x2F;em&gt; you move it to the yubikey, you won&#x27;t have access to this after moving. I have a second yubikey that I import all keys to, and I also move the secret key to a USB stick with a &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;man7.org&#x2F;linux&#x2F;man-pages&#x2F;man8&#x2F;cryptsetup.8.html&quot;&gt;LUKS volume&lt;&#x2F;a&gt;. Not the best practice security-wise, but it&#x27;s a USB stick I never use. You can also print them so they never live anywhere except on paper. To export the secret key:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg --export-secret-key --armor $SECRET_KEY_ID &amp;gt; secret.key&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;code&gt;secret.key&lt;&#x2F;code&gt; will contain the key. Store this somewhere safe! Time to move the keys to the yubikey. Insert it, and run:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;❯ gpg --card-status&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Reader ...........: 1050:0407:X:0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Application ID ...: D2760001240103040006120418440000&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Application type .: OpenPGP&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Version ..........: 3.4&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Manufacturer .....: Yubico&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If it displays the card info, GPG can see it. To import we need the id of the secret key, you can get this by running:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;❯ gpg --list-secret-keys&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;home&#x2F;chaospie&#x2F;.gnupg&#x2F;pubring.kbx&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;---------------------------------&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sec   rsa4096 2022-04-30 [SC] [expires: 2024-04-29]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      985DB4AF50F89C5B9ED41803817494BAD88093CB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;uid           [ultimate] Stephen OBrien &amp;lt;wayofthepie@protonmail.com&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssb   rsa4096 2022-04-30 [E] [expires: 2024-04-29]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The id in this case is &lt;code&gt;985DB4AF50F89C5B9ED41803817494BAD88093CB&lt;&#x2F;code&gt;. To move the keys to the yubikey run &lt;code&gt;gpg --edit-key $SECRET_KEY_ID&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;❯ gpg --edit-key 985DB4AF50F89C5B9ED41803817494BAD88093CB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg (GnuPG) 2.2.20; Copyright (C) 2020 Free Software Foundation, Inc.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;This is free software: you are free to change and redistribute it.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;There is NO WARRANTY, to the extent permitted by law.&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&gt;Secret key is available.&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&gt;sec  rsa4096&#x2F;817494BAD88093CB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     created: 2022-04-30  expires: 2024-04-29  usage: SC&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     trust: unknown       validity: unknown&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssb  rsa4096&#x2F;5DCD3D0ABD15FA6F&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     created: 2022-04-30  expires: 2024-04-29  usage: E&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[ unknown] (1). Stephen OBrien &amp;lt;wayofthepie@protonmail.com&amp;gt;&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&gt;gpg&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In the prompt type &lt;code&gt;keytocard&lt;&#x2F;code&gt; - remember, moving the key to the card means you can never read this key directly again, so make sure you back it up!&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg&amp;gt; keytocard&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Really move the primary key? (y&#x2F;N) y&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Please select where to store the key:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   (1) Signature key&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   (3) Authentication key&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Your selection? 1&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&gt;sec  rsa4096&#x2F;817494BAD88093CB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     created: 2022-04-30  expires: 2024-04-29  usage: SC&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     trust: unknown       validity: unknown&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssb  rsa4096&#x2F;5DCD3D0ABD15FA6F&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     created: 2022-04-30  expires: 2024-04-29  usage: E&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssb  rsa4096&#x2F;F35B9D17C107C8AC&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     created: 2022-04-30  expires: 2024-04-29  usage: A&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[ unknown] (1). Stephen OBrien &amp;lt;wayofthepie@protonmail.com&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We select the &lt;code&gt;Signature Key&lt;&#x2F;code&gt; slot in the yubikey as the place to store this primary key. It should prompt for the keys passphrase. Once done, select the subkey with &lt;code&gt;key 1&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg&amp;gt; key 1&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&gt;sec  rsa4096&#x2F;817494BAD88093CB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     created: 2022-04-30  expires: 2024-04-29  usage: SC&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     trust: unknown       validity: unknown&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssb* rsa4096&#x2F;5DCD3D0ABD15FA6F&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     created: 2022-04-30  expires: 2024-04-29  usage: E&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[ unknown] (1). Stephen OBrien &amp;lt;wayofthepie@protonmail.com&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Note the asterisk (&lt;code&gt;*&lt;&#x2F;code&gt;) after &lt;code&gt;ssb&lt;&#x2F;code&gt;, this means this subkey is selected.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg&amp;gt; keytocard&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Please select where to store the key:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;   (2) Encryption key&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Your selection? 2&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&gt;sec  rsa4096&#x2F;817494BAD88093CB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     created: 2022-04-30  expires: 2024-04-29  usage: SC&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     trust: unknown       validity: unknown&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssb* rsa4096&#x2F;5DCD3D0ABD15FA6F&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     created: 2022-04-30  expires: 2024-04-29  usage: E&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[ unknown] (1). Stephen OBrien &amp;lt;wayofthepie@protonmail.com&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This time we select the &lt;code&gt;Encryption Key&lt;&#x2F;code&gt; slot in the yubikey. Once complete, type &lt;code&gt;quit&lt;&#x2F;code&gt; and make sure to say &lt;code&gt;y&lt;&#x2F;code&gt; when prompted to save.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg&amp;gt; q&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Save changes? (y&#x2F;N) y&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now, when we list the secret keys, both the primary key and the subkey should be postfixed with a &lt;code&gt;&amp;gt;&lt;&#x2F;code&gt;, this denotes that GPG only has a reference to the keys, they are not stored directly in its keyring.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;❯ gpg --list-secret-keys&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;home&#x2F;chaospie&#x2F;.gnupg&#x2F;pubring.kbx&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;---------------------------------&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sec&amp;gt;  rsa4096 2022-04-30 [SC] [expires: 2024-04-29]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      985DB4AF50F89C5B9ED41803817494BAD88093CB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Card serial no. = 0006 12041844&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;uid           [ unknown] Stephen OBrien &amp;lt;wayofthepie@protonmail.com&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssb&amp;gt;  rsa4096 2022-04-30 [E] [expires: 2024-04-29]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h1 id=&quot;export-and-store-the-public-key&quot;&gt;Export and store the public key&lt;&#x2F;h1&gt;
&lt;p&gt;It&#x27;s important to export and store the public key somewhere publicly accessible. To export:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg --output public.key --armor --export $SECRET_KEY_ID&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;code&gt;public.key&lt;&#x2F;code&gt; will contain the key. Once you&#x27;ve stored the public key somewhere, edit the card again with &lt;code&gt;gpg --edit-card&lt;&#x2F;code&gt;. This time enable admin commands with the &lt;code&gt;admin&lt;&#x2F;code&gt; command, and then enter the URL to access the public key with &lt;code&gt;url&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;❯ gpg --edit-card&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&gt;Reader ...........: 1050:0407:X:0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Application ID ...: D2760001240103040006120418440000&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Application type .: OpenPGP&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;...&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&gt;gpg&#x2F;card&amp;gt; admin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Admin commands are allowed&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&gt;gpg&#x2F;card&amp;gt; url&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;URL to retrieve public key: https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;wayofthepie&#x2F;public-keys&#x2F;main&#x2F;proton.key&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I stored mine in a github repo, you can also upload it to a keyserver and reference from there.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;set-up-pass&quot;&gt;Set up pass&lt;&#x2F;h1&gt;
&lt;p&gt;Install pass, with &lt;code&gt;sudo apt install pass&lt;&#x2F;code&gt; or however else you want to install it. Initialize the password store with the email you used to set up your key (you can also use the full key id instead of the email):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;❯ pass init wayofthepie@protonmail.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;mkdir: created directory &amp;#39;&#x2F;home&#x2F;chaospie&#x2F;.password-store&#x2F;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Password store initialized for wayofthepie@protonmail.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Enable git support:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;❯ pass git init&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Initialized empty Git repository in &#x2F;home&#x2F;chaospie&#x2F;.password-store&#x2F;.git&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[main (root-commit) ac03bd2] Add current contents of password store.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; 1 file changed, 1 insertion(+)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; create mode 100644 .gpg-id&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[main 894baaa] Configure git repository for gpg file diff.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; 1 file changed, 1 insertion(+)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; create mode 100644 .gitattributes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Configure the &lt;code&gt;gpg-agent&lt;&#x2F;code&gt; to open any prompts on the terminal by editing&#x2F;creating &lt;code&gt;~&#x2F;.gnupg&#x2F;gpg-agent.conf&lt;&#x2F;code&gt; and adding:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;pinentry-program &#x2F;usr&#x2F;bin&#x2F;pinentry-curses&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Either &lt;code&gt;pinentry-curses&lt;&#x2F;code&gt; or &lt;code&gt;pinentry-tty&lt;&#x2F;code&gt; can be used here, if neither is installed you should be able to install it directly through the package manager. Kill the agent to force it to reload its config:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;❯ gpgconf --kill gpg-agent&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;It will restart automatically. Let&#x27;s do a quick test, insert a key &lt;code&gt;test&lt;&#x2F;code&gt; with the value &lt;code&gt;test&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;❯ pass insert test -e&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Enter password for test: test&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The &lt;code&gt;-e&lt;&#x2F;code&gt; flag just means echo back the value I type, without it the value is hidden. Now, test retrieval, run &lt;code&gt;pass test&lt;&#x2F;code&gt; and it should prompt you for your PIN:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;┌──────────────────────────────────────────────┐&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│ Please unlock the card                       │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│                                              │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│ Number: 0006 33333333                        │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│ Holder:                                      │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│                                              │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│ PIN ________________________________________ │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│                                              │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│      &amp;lt;OK&amp;gt;                        &amp;lt;Cancel&amp;gt;    │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;└──────────────────────────────────────────────┘&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The default PIN is 123456, you should change that if it&#x27;s still that value. Once entered, pass should print the value of &lt;code&gt;test&lt;&#x2F;code&gt;. This means it&#x27;s working!&lt;&#x2F;p&gt;
&lt;p&gt;We need to test that the key is only accessible on the yubikey also. Pull out the yubikey and try to retrieve the value for &lt;code&gt;test&lt;&#x2F;code&gt; again, it should show a prompt like the following:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;┌────────────────────────────────────────────┐&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│ Please insert the card with serial number: │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│                                            │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│ 0006 33333333                              │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│                                            │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│      &amp;lt;OK&amp;gt;                      &amp;lt;Cancel&amp;gt;    │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;└────────────────────────────────────────────┘&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now pop it back in and run &lt;code&gt;pass test&lt;&#x2F;code&gt;, it should ask for the PIN again.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;set-up-on-another-computer&quot;&gt;Set up on another computer&lt;&#x2F;h1&gt;
&lt;p&gt;This is the bit that always drives me mad when I haven&#x27;t used GPG for a while. Initially, on a new computer, you&#x27;ll have no public or secret keys:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;❯ gpg --list-keys&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg: checking the trustdb&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg: no ultimately trusted keys found&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&gt;❯ gpg --list-secret-keys&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you try to use &lt;code&gt;pass&lt;&#x2F;code&gt; to get a secret in the store, you will get the following error:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;❯ pass test&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg: decryption failed: No secret key&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Let&#x27;s fix it!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;fetch-the-public-key&quot;&gt;Fetch the public key&lt;&#x2F;h2&gt;
&lt;p&gt;To get a reference to the keys on the yubikey, plug it in and run:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;❯ gpg --card-edit&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&gt;Reader ...........: 1050:0407:X:0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Application ID ...: D2760001240103040006120418440000&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Application type .: OpenPGP&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;...&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&gt;gpg&#x2F;card&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In the prompt type &lt;code&gt;fetch&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg&#x2F;card&amp;gt; fetch&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg: requesting key from &amp;#39;https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;wayofthepie&#x2F;public-keys&#x2F;main&#x2F;proton.key&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg: key 01ED8E917ECF4036: public key &amp;quot;Stephen OBrien &amp;lt;wayofthepie@protonmail.com&amp;gt;&amp;quot; imported&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg: Total number processed: 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg:               imported: 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That&#x27;s it! Now, GPG should have a reference to the keys, and &lt;code&gt;pass test&lt;&#x2F;code&gt; should prompt you for your pin and read the value of our test secret &lt;code&gt;test&lt;&#x2F;code&gt; correctly.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;❯ gpg --list-keys&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;home&#x2F;chaospie&#x2F;.gnupg&#x2F;pubring.kbx&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;---------------------------------&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;pub   rsa4096 2022-04-30 [SC] [expires: 2024-04-29]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      985DB4AF50F89C5B9ED41803817494BAD88093CB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;uid           [ unknown] Stephen OBrien &amp;lt;wayofthepie@protonmail.com&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sub   rsa4096 2022-04-30 [E] [expires: 2024-04-29]&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&gt;❯ gpg --list-secret-keys&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;home&#x2F;chaospie&#x2F;.gnupg&#x2F;pubring.kbx&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;---------------------------------&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sec&amp;gt;  rsa4096 2022-04-30 [SC] [expires: 2024-04-29]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      985DB4AF50F89C5B9ED41803817494BAD88093CB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Card serial no. = 0006 12041844&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;uid           [ unknown] Stephen OBrien &amp;lt;wayofthepie@protonmail.com&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssb&amp;gt;  rsa4096 2022-04-30 [E] [expires: 2024-04-29]&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&gt;❯ pass test&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;test&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h1 id=&quot;phew&quot;&gt;Phew...&lt;&#x2F;h1&gt;
&lt;p&gt;This is the third time I have had to go re-learn how GPG works. It&#x27;s a bit of a nightmare usability-wise. Hopefully, this serves as a good reference for future me at the very least!&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Processes, Threads and the Clone Syscall </title>
          <pubDate>Sun, 28 Feb 2021 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://blog.wayofthepie.dev/linux/linux-procs-and-threads/</link>
          <guid>https://blog.wayofthepie.dev/linux/linux-procs-and-threads/</guid>
          <description xml:base="https://blog.wayofthepie.dev/linux/linux-procs-and-threads/">&lt;p&gt;I want to explore how threads and processes work on Linux, under the hood, as in-depth as I can. It&#x27;s been a while since I dove into the kernel. In this series of posts, I&#x27;ll be writing some potentially insane C code to dive into this.&lt;&#x2F;p&gt;</description>
      </item>
      <item>
          <title>Binary Search Tree Trim</title>
          <pubDate>Thu, 11 Feb 2021 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://blog.wayofthepie.dev/rc-refcell-trees/</link>
          <guid>https://blog.wayofthepie.dev/rc-refcell-trees/</guid>
          <description xml:base="https://blog.wayofthepie.dev/rc-refcell-trees/">&lt;p&gt;This post came from a Leetcode problem in February&#x27;s daily challenges which I solved. It contains a few things that were issues for me when initially learning Rust, namely, how to properly use &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;rc&#x2F;struct.Rc.html&quot;&gt;Rc&lt;&#x2F;a&gt; and &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;cell&#x2F;struct.RefCell.html&quot;&gt;RefCell&lt;&#x2F;a&gt;. Now that I understand them a lot more, I thought I&#x27;d write about them.&lt;&#x2F;p&gt;</description>
      </item>
      <item>
          <title>Decode A Certificate</title>
          <pubDate>Mon, 22 Jun 2020 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://blog.wayofthepie.dev/rust-cert-cli/rust-cert-cli-part3/</link>
          <guid>https://blog.wayofthepie.dev/rust-cert-cli/rust-cert-cli-part3/</guid>
          <description xml:base="https://blog.wayofthepie.dev/rust-cert-cli/rust-cert-cli-part3/">&lt;p&gt;From this post on I will leave a note at the end of some sections linking to the latest code up to that point. It will look like this:&lt;&#x2F;p&gt;
&lt;div class=&quot;alert alert-info&quot;&gt;
&lt;span&gt;&lt;i class=&quot;icon fas fa-link&quot;&gt;&lt;&#x2F;i&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;alert-text&quot;&gt;
  &lt;p&gt;
    &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;wayofthepie&#x2F;cert-decoder&#x2F;tree&#x2F;a9d761e1ba306587a332e97e9fd4e654f1049ab9&quot;&gt;wayofthepie&#x2F;cert-decoder@a9d761e&lt;&#x2F;a&gt;
  &lt;&#x2F;p&gt;
&lt;&#x2F;span&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;That link points to the latest code from the last post.&lt;&#x2F;p&gt;</description>
      </item>
      <item>
          <title>Morning silence and broken drivers </title>
          <pubDate>Sun, 14 Jun 2020 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://blog.wayofthepie.dev/morning-silence/</link>
          <guid>https://blog.wayofthepie.dev/morning-silence/</guid>
          <description xml:base="https://blog.wayofthepie.dev/morning-silence/">&lt;p&gt;I woke up this morning and booted my desktop. No sound! Some digging around and I noticed &lt;code&gt;dmesg&lt;&#x2F;code&gt; spitting out an error. I don&#x27;t have that message saved but here are the details from the kernel logs.&lt;&#x2F;p&gt;</description>
      </item>
      <item>
          <title>Rust and GitHub Actions</title>
          <pubDate>Sun, 07 Jun 2020 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://blog.wayofthepie.dev/rust-cert-cli/rust-cert-cli-part2/</link>
          <guid>https://blog.wayofthepie.dev/rust-cert-cli/rust-cert-cli-part2/</guid>
          <description xml:base="https://blog.wayofthepie.dev/rust-cert-cli/rust-cert-cli-part2/">&lt;p&gt;Before we continue implementing our CLI, let&#x27;s take time to set up some &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;help.github.com&#x2F;en&#x2F;actions&quot;&gt;GitHub Actions&lt;&#x2F;a&gt; to build and test our commits. We&#x27;ll use the actions defined in the &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;actions-rs&quot;&gt;actions-rs GitHub Organization&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;</description>
      </item>
      <item>
          <title>A Rust cli for decoding certs</title>
          <pubDate>Tue, 02 Jun 2020 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://blog.wayofthepie.dev/rust-cert-cli/rust-cert-cli/</link>
          <guid>https://blog.wayofthepie.dev/rust-cert-cli/rust-cert-cli/</guid>
          <description xml:base="https://blog.wayofthepie.dev/rust-cert-cli/rust-cert-cli/">&lt;p&gt;In this series of posts, we&#x27;ll start to build a simple cli in &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;www.rust-lang.org&#x2F;&quot;&gt;Rust&lt;&#x2F;a&gt; for decoding X.509 certificates. I&#x27;ll try to keep it as beginner-friendly as possible, by explaining things as best I can when they may be unclear. Some basic Rust knowledge should hopefully be all you need. Feel free to ask any questions in the comments below!&lt;&#x2F;p&gt;</description>
      </item>
      <item>
          <title>Structure of an SSL (X.509) certificate </title>
          <pubDate>Fri, 22 May 2020 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://blog.wayofthepie.dev/structure-of-an-ssl-certificate/</link>
          <guid>https://blog.wayofthepie.dev/structure-of-an-ssl-certificate/</guid>
          <description xml:base="https://blog.wayofthepie.dev/structure-of-an-ssl-certificate/">&lt;p&gt;I&#x27;ve been working on some tooling for pulling certificate information out of the &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;www.certificate-transparency.org&#x2F;&quot;&gt;certificate transparency logs&lt;&#x2F;a&gt; on and off for a while. I started looking at this again after a few weeks away from it and I&#x27;ve forgotten quite a lot! I&#x27;ve even forgotten some of the basics of what makes a certificate. In this post I want to dive into the structure of a certificate, what it is made of at a high level. I won&#x27;t talk much about how certificates are used in protocols (e.g. Transport Layer Security (TLS)).&lt;&#x2F;p&gt;
&lt;p&gt;This post started as a reference for myself but other folks may find it interesting or useful. It has a lot of external references to RFC&#x27;s which are stored in footnotes.&lt;&#x2F;p&gt;</description>
      </item>
      <item>
          <title>Containerizing The JVM: Basic Memory Overview </title>
          <pubDate>Sun, 18 Feb 2018 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://blog.wayofthepie.dev/containerizing-the-jvm-basic-mem-overview/</link>
          <guid>https://blog.wayofthepie.dev/containerizing-the-jvm-basic-mem-overview/</guid>
          <description xml:base="https://blog.wayofthepie.dev/containerizing-the-jvm-basic-mem-overview/">&lt;p&gt;For the past few years where I work has been running JVM applications on &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;www.cloudfoundry.org&#x2F;&quot;&gt;Cloud Foundry&lt;&#x2F;a&gt;.
We have come across many issues in relation to memory when running JVM&#x27;s within memory
bounded containers.&lt;&#x2F;p&gt;</description>
      </item>
      <item>
          <title>Terraform, Google Cloud And Kubernetes</title>
          <pubDate>Sat, 15 Jul 2017 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://blog.wayofthepie.dev/terraform-gcp/</link>
          <guid>https://blog.wayofthepie.dev/terraform-gcp/</guid>
          <description xml:base="https://blog.wayofthepie.dev/terraform-gcp/">&lt;p&gt;I&#x27;ve been hacking about with automated infrastructure setup a lot lately. The two tools
I&#x27;ve focused on the most are NixOps and Terraform. This post is about the use of terraform
on &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;cloud.google.com&#x2F;docs&#x2F;&quot;&gt;Google Cloud Platform&lt;&#x2F;a&gt; (GCP) to create and manage a
Kubernetes Container Cluster.&lt;&#x2F;p&gt;</description>
      </item>
      <item>
          <title>Building an Assembler in Haskell: Implementation</title>
          <pubDate>Thu, 30 Mar 2017 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://blog.wayofthepie.dev/building-an-assembler-in-haskell-part2/</link>
          <guid>https://blog.wayofthepie.dev/building-an-assembler-in-haskell-part2/</guid>
          <description xml:base="https://blog.wayofthepie.dev/building-an-assembler-in-haskell-part2/">&lt;p&gt;In the
&lt;a href=&quot;https:&#x2F;&#x2F;blog.wayofthepie.dev&#x2F;building-an-assembler-in-haskell&#x2F;&quot;&gt;previous post&lt;&#x2F;a&gt;
we wrote a grammar for a simple assembly language, wrote the outline of our parser,
derived some properties from the grammar for a simple parser &lt;code&gt;byte&lt;&#x2F;code&gt; and implemented &lt;code&gt;byte&lt;&#x2F;code&gt;.
We also saw that there are a few deficiencies in our grammar. In this post we&#x27;ll implement
&lt;code&gt;bytes&lt;&#x2F;code&gt;, &lt;code&gt;menmonic&lt;&#x2F;code&gt;, &lt;code&gt;label&lt;&#x2F;code&gt; and &lt;code&gt;labelAssign&lt;&#x2F;code&gt;. For each parser I&#x27;ll start with some &lt;em&gt;QuickCheck&lt;&#x2F;em&gt;
properties then use those as the spec to implement the parser. Let&#x27;s get to it!&lt;&#x2F;p&gt;</description>
      </item>
      <item>
          <title>Building an Assembler in Haskell </title>
          <pubDate>Fri, 03 Mar 2017 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://blog.wayofthepie.dev/building-an-assembler-in-haskell/</link>
          <guid>https://blog.wayofthepie.dev/building-an-assembler-in-haskell/</guid>
          <description xml:base="https://blog.wayofthepie.dev/building-an-assembler-in-haskell/">&lt;p&gt;Recently I started building an emulator for the MosTech 6502 Cpu, this post is
about the initial stages of building an assembler for a simple assembly language
that compiles to runnable 6502 machine code. I&#x27;ve created a repo and updated it as I wrote
this post, so at the end of most sections that introduce new code I&#x27;ll link to a commit
which has the code up to that point.&lt;&#x2F;p&gt;</description>
      </item>
      <item>
          <title>Some JS and Haskell stuff</title>
          <pubDate>Sun, 22 Jan 2017 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://blog.wayofthepie.dev/js-and-haskell-stuff/</link>
          <guid>https://blog.wayofthepie.dev/js-and-haskell-stuff/</guid>
          <description xml:base="https://blog.wayofthepie.dev/js-and-haskell-stuff/">&lt;h1 id=&quot;vulgr-ui-react&quot;&gt;Vulgr UI - React&lt;&#x2F;h1&gt;
&lt;p&gt;Vulgr is a project I&#x27;ve been working on, on and off, for a while. The goal is to build a
dependency analysis platform - analyze your &lt;code&gt;gradle&lt;&#x2F;code&gt;&#x2F;&lt;code&gt;node&lt;&#x2F;code&gt;&#x2F;&lt;code&gt;whatever&lt;&#x2F;code&gt; dependencies to see
whether they contain known vulnerabilities or bugs, reading from whatever data sources (CVE
database, github issues, etc...) that make sense.&lt;&#x2F;p&gt;
&lt;p&gt;This week, I did some work on how this information could be displayed to users on a web
interface, e.g.:&lt;&#x2F;p&gt;
&lt;img src=&quot;&#x2F;images&#x2F;vulgr-ui-jan3-weekly.png&quot; class=&quot;img-responsive&quot; &#x2F;&gt;
&lt;p&gt;This is built with &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;facebook.github.io&#x2F;react&#x2F;&quot;&gt;react&lt;&#x2F;a&gt; and &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;http:&#x2F;&#x2F;www.material-ui.com&#x2F;#&#x2F;&quot;&gt;material-ui&lt;&#x2F;a&gt;.
The code for the card is located at
&lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;wayofthepie&#x2F;vulgr-ui-experimental&#x2F;blob&#x2F;material&#x2F;src&#x2F;components&#x2F;analysis&#x2F;summary&#x2F;AnalysisSummaryCard.js&quot;&gt;AnalysisSummaryCard.js&lt;&#x2F;a&gt;.
Following is the code for the status icon&#x27;s in the card, nice, flexible re-usable component!&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;#39;use strict&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&gt;import React, {PropTypes} from &amp;#39;react&amp;#39;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;import ReactTooltip from &amp;#39;react-tooltip&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&gt;let statusIcon = (iconType, attributes, style) =&amp;gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  return (&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;i className=&amp;#39;material-icons md-36&amp;#39; {...attributes}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;       style={style}&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      {iconType}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;&#x2F;i&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  );&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;};&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&gt;let tooltippableStatusIcon = (iconType, tooltipInfo, style) =&amp;gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  let tooltip = function () {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    if (tooltipInfo) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      return (&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        &amp;lt;ReactTooltip place=&amp;#39;top&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                      id={tooltipInfo.id}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                      type={tooltipInfo.type}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                      effect=&amp;#39;solid&amp;#39;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;          &amp;lt;span &amp;gt;&amp;lt;strong&amp;gt;{tooltipInfo.message}&amp;lt;&#x2F;strong&amp;gt;&amp;lt;&#x2F;span&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        &amp;lt;&#x2F;ReactTooltip&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      );&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    } else {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      return null;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  };&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&gt;  let tooltippedAttributes = () =&amp;gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    return tooltipInfo ? {&amp;#39;data-tip&amp;#39;: &amp;#39;&amp;#39;, &amp;#39;data-for&amp;#39;: tooltipInfo.id} : [];&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  };&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&gt;  return (&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;div&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      { tooltip() }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      { statusIcon(iconType, tooltippedAttributes(), style) }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;&#x2F;div&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  );&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;};&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&gt;export const StatusIcon = ({iconType, tooltipInfo, style}) =&amp;gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  return tooltippableStatusIcon(iconType, tooltipInfo, style);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;};&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&gt;StatusIcon.propTypes = {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  iconType: PropTypes.string.isRequired,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  tooltipInfo: PropTypes.shape({&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    id: PropTypes.string.isRequired,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    type: PropTypes.string.isRequired,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    message: PropTypes.string.isRequired&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  }),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  style: PropTypes.object&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;};&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&gt;export default StatusIcon;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here is an example of its use to render the error icon, first a function to wrap up the JSX:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; createStatusIcon&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;iconType&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; tooltipInfo&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; style&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&amp;gt;&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 style=&quot;color: #F97583;&quot;&gt;  return&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&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;StatusIcon&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;      iconType&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;{iconType}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;      tooltipInfo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;{tooltipInfo}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;      style&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;{style} &#x2F;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  );&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;};&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Concrete usage:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; errorIcon&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; ()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&amp;gt;&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 style=&quot;color: #F97583;&quot;&gt;  let&lt;&#x2F;span&gt;&lt;span&gt; icon&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;error&amp;#39;&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 style=&quot;color: #F97583;&quot;&gt;  let&lt;&#x2F;span&gt;&lt;span&gt; marginLeft&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 10&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 style=&quot;color: #F97583;&quot;&gt;  let&lt;&#x2F;span&gt;&lt;span&gt; tooltipInfo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; buildTooltipInfo&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;analysis-card-error-tooltip&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;error&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;Error!&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, {marginLeft});&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  let&lt;&#x2F;span&gt;&lt;span&gt; style&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; {color:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;red&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, float:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;left&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, marginLeft};&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; createStatusIcon&lt;&#x2F;span&gt;&lt;span&gt;(icon, tooltipInfo, style);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;};&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Pretty flexible! The color and style can easily be changed so the icon can fit in without
much hassle in components with complex styles, or can be greyed out, etc...&lt;&#x2F;p&gt;
&lt;p&gt;I use Angular and bootstrap at work, so far &lt;em&gt;react&lt;&#x2F;em&gt; and &lt;em&gt;material&lt;&#x2F;em&gt; have been a dream in
comparison.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;haskell-criu-rpc-client&quot;&gt;Haskell Criu RPC Client&lt;&#x2F;h1&gt;
&lt;p&gt;I&#x27;ve been toying about with &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;criu.org&#x2F;&quot;&gt;criu&lt;&#x2F;a&gt; for the last few weeks. I decided to
write some bindings to it in haskell.&lt;&#x2F;p&gt;
&lt;p&gt;Criu&#x27;s RPC API &lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; uses &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;protobuf&quot;&gt;protobuf&lt;&#x2F;a&gt;. I used the
&lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;proto-lens&quot;&gt;proto-lens&lt;&#x2F;a&gt; library to generate lenses and data
types. This gives a pretty nice foundation to build upon - the project for generation is on
github, &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;wayofthepie&#x2F;haskell-criu-rpc-types&quot;&gt;haskell-criu-rpc-types&lt;&#x2F;a&gt;
&lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#2&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;With that foundation, I threw together a quick client:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;haskell&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{-#&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; LANGUAGE OverloadedStrings&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&gt;{-#&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; LANGUAGE ScopedTypeVariables&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 style=&quot;color: #F97583;&quot;&gt;module&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; Criu&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 style=&quot;color: #F97583;&quot;&gt;  module Proto&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;Criu&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;Rpc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  ,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; module Lens&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;Family2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  ,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; callCriu&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  ,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; callCriu&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  )&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; where&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 style=&quot;color: #F97583;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; Control.Exception.Base&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;IOException&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; bracket&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; try&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 style=&quot;color: #F97583;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; Lens.Family2&lt;&#x2F;span&gt;&lt;span&gt; ((&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;.~&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 style=&quot;color: #F97583;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; Data.ProtoLens&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;decodeMessage&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; encodeMessage&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 style=&quot;color: #F97583;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; Proto.Criu.Rpc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; Network.Socket&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;Family&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;AF_UNIX&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; SocketType&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;SeqPacket&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; SockAddr&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;SockAddrUnix&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; close&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; connect&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; socket&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 style=&quot;color: #F97583;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; Network.Socket.ByteString&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;recv&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; send&lt;&#x2F;span&gt;&lt;span&gt;)&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 style=&quot;color: #6A737D;&quot;&gt;-- | Send request to criu socket. Can throw exceptions.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;callCriu&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; :: FilePath -&amp;gt; Criu_req -&amp;gt; IO&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;Either String Criu_resp&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&gt;callCriu fp req &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;= do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  resp &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;-&lt;&#x2F;span&gt;&lt;span&gt; withSocket &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;$ \&lt;&#x2F;span&gt;&lt;span&gt;sock &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;-&amp;gt; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    connect sock (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;SockAddrUnix&lt;&#x2F;span&gt;&lt;span&gt; fp)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    send sock (encodeMessage req)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    recv sock &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;1024&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  pure (decodeMessage resp &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;:: Either String Criu_resp&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 style=&quot;color: #F97583;&quot;&gt; where&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  withSocket f &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt; bracket&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    (socket &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;AF_UNIX SeqPacket 0&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&gt;    (close)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;\&lt;&#x2F;span&gt;&lt;span&gt;sock &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;-&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; f sock)&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 style=&quot;color: #6A737D;&quot;&gt;-- | Send a request to criu, but wrap up IOExceptions in Either.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;callCriu&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; :: FilePath -&amp;gt; Criu_req -&amp;gt; IO&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;Either String Criu_resp&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&gt;callCriu&amp;#39; fp req &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;= do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  eitherResp &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;-&lt;&#x2F;span&gt;&lt;span&gt; try (callCriu fp req)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  case&lt;&#x2F;span&gt;&lt;span&gt; eitherResp &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;of&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    Right&lt;&#x2F;span&gt;&lt;span&gt; resp &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;-&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; pure resp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    Left&lt;&#x2F;span&gt;&lt;span&gt; (e &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;:: IOException&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; pure &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; Left&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; .&lt;&#x2F;span&gt;&lt;span&gt; show &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; e&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Both &lt;code&gt;callCriu&lt;&#x2F;code&gt; and &lt;code&gt;callCriu&#x27;&lt;&#x2F;code&gt; expect the path to the &lt;code&gt;criu&lt;&#x2F;code&gt; socket and a &lt;code&gt;Criu_req&lt;&#x2F;code&gt; type.&lt;&#x2F;p&gt;
&lt;p&gt;To build the actual &lt;code&gt;Criu_req&lt;&#x2F;code&gt; expected by the calls is is pretty straightforward. In
&lt;code&gt;ghci&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;haskell&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; build (type&amp;#39; &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;.~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; CHECK&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; :: Criu_req&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;Criu_req&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&gt;  _Criu_req&amp;#39;type&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; CHECK&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  , _Criu_req&amp;#39;opts&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; Nothing&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  , _Criu_req&amp;#39;notifySuccess&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; Nothing&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  , _Criu_req&amp;#39;keepOpen&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; Nothing&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  , _Criu_req&amp;#39;features&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; Nothing&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;code&gt;build (type&#x27; .~ CHECK) :: Criu_req&lt;&#x2F;code&gt; builds a request for a &lt;code&gt;criu&lt;&#x2F;code&gt; check. So, an actual call
looks as follows:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;haskell&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; callCriu&amp;#39; &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;criu_service.socket&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; (build (type&amp;#39; &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;.~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; CHECK&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; :: Criu_req&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 style=&quot;color: #79B8FF;&quot;&gt;Right&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 style=&quot;color: #79B8FF;&quot;&gt;  Criu_resp&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&gt;    _Criu_resp&amp;#39;type&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; CHECK&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    , _Criu_resp&amp;#39;success&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; True&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    , _Criu_resp&amp;#39;dump&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; Nothing&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    , _Criu_resp&amp;#39;restore&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; Nothing&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    , _Criu_resp&amp;#39;notify&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; Nothing&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    , _Criu_resp&amp;#39;ps&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; Nothing&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    , _Criu_resp&amp;#39;crErrno&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; Nothing&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    , _Criu_resp&amp;#39;features&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; Nothing&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    , _Criu_resp&amp;#39;crErrmsg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; Nothing&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  )&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;From the service logs:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ criu service&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Warn  (cr-service.c:1023): Binding to local dir address!&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Warn  (cr-check.c:827): Skipping cgroup namespaces check&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Looks good.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Success! Lots to improve, but a good start. I&#x27;ll do a more in-depth post on this once it
matures.&lt;&#x2F;p&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;1&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;1&lt;&#x2F;sup&gt;
&lt;p&gt;See &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;criu.org&#x2F;RPC&quot;&gt;https:&#x2F;&#x2F;criu.org&#x2F;RPC&lt;&#x2F;a&gt; for more information.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;2&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;2&lt;&#x2F;sup&gt;
&lt;p&gt;It&#x27;s also on hackage, &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;criu-rpc-types-0.0.0.1&quot;&gt;https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;criu-rpc-types-0.0.0.1&lt;&#x2F;a&gt;,
however I&#x27;m not sure what the standard is for libraries that generate their code.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
</description>
      </item>
      <item>
          <title>Installing NixOs</title>
          <pubDate>Sun, 10 Jul 2016 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://blog.wayofthepie.dev/installing-nixos/</link>
          <guid>https://blog.wayofthepie.dev/installing-nixos/</guid>
          <description xml:base="https://blog.wayofthepie.dev/installing-nixos/">&lt;h1 id=&quot;introduction&quot;&gt;Introduction&lt;&#x2F;h1&gt;
&lt;p&gt;I&#x27;ve recently started diving into &lt;em&gt;&lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;nixos.org&#x2F;nix&#x2F;&quot;&gt;Nix&lt;&#x2F;a&gt;&lt;&#x2F;em&gt; and
&lt;em&gt;&lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;nixos.org&#x2F;&quot;&gt;NixOS&lt;&#x2F;a&gt;&lt;&#x2F;em&gt;. &lt;strong&gt;Nix&lt;&#x2F;strong&gt; is a package manager for Linux&#x2F;Unix systems, a
quick description from its own site:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Nix&#x27;s purely functional approach ensures that installing or upgrading one
package cannot break other packages. This is because it won&#x27;t overwrite
dependencies with newer versions that might cause breakage elsewhere. It
allows you to roll back to previous versions, and ensures that no package is
in an inconsistent state during an upgrade.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NixOs&lt;&#x2F;strong&gt; is an operating system which takes a declarative
approach to configuration and package management and uses Nix as its package
manager. Following is an example of creating a user on a NixOS system:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;haskell&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;users&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;extraUsers&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;alice &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  { isNormalUser&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; true;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    home &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&#x2F;home&#x2F;alice&amp;quot;&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&gt;    extraGroups &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;wheel&amp;quot;&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&gt;  };&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;security&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;enable &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt; true;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;An example of a fully configured NixOS system can be found
at &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;wayofthepie&#x2F;sky&quot;&gt;https:&#x2F;&#x2F;github.com&#x2F;wayofthepie&#x2F;sky&lt;&#x2F;a&gt;, this is the configuration I&#x27;m currently
using for my desktop.&lt;&#x2F;p&gt;
&lt;p&gt;In this post I&#x27;m going to run through how I installed NixOs, with the aim of helping anyone new
to NixOs through the installation process. Throughout the post I will be assuming
the following:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The NixOS install CD or USB installer - see
&lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;nixos.org&#x2F;nixos&#x2F;manual&#x2F;index.html#sec-installation&quot;&gt;https:&#x2F;&#x2F;nixos.org&#x2F;nixos&#x2F;manual&#x2F;index.html#sec-installation&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;An empty disk.&lt;&#x2F;li&gt;
&lt;li&gt;Boot with UEFI.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;These are not requirements, but will make the post easier to follow.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;partition&quot;&gt;Partition&lt;&#x2F;h1&gt;
&lt;p&gt;Let&#x27;s start! First boot into NixOs, whether from USB or the CD installer,
and find the disk you wish to install onto.
I  will use &lt;strong&gt;&#x2F;dev&#x2F;sda&lt;&#x2F;strong&gt; in this post, you can replace this
with whatever disk you are going to use.&lt;&#x2F;p&gt;
&lt;p&gt;The system will boot with UEFI so &lt;strong&gt;gdisk&lt;&#x2F;strong&gt; should be used to create the
partitions. This will create a GPT (GUID Partition Table) formatted disk.&lt;&#x2F;p&gt;
&lt;p&gt;With &lt;strong&gt;gdisk&lt;&#x2F;strong&gt; create the following partitions:&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Partition&lt;&#x2F;th&gt;&lt;th&gt;Size&lt;&#x2F;th&gt;&lt;th&gt;Type&lt;&#x2F;th&gt;&lt;th&gt;Code&lt;&#x2F;th&gt;&lt;th&gt;Filesystem&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&#x2F;dev&#x2F;sda1&lt;&#x2F;td&gt;&lt;td&gt;2 MiB&lt;&#x2F;td&gt;&lt;td&gt;&lt;em&gt;Bios Boot Partition&lt;&#x2F;em&gt;&lt;&#x2F;td&gt;&lt;td&gt;ef02&lt;&#x2F;td&gt;&lt;td&gt;None&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&#x2F;dev&#x2F;sda2&lt;&#x2F;td&gt;&lt;td&gt;1024 MiB&lt;&#x2F;td&gt;&lt;td&gt;&lt;em&gt;EFI&lt;&#x2F;em&gt;&lt;&#x2F;td&gt;&lt;td&gt;ef00&lt;&#x2F;td&gt;&lt;td&gt;vfat&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&#x2F;dev&#x2F;sda3&lt;&#x2F;td&gt;&lt;td&gt;119 GiB&lt;&#x2F;td&gt;&lt;td&gt;&lt;em&gt;Linux LVM&lt;&#x2F;em&gt;&lt;&#x2F;td&gt;&lt;td&gt;8e00&lt;&#x2F;td&gt;&lt;td&gt;xfs&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;If you have never used &lt;strong&gt;gdisk&lt;&#x2F;strong&gt; before, fear not! Just run &lt;code&gt;gdisk &#x2F;dev&#x2F;sda&lt;&#x2F;code&gt;
and answer the questions as outlined in the next section. If you know what you are
doing, you can skip the next section.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;creating-partitions-with-gdisk&quot;&gt;Creating Partitions With gdisk&lt;&#x2F;h2&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; gdisk &#x2F;dev&#x2F;sda&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 style=&quot;color: #B392F0;&quot;&gt;GPT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; fdisk&lt;&#x2F;span&gt;&lt;span&gt; (gdisk) version 1.0.1&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 style=&quot;color: #B392F0;&quot;&gt;Partition&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; table scan:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;  MBR:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; not present&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;  BSD:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; not present&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;  APM:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; not present&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;  GPT:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; not present&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 style=&quot;color: #B392F0;&quot;&gt;Creating&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; new GPT entries.&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 style=&quot;color: #B392F0;&quot;&gt;Command&lt;&#x2F;span&gt;&lt;span&gt; (?&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; for help&lt;&#x2F;span&gt;&lt;span&gt;): n&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Partition&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; number&lt;&#x2F;span&gt;&lt;span&gt; (1-128,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; default&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span&gt;): 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;First&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; sector&lt;&#x2F;span&gt;&lt;span&gt; (34-251658206,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; default =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 2048&lt;&#x2F;span&gt;&lt;span&gt;) or {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;+-}size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;{KMGTP}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Last&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; sector&lt;&#x2F;span&gt;&lt;span&gt; (2048-251658206,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; default =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 251658206&lt;&#x2F;span&gt;&lt;span&gt;) or {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;+-}size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;{KMGTP}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; +2M&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Current&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; type is &amp;#39;Linux filesystem&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Hex&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; code or GUID&lt;&#x2F;span&gt;&lt;span&gt; (L&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; to show codes, Enter =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 8300&lt;&#x2F;span&gt;&lt;span&gt;): ef02&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Changed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; type of partition to &amp;#39;BIOS boot partition&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 style=&quot;color: #B392F0;&quot;&gt;Command&lt;&#x2F;span&gt;&lt;span&gt; (?&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; for help&lt;&#x2F;span&gt;&lt;span&gt;): n&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Partition&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; number&lt;&#x2F;span&gt;&lt;span&gt; (2-128,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; default&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 2&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 style=&quot;color: #B392F0;&quot;&gt;First&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; sector&lt;&#x2F;span&gt;&lt;span&gt; (34-251658206,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; default =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 6144&lt;&#x2F;span&gt;&lt;span&gt;) or {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;+-}size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;{KMGTP}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Last&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; sector&lt;&#x2F;span&gt;&lt;span&gt; (6144-251658206,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; default =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 251658206&lt;&#x2F;span&gt;&lt;span&gt;) or {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;+-}size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;{KMGTP}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; +1G&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Current&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; type is &amp;#39;Linux filesystem&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Hex&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; code or GUID&lt;&#x2F;span&gt;&lt;span&gt; (L&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; to show codes, Enter =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 8300&lt;&#x2F;span&gt;&lt;span&gt;): ef00&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Changed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; type of partition to &amp;#39;EFI System&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 style=&quot;color: #B392F0;&quot;&gt;Command&lt;&#x2F;span&gt;&lt;span&gt; (?&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; for help&lt;&#x2F;span&gt;&lt;span&gt;): n&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Partition&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; number&lt;&#x2F;span&gt;&lt;span&gt; (3-128,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; default&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 3&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 style=&quot;color: #B392F0;&quot;&gt;First&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; sector&lt;&#x2F;span&gt;&lt;span&gt; (34-251658206,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; default =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 2103296&lt;&#x2F;span&gt;&lt;span&gt;) or {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;+-}size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;{KMGTP}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Last&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; sector&lt;&#x2F;span&gt;&lt;span&gt; (2103296-251658206,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; default =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 251658206&lt;&#x2F;span&gt;&lt;span&gt;) or {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;+-}size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;{KMGTP}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Current&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; type is &amp;#39;Linux filesystem&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Hex&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; code or GUID&lt;&#x2F;span&gt;&lt;span&gt; (L&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; to show codes, Enter =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 8300&lt;&#x2F;span&gt;&lt;span&gt;): 8e00&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Changed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; type of partition to &amp;#39;Linux LVM&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 style=&quot;color: #B392F0;&quot;&gt;Command&lt;&#x2F;span&gt;&lt;span&gt; (?&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; for help&lt;&#x2F;span&gt;&lt;span&gt;): w&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 style=&quot;color: #B392F0;&quot;&gt;Final&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;PARTITIONS!!&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 style=&quot;color: #B392F0;&quot;&gt;Do&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; you want to proceed?&lt;&#x2F;span&gt;&lt;span&gt; (Y&#x2F;N): y&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;OK&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; writing&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; new GUID partition table&lt;&#x2F;span&gt;&lt;span&gt; (GPT) to &#x2F;dev&#x2F;sda.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;The&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; operation has completed successfully.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In the above, we begin creating our first  new partition by using the command &lt;strong&gt;n&lt;&#x2F;strong&gt; when asked the
question &lt;code&gt;Command (? for help):&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;The first question we are asked is what number we would like to give, it&#x27;s our
first partition so &lt;strong&gt;1&lt;&#x2F;strong&gt;, this will create a partition called &lt;strong&gt;&#x2F;dev&#x2F;sda1&lt;&#x2F;strong&gt;
on &lt;strong&gt;&#x2F;dev&#x2F;sda&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Next, we are asked what sector to start on and what sector to end on. The starting
sector can be left empty - this means start at next unused sector, which in this
case is the start of the disk. As for which sector to end on, here we answer &lt;strong&gt;+2M&lt;&#x2F;strong&gt;
which will means &lt;em&gt;move 2 Mebibytes &lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; (&lt;strong&gt;MiB&lt;&#x2F;strong&gt;) forward from the starting sector&lt;&#x2F;em&gt;,
giving us a partition size of 2 Mebibytes.&lt;&#x2F;p&gt;
&lt;p&gt;Finally, we are asked if we want to change the type of the partition. Our first
partition should have the type &lt;strong&gt;ef02&lt;&#x2F;strong&gt;, more on why later.&lt;&#x2F;p&gt;
&lt;p&gt;That&#x27;s the first partition created, it should be clear now how the next two are
created.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;notes-on-the-partitions&quot;&gt;Notes On The Partitions&lt;&#x2F;h2&gt;
&lt;p&gt;Done? Good, to get a look at the disk layout run &lt;code&gt;gdisk -l &#x2F;dev&#x2F;sda&lt;&#x2F;code&gt;,
this should print out the following:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; gdisk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -l&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;sda&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 style=&quot;color: #B392F0;&quot;&gt;GPT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; fdisk&lt;&#x2F;span&gt;&lt;span&gt; (gdisk) version 1.0.1&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 style=&quot;color: #B392F0;&quot;&gt;Partition&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; table scan:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;  MBR:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; protective&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;  BSD:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; not present&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;  APM:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; not present&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;  GPT:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; present&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 style=&quot;color: #B392F0;&quot;&gt;Found&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; valid GPT with protective MBR&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; using&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; GPT.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Disk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;sda:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 251658240&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; sectors,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 120.0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; GiB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Logical&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; sector size:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 512&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; bytes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Disk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; identifier&lt;&#x2F;span&gt;&lt;span&gt; (GUID): 031652EE-C219-4EFB-84AB-9E310B14357E&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Partition&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; table holds up to&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 128&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; entries&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;First&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; usable sector is 34, last usable sector is&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 251658206&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Partitions&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; will be aligned on 2048-sector boundaries&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Total&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; free space is&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 2014&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; sectors&lt;&#x2F;span&gt;&lt;span&gt; (1007.0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; KiB&lt;&#x2F;span&gt;&lt;span&gt;)&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 style=&quot;color: #B392F0;&quot;&gt;Number&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  Start&lt;&#x2F;span&gt;&lt;span&gt; (sector)    End (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sector&lt;&#x2F;span&gt;&lt;span&gt;)  Size       Code  Name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;   1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            2048            6143   2.0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; MiB     EF02  BIOS boot partition&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;   2&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            6144         2103295   1024.0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; MiB  EF00  EFI System&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;   3&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;         2103296       251658206   119.0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; GiB   8E00  Linux LVM&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;grub-compatibility-dev-sda1&quot;&gt;Grub Compatibility: &#x2F;dev&#x2F;sda1&lt;&#x2F;h3&gt;
&lt;p&gt;This is used by &lt;strong&gt;grub&lt;&#x2F;strong&gt; &lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#2&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; at boot-time when booting off a GPT disk.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;efi-partition-dev-sda2&quot;&gt;EFI Partition: &#x2F;dev&#x2F;sda2&lt;&#x2F;h3&gt;
&lt;p&gt;UEFI will load files stored in this partition when booting.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;main-data-partition-dev-sda3&quot;&gt;Main Data Partition: &#x2F;dev&#x2F;sda3&lt;&#x2F;h3&gt;
&lt;p&gt;This is used for creating the logical volumes &lt;strong&gt;swap&lt;&#x2F;strong&gt; (4GB), &lt;strong&gt;&#x2F;&lt;&#x2F;strong&gt; (20GB),
&lt;strong&gt;&#x2F;home&lt;&#x2F;strong&gt; (20GB) and &lt;strong&gt;&#x2F;opt&lt;&#x2F;strong&gt; (20GB) in this post, it&#x27;s size should reflect
the sum of the sizes of all logical volumes you wish to create. Note that
any free space left of the disk can be used later, and those logical
volumes can be increased (or decreased) in size.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;linux-unified-key-setup-luks&quot;&gt;Linux Unified Key Setup (LUKS)&lt;&#x2F;h1&gt;
&lt;p&gt;Now that the partitions are setup, it&#x27;s time to encrypt the main partition,
&lt;strong&gt;&#x2F;dev&#x2F;sda3&lt;&#x2F;strong&gt;. This is optional and there are a few ways to do it, this post uses
&lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;guardianproject.info&#x2F;code&#x2F;luks&#x2F;&quot;&gt;LUKS&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;em&gt;&lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;gitlab.com&#x2F;cryptsetup&#x2F;cryptsetup&quot;&gt;cryptsetup&lt;&#x2F;a&gt;&lt;&#x2F;em&gt; tool is used to
create &lt;strong&gt;LUKS&lt;&#x2F;strong&gt; volumes. To search nix packages the command &lt;code&gt;nix-env -qaP packageName&lt;&#x2F;code&gt; &lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#3&quot;&gt;3&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;
can be used:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; nix-env&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -qaP&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; cryptsetup&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 style=&quot;color: #B392F0;&quot;&gt;nixos.cryptsetup&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  cryptsetup-1.7.0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now that we know &lt;strong&gt;cryptsetup&lt;&#x2F;strong&gt; is in the package list, we can install it with
&lt;code&gt;nix-env&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; nix-env&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; cryptsetup&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 style=&quot;color: #B392F0;&quot;&gt;installing&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;cryptsetup-1.7.0&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;building&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; path&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;s&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;&#x2F;nix&#x2F;store&#x2F;86mqcs95fb3gkkb74481fbf90zh5w98l-user-environment&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;created&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 44&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; symlinks in user environment&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;encrypting-dev-sda3&quot;&gt;Encrypting &#x2F;dev&#x2F;sda3&lt;&#x2F;h2&gt;
&lt;p&gt;I won&#x27;t go into detail about &lt;strong&gt;LUKS&lt;&#x2F;strong&gt; or &lt;strong&gt;cryptsetup&lt;&#x2F;strong&gt; here, we will also just
use the defaults for both. Simply run the following &lt;strong&gt;cryptsetup&lt;&#x2F;strong&gt; command and
enter a passphrase:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; cryptsetup&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -y -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; luksFormat &#x2F;dev&#x2F;sda3&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 style=&quot;color: #B392F0;&quot;&gt;WARNING!&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;========&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;This&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; will overwrite data on &#x2F;dev&#x2F;sda3 irrevocably.&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 style=&quot;color: #B392F0;&quot;&gt;Are&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; you sure?&lt;&#x2F;span&gt;&lt;span&gt; (Type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; uppercase yes&lt;&#x2F;span&gt;&lt;span&gt;): YES&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Enter&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; passphrase:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Verify&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; passphrase:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Command&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; successful.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;&#x2F;dev&#x2F;sda3&lt;&#x2F;strong&gt; is now encrypted! &lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#4&quot;&gt;4&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; The options passed to &lt;em&gt;cryptsetup&lt;&#x2F;em&gt; have
the following meaning:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;-y&lt;&#x2F;strong&gt; : prompt for passphrase twice.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;-v&lt;&#x2F;strong&gt; : verbose mode.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;luksFormat&lt;&#x2F;strong&gt; : initializes  a  LUKS partition and sets the initial
passphrase (for key-slot 0) &lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#5&quot;&gt;5&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Great, we now have an encrypted disk, but how is it used? Let&#x27;s jump back to
&lt;strong&gt;cryptsetup&lt;&#x2F;strong&gt;, it has a command  &lt;code&gt;cryptsetup luksOpen LUKS_DEVICE NAME&lt;&#x2F;code&gt;
which, when it verifies the passphrase (in our case), will open the &lt;strong&gt;LUKS&lt;&#x2F;strong&gt;
device and create a mapping to it (on the path &lt;strong&gt;&#x2F;dev&#x2F;mapper&#x2F;NAME&lt;&#x2F;strong&gt;)from the given name.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; cryptsetup luksOpen &#x2F;dev&#x2F;sda3 enc-data&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 style=&quot;color: #B392F0;&quot;&gt;Enter&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; passphrase for &#x2F;dev&#x2F;sda3:&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 style=&quot;color: #B392F0;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ls&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -la&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;mapper&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;total&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;drwxr-xr-x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  2&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; root root&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;      80&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Jul&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  9&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; 18:43 .&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;drwxr-xr-x&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 18&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; root root&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    3320&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Jul&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  9&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; 18:43 ..&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;lrwxrwxrwx&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; root root&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;       7&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Jul&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  9&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; 18:43 enc-data&lt;&#x2F;span&gt;&lt;span&gt; -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ..&#x2F;dm-0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Sweet! We now have an encrypted partition and know how to access it. All we have
left to do is setup logical volumes on the partition.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;lvm-setup&quot;&gt;LVM Setup&lt;&#x2F;h1&gt;
&lt;p&gt;Make sure our data partition - &lt;strong&gt;&#x2F;dev&#x2F;sda3&lt;&#x2F;strong&gt; - is open and mapped to the path
&lt;strong&gt;&#x2F;dev&#x2F;mapper&#x2F;enc-data&lt;&#x2F;strong&gt; with &lt;strong&gt;luksOpen&lt;&#x2F;strong&gt;, as mentioned above.&lt;&#x2F;p&gt;
&lt;p&gt;There are three steps to setting up &lt;em&gt;logical volumes&lt;&#x2F;em&gt;, creating a &lt;em&gt;physical volume&lt;&#x2F;em&gt;
(PV), a &lt;em&gt;volume group&lt;&#x2F;em&gt; (VG) and a &lt;em&gt;logical volume&lt;&#x2F;em&gt; (LV). If you are unfamiliar with
Logical Volume Management (LVM) the &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;index.php&#x2F;LVM&quot;&gt;Arch Linux Wiki
entry&lt;&#x2F;a&gt; is a good resource.&lt;&#x2F;p&gt;
&lt;p&gt;As a quick description, a physical disk can be divided into one or more
physical volumes, a volume group is made up of one or mode physical volumes and
logical volumes are created within volume groups.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;physical-volume&quot;&gt;Physical Volume&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;code&gt;pvcreate&lt;&#x2F;code&gt; is the command used to create physical volumes. Let&#x27;s use this
to create a physical volume on &lt;strong&gt;&#x2F;dev&#x2F;mapper&#x2F;enc-data&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pvcreate &#x2F;dev&#x2F;mapper&#x2F;enc-data&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 style=&quot;color: #B392F0;&quot;&gt;Physical&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; volume &amp;quot;&#x2F;dev&#x2F;mapper&#x2F;enc-data&amp;quot; successfully created&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;code&gt;pvdisplay&lt;&#x2F;code&gt; is used to display information on physical volumes on the
system.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pvdisplay&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 style=&quot;color: #B392F0;&quot;&gt;&amp;quot;&#x2F;dev&#x2F;mapper&#x2F;enc-data&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; is a new physical volume of &amp;quot;119.00 GiB&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;---&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; NEW Physical volume&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;PV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Name               &#x2F;dev&#x2F;mapper&#x2F;enc-data&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;VG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;PV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;               119.00&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; GiB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Allocatable&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;           NO&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;PE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;               0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Total&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; PE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;              0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Free&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; PE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;               0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Allocated&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; PE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;          0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;PV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; UUID               H3bhmD-KR9n-XaHb-03L6-TpN2-pYB5-DtUG7x&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;volume-group&quot;&gt;Volume Group&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;code&gt;vgcreate&lt;&#x2F;code&gt; is used to create a volume group. Lets create a volume group
called &lt;strong&gt;vg&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; vgcreate vg &#x2F;dev&#x2F;mapper&#x2F;enc-data&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 style=&quot;color: #B392F0;&quot;&gt;Volume&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; group &amp;quot;vg&amp;quot; successfully created&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;code&gt;vgdisplay&lt;&#x2F;code&gt; displays info on the systems volume groups.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; vgdisplay&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 style=&quot;color: #B392F0;&quot;&gt;---&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Volume group&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;VG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Name               vg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;System&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ID&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Format&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;                lvm2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Areas&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;        1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Metadata&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Sequence No&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;VG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Access             read&#x2F;write&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;VG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Status             resizable&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;MAX&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Cur&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Open&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;               0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Max&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; PV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Cur&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; PV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Act&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; PV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;VG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;               118.99&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; GiB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;PE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;               4.00&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; MiB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Total&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; PE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;              30462&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Alloc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; PE &#x2F; Size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;       0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Free&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  PE &#x2F; Size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;       30462&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 118.99&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; GiB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;VG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; UUID               O9EIaS-kX9Y-EXjo-I3zU-mPXY-9SVB-br2fEy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;logical-volume&quot;&gt;Logical Volume&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;code&gt;lvcreate&lt;&#x2F;code&gt; is used to create a logical volume. In this case, we want to
create four logical volumes from our volume group &lt;strong&gt;vg&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;lvcreate&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; swap&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; 8G vg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;lvcreate&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; root&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; 20G vg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;lvcreate&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; home&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; 20G vg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;lvcreate&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; opt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; 20G vg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Running the above four lvcreate commands will give us our logical volumes &lt;strong&gt;swap&lt;&#x2F;strong&gt;,
&lt;strong&gt;root&lt;&#x2F;strong&gt;, &lt;strong&gt;home&lt;&#x2F;strong&gt; and &lt;strong&gt;opt&lt;&#x2F;strong&gt;. Use &lt;code&gt;lvdisplay&lt;&#x2F;code&gt; to get more info on
them:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; lvdisplay&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 style=&quot;color: #B392F0;&quot;&gt;---&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Logical volume&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Path                &#x2F;dev&#x2F;vg&#x2F;swap&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Name                swap&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;VG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Name                vg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; UUID                F5DbgU-ymix-24Bh-JMTy-q2kL-ayvN-UpNUFB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Write Access        read&#x2F;write&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Creation host, time nixos, 2016-07-09 19:11:46 +0000&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Status              available&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# open                 0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                8.00&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; GiB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Current&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; LE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;             2048&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Segments&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;               1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Allocation&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;             inherit&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Read&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ahead sectors     auto&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; currently set to&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;     256&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Block&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; device           254:1&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 style=&quot;color: #B392F0;&quot;&gt;---&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Logical volume&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Path                &#x2F;dev&#x2F;vg&#x2F;root&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Name                root&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;VG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Name                vg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; UUID                FNLEbI-z05h-J7br-OMst-Ui0t-yq3r-BMNVjA&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Write Access        read&#x2F;write&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Creation host, time nixos, 2016-07-09 19:11:46 +0000&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Status              available&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# open                 0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                20.00&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; GiB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Current&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; LE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;             5120&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Segments&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;               1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Allocation&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;             inherit&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Read&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ahead sectors     auto&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; currently set to&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;     256&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Block&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; device           254:2&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 style=&quot;color: #B392F0;&quot;&gt;---&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Logical volume&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Path                &#x2F;dev&#x2F;vg&#x2F;home&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Name                home&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;VG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Name                vg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; UUID                zBLqKD-S6n7-BcTh-1oAF-TLvV-26Oc-dQ3wQR&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Write Access        read&#x2F;write&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Creation host, time nixos, 2016-07-09 19:11:46 +0000&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Status              available&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# open                 0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                20.00&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; GiB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Current&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; LE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;             5120&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Segments&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;               1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Allocation&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;             inherit&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Read&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ahead sectors     auto&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; currently set to&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;     256&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Block&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; device           254:3&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 style=&quot;color: #B392F0;&quot;&gt;---&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Logical volume&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Path                &#x2F;dev&#x2F;vg&#x2F;opt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Name                opt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;VG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Name                vg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; UUID                hr3GRw-d0P4-hDIw-HRIo-hqKK-Lql9-gD58a7&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Write Access        read&#x2F;write&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Creation host, time nixos, 2016-07-09 19:11:47 +0000&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Status              available&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# open                 0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LV&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                20.00&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; GiB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Current&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; LE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;             5120&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Segments&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;               1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Allocation&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;             inherit&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Read&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ahead sectors     auto&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; currently set to&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;     256&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Block&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; device           254:4&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Ok! That&#x27;s our disk setup ~90% complete.&lt;&#x2F;p&gt;
&lt;p&gt;#Final Disk Setup
All we have left to do now is format the boot partition and our logical volumes
and we ca start preparing NixOs for install. The formatting can be done with a short
script:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkfs.vfat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; BOOT &#x2F;dev&#x2F;sda2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkswap&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -L&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; swap &#x2F;dev&#x2F;vg&#x2F;swap&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;for&lt;&#x2F;span&gt;&lt;span&gt; lv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; root home opt&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;  mkfs.xfs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -L&lt;&#x2F;span&gt;&lt;span&gt; $lv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;vg&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;$lv&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;done&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This formats &lt;strong&gt;&#x2F;dev&#x2F;sda2&lt;&#x2F;strong&gt; with vfat and labels it &lt;strong&gt;BOOT&lt;&#x2F;strong&gt;, sets up a swap area
on our LV  &lt;strong&gt;&#x2F;dev&#x2F;vg&#x2F;swap&lt;&#x2F;strong&gt; and finally formats our LV&#x27;s &lt;strong&gt;&#x2F;dev&#x2F;vg&#x2F;root&lt;&#x2F;strong&gt;, &lt;strong&gt;&#x2F;dev&#x2F;vg&#x2F;home&lt;&#x2F;strong&gt;
and &lt;strong&gt;&#x2F;dev&#x2F;vg&#x2F;opt&lt;&#x2F;strong&gt; with &lt;strong&gt;xfs&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Awesome! Disk setup is now 100% complete!&lt;&#x2F;p&gt;
&lt;h1 id=&quot;install-nixos&quot;&gt;Install NixOS&lt;&#x2F;h1&gt;
&lt;p&gt;Now that our disk is ready we can prepare to install NixOs, this is pretty
short, and sweet.&lt;&#x2F;p&gt;
&lt;p&gt;First, we need to create the directories &lt;strong&gt;&#x2F;mnt&#x2F;boot&lt;&#x2F;strong&gt;, &lt;strong&gt;&#x2F;mnt&#x2F;home&lt;&#x2F;strong&gt; and
&lt;strong&gt;&#x2F;mnt&#x2F;opt&lt;&#x2F;strong&gt;. Then, we need to mount our LV&#x27;s - that we created in the previous
section - and our boot partition:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;mnt&#x2F;{boot,home,opt}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mount&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;vg&#x2F;root &#x2F;mnt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mount&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;vg&#x2F;home &#x2F;mnt&#x2F;home&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mount&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;vg&#x2F;opt &#x2F;mnt&#x2F;opt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mount&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;sda2 &#x2F;mnt&#x2F;boot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Before we install NixOs, we have to run &lt;code&gt;nixos-generate-config --root &#x2F;mnt&#x2F;&lt;&#x2F;code&gt; &lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#6&quot;&gt;6&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; nixos-generate-config&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --root&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;mnt&#x2F;&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 style=&quot;color: #B392F0;&quot;&gt;writing&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;mnt&#x2F;etc&#x2F;nixos&#x2F;hardware-configuration.nix...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;writing&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;mnt&#x2F;etc&#x2F;nixos&#x2F;configuration.nix...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&#x2F;mnt&#x2F;etc&#x2F;nixos&#x2F;hardware-configuration.nix&lt;&#x2F;strong&gt; contains NixOs configuration options based
on current hardware config.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&#x2F;mnt&#x2F;etc&#x2F;nixos&#x2F;configuration.nix&lt;&#x2F;strong&gt; is the main NixOs system configuration
module.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;We need to add some extra information to &lt;strong&gt;&#x2F;mnt&#x2F;etc&#x2F;nixos&#x2F;configuration.nix&lt;&#x2F;strong&gt; to
tell NixOs what our boot device is, and the fact that it is also a LUKS device:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;haskell&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;boot&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;loader&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;grub&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;device &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&#x2F;dev&#x2F;sda&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;;&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&gt;boot&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;initrd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;luks&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;devices &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&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&gt;  name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;root&amp;quot;&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&gt;  device &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&#x2F;dev&#x2F;sda3&amp;quot;&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&gt;  preLVM &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt; true;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}];&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This can be added anywhere in the file, however there should already be a
section for &lt;strong&gt;boot.loader.grub.device&lt;&#x2F;strong&gt; which is commented out. If so, uncomment
it and add the config for LUKS (&lt;strong&gt;boot.initrd.luks.devices&lt;&#x2F;strong&gt;) right after it.&lt;&#x2F;p&gt;
&lt;p&gt;Now we can install! Just run:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;nixos-install&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This can take some time, you should see information on what packages are being
downloaded and installed while the installation is running. You will be prompted
to enter the &lt;strong&gt;root&lt;&#x2F;strong&gt; password during the installationi, once you do that the
installation has completed and you can boot up your new NixOs install! &lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#7&quot;&gt;7&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;&lt;&#x2F;p&gt;
&lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h1&gt;
&lt;p&gt;The aim of this post was just to get NixOs installed, using the steps I used
on my own system. I plan on doing some more posts on Nix and NixOs once I get some time to
dive deeper into them.&lt;&#x2F;p&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;1&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;1&lt;&#x2F;sup&gt;
&lt;p&gt;1 MiB = 2&lt;sup&gt;20&lt;&#x2F;sup&gt; bytes = 1024 kibibytes = 1048576 bytes.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;2&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;2&lt;&#x2F;sup&gt;
&lt;p&gt;See &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;index.php&#x2F;GRUB#GUID_Partition_Table_.28GPT.29_specific_instructions&quot;&gt;Arch Linux - Grub GPT&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;3&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;3&lt;&#x2F;sup&gt;
&lt;p&gt;Short for &lt;code&gt;nix-env --query --available --attr-path packageName&lt;&#x2F;code&gt;. This searches
all available packages for the packageName, and will also print out its
attribute path (see &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;nixos.org&#x2F;wiki&#x2F;Howto_find_a_package_in_NixOS#Install_by_attribute&quot;&gt;Install By Attribute
Path&lt;&#x2F;a&gt;).&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;4&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;4&lt;&#x2F;sup&gt;
&lt;p&gt;Running &lt;code&gt;cryptsetup -y -v luksFormat &#x2F;dev&#x2F;sda3&lt;&#x2F;code&gt; will use the
default LUKS settings, which can be found by running &lt;code&gt;cryptsetup --help&lt;&#x2F;code&gt;.
In my case (v1.7.0 of &lt;strong&gt;cryptsetup&lt;&#x2F;strong&gt;) they are &lt;em&gt;LUKS1: aes-xts-plain64, Key: 256 bits, LUKS header hashing:
sha256, RNG: &#x2F;dev&#x2F;urandom&lt;&#x2F;em&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;5&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;5&lt;&#x2F;sup&gt;
&lt;p&gt;See
&lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;index.php&#x2F;Dm-crypt&#x2F;Device_encryption#Key_management&quot;&gt;Arch Linux - Luks KeyMangement&lt;&#x2F;a&gt;
for more information.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;6&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;6&lt;&#x2F;sup&gt;
&lt;p&gt;For more info on &lt;code&gt;nixos-generate-config&lt;&#x2F;code&gt; see Section 10 of the &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https:&#x2F;&#x2F;nixos.org&#x2F;nixos&#x2F;manual&#x2F;#sec-installation&quot;&gt;Nix
Install Manual&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;7&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;7&lt;&#x2F;sup&gt;
&lt;p&gt;When the system boots you will be asked for a password &lt;em&gt;before&lt;&#x2F;em&gt; the login prompt,
this is the password you used to create the LUKS volume.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
</description>
      </item>
    </channel>
</rss>
