Skip to content

Commit

Permalink
Journal posts
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl committed Sep 27, 2024
1 parent e753e09 commit 759484e
Show file tree
Hide file tree
Showing 11 changed files with 250 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Journal/2024.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ <h1>Year 2024<a name='Year 2024_1_1' class="offset-anchor"></a></h1>
</p>

<ul>
<li><a href="./2024/09.html" title="August" class="page">August</a></li>
<li><a href="./2024/07.html" title="July" class="page">July</a></li>
<li>June</li>
<li><a href="./2024/05.html" title="May" class="page">May</a></li>
<li><a href="./2024/04.html" title="April" class="page">April</a></li>
<li><a href="./2024/03.html" title="March" class="page">March</a></li>
Expand Down
5 changes: 5 additions & 0 deletions Journal/2024/07.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ <h1>July 2024<a name='July 2024_1_1' class="offset-anchor"></a></h1>


<span class="backlinks">
<hr class='footnotes'>
<b>Backlinks:</b>
<br />
<a href='../2024.html'>Journal:2024</a>

</span>


Expand Down
7 changes: 7 additions & 0 deletions Journal/2024/09.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
<li><b>09</b>
<ul>
<li><a href="./09/16.html" title="16" class="page">16</a></li>
<li><a href="./09/28.html" title="28" class="page">28</a></li>
</ul></li>
</ul></li>
<li><a href="../Index.html" title="Index" class="page">Index</a></li>
Expand All @@ -115,11 +116,17 @@

<h1>September 2024<a name='September 2024_1_1' class="offset-anchor"></a></h1>
<ul>
<li><a href="./09/28.html" title="Unlock ZFS with a key file" class="page">Unlock ZFS with a key file</a> (28/09/2024)</li>
<li><a href="./09/16.html" title="Convert from ZFS mirror to raidz" class="page">Convert from ZFS mirror to raidz</a> (16/09/2024)</li>
</ul>


<span class="backlinks">
<hr class='footnotes'>
<b>Backlinks:</b>
<br />
<a href='../2024.html'>Journal:2024</a>

</span>


Expand Down
3 changes: 2 additions & 1 deletion Journal/2024/09/16.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

<button type="button" class="btn btn-info btn-xs" role="button" onclick="location.href='../../../map.html'">Index</button>

<button type="button" class="btn btn-info btn-xs" role="button" onclick="location.href='../../Index.html'">Next</button>
<button type="button" class="btn btn-info btn-xs" role="button" onclick="location.href='./28.html'">Next</button>
</div>
</div>
<div>
Expand Down Expand Up @@ -91,6 +91,7 @@
<li><a href="../09.html" title="09" class="page">09</a>
<ul>
<li><b>16</b></li>
<li><a href="./28.html" title="28" class="page">28</a></li>
</ul></li>
</ul></li>
<li><a href="../../Index.html" title="Index" class="page">Index</a></li>
Expand Down
229 changes: 229 additions & 0 deletions Journal/2024/09/28.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="generator" content="Zim 0.75.2">
<meta name="description" content="Personal website for my programming, computing and finance hobbies">
<meta name="keywords" content="karl, hunter, go, programming, computing, finance, personal, hobby, defiant-fg, defiant">
<meta name="Zim template" content="HGE Bootstrap responsive template" />
<meta name="template author" content="Hugo Gaibor E.">
<meta name="Author" content="Karl Hunter">
<link rel="icon" href="../../../_resources/images/favicon.ico">

<title>Saturday 28 Sep 2024</title>

<!-- JS Jquery and Bootstrap scripts -->
<script type='text/javascript' src="https://karlhunter.co.uk/res/js/jquery-3.6.0.min.js" type="text/javascript"></script>
<script src="https://karlhunter.co.uk/res/js/bootstrap.min.js"></script>

<!-- Bootstrap core CSS -->
<link href="https://karlhunter.co.uk/res/css/bootstrap.css" rel="stylesheet" />

<!-- highlight module
Syntax highlinting libraries
Taken from https://highlightjs.org/
https://github.com/highlightjs/highlight.js
You can change higlight code box style by choosing a different css style below,
all styles were included for ease of customization
-->
<link rel="stylesheet" href="https://karlhunter.co.uk/res/highlight/styles/base16/github.min.css">
<script src="https://karlhunter.co.uk/res/highlight/highlight.min.js"></script>

<!-- HGE styles and JS functions for this template -->
<link href="https://karlhunter.co.uk/res/css/hge-bootstrap_common.css" rel="stylesheet">
<script src="https://karlhunter.co.uk/res/js/hge-bootstrap_common.js"></script>
<script src="https://karlhunter.co.uk/res/js/hge-bootstrap_multi-page.js"></script>
</head>

<body>
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-1 justify-content upper-nav-bar">
<div class="btn-toolbar" role="toolbar" aria-label="Button groups">
<div class="btn-group mr-2" role="group" aria-label="First group">
<span class="text-white">
<img id="toggleSideMenu" class="pt-0 p-0 px-0 btn" src="https://karlhunter.co.uk/res/images/menu.svg" height="22" alt="Menu">
</span>
</div>
</div>
<div class="btn-toolbar" role="toolbar" aria-label="Button groups">
<div class="btn-group mr-2" role="group" aria-label="Navigation group">
<button type="button" class="btn btn-info btn-xs" role="button" onclick="location.href='./16.html'">Prev</button>

<button type="button" class="btn btn-info btn-xs" role="button" onclick="location.href='../../../map.html'">Index</button>

<button type="button" class="btn btn-info btn-xs" role="button" onclick="location.href='../../Index.html'">Next</button>
</div>
</div>
<div>
<div class="btn-group mr-2" role="group" aria-label="Fifth group">
<button class="btn btn-warning btn-xs" id="scrollUp" onclick="scrollToTop();" style="display: none;"><span style="font-weight: 500;">Scroll Up</span></button>
</div>
<div class="btn-group mr-2" role="group" aria-label="Fifth group">
<button class="btn btn-success btn-xs pt-0 p-0 px-0" id="printMe" >
<img id="printImg" class="pt-0 p-0 px-1" style="padding:2px;" onclick="window.print();" src="https://karlhunter.co.uk/res/images/printer.svg" alt="Print">
</button>
</div>
</div>
</nav>

<div class="container-fluid">
<div class="row">
<nav class="col-md-3 col-lg-2 d-md-block bg-light sidebar d-print-none" id="sidebarMenuNav" style="padding-top: 40px;">
<div id="sidebarMenu">
<ul>
<li><a href="../../../About.html" title="About" class="page">About</a></li>
<li><a href="../../../Buy_Me_Coffee.html" title="Buy Me Coffee" class="page">Buy Me Coffee</a></li>
<li><a href="../../../Computing.html" title="Computing" class="page">Computing</a></li>
<li><a href="../../../Contact.html" title="Contact" class="page">Contact</a></li>
<li><a href="../../../index.html" title="index" class="page">index</a></li>
<li><a href="../../../Journal.html" title="Journal" class="page">Journal</a>
<ul>
<li><a href="../../2022.html" title="2022" class="page">2022</a></li>
<li><a href="../../2023.html" title="2023" class="page">2023</a></li>
<li><a href="../../2024.html" title="2024" class="page">2024</a>
<ul>
<li><a href="../01.html" title="01" class="page">01</a></li>
<li><a href="../02.html" title="02" class="page">02</a></li>
<li><a href="../03.html" title="03" class="page">03</a></li>
<li><a href="../04.html" title="04" class="page">04</a></li>
<li><a href="../05.html" title="05" class="page">05</a></li>
<li><a href="../07.html" title="07" class="page">07</a></li>
<li><a href="../09.html" title="09" class="page">09</a>
<ul>
<li><a href="./16.html" title="16" class="page">16</a></li>
<li><b>28</b></li>
</ul></li>
</ul></li>
<li><a href="../../Index.html" title="Index" class="page">Index</a></li>
</ul></li>
<li><a href="../../../Money.html" title="Money" class="page">Money</a></li>
<li><a href="../../../Projects.html" title="Projects" class="page">Projects</a></li>
</ul>

</div>
</nav>

<main role="main" class="col-md-9 col-lg-10 ml-sm-auto pt-3 px-4" id="pageContents">
<noscript>
<div style="padding: 10px">
<span style="color:#D48D8D">
<p>Javascript is not enabled</p>
<p>Most features won't</p>
<p>work correctly</p>
<p>Please enable javascript</p></span>
</div>
</noscript>

<h1>Saturday 28 Sep 2024<a name='Saturday 28 Sep 2024_1_1' class="offset-anchor"></a></h1>

<hr>


<h2>Unlock ZFS with a key file<a name='Unlock ZFS with a key file_1_2' class="offset-anchor"></a></h2>
<p>
Instead of typing a passphrase every time you mount your pool, why not try a key file. After you specify the location of the key file, during the mount of the zfs datasets, this location is queried for the key. You could store they key file on a USB drive or on a remote location (such as network share).
</p>

<p>
<tt>zfs change-key -l -o keylocation=</tt><a href="file:///mnt/network_share/zfs.key" title="file:///mnt/network_share/zfs.key" class="file"><tt>file:///mnt/network_share/zfs.key</tt></a> <tt>-o keyformat=[passphrase | hex | raw] name_pool/dataset_name</tt>
</p>

<p>
<tt>-l Load key</tt><br>
<tt>-o options</tt>
</p>

<p>
For example (using raw mode on a dataset called pictures on a pool named, pool)
</p>

<p>
<tt>zfs change-key -l -o keylocation=</tt><a href="file:///mnt/network_share/zfs.key" title="file:///mnt/network_share/zfs.key" class="file"><tt>file:///mnt/network_share/zfs.key</tt></a> <tt>-o keyformat=raw pool/pictures</tt>
</p>

<p>
key formats
</p>
<ul>
<li>hex</li>
<li>passphrase</li>
<li>raw</li>
</ul>

<p>
Let's generate a key file. You can use <tt>openssl</tt> or <tt>urandom</tt> to achieve this.
</p>

<p>
I used a raw file as my key, but you can specify a passphrase instead. That way, you can manually mount if you know the key. That being said, if you backup the raw file you should be able to access. You must backup the key file - for without this you cannot mount (unless you know the password).
</p>

<p>
<tt>openssl rand -out</tt> <a href="file:///path/to/keyfile/zfs.key" title="/path/to/keyfile/zfs.key" class="file"><tt>/path/to/keyfile/zfs.key</tt></a> <tt>32</tt>
</p>

<ul>
<li><tt>rand</tt> (randomisation tool)</li>
<li><tt>-out</tt> (path to the output file)</li>
<li><tt>32</tt> (32-bit key - ZFS supports up to 32 bits)</li>
</ul>

<p>
or
</p>

<p>
<tt>dd if=/dev/urandom of=</tt><a href="file:///path/to/keyfile/zfs.key" title="/path/to/keyfile/zfs.key" class="file"><tt>/path/to/keyfile/zfs.key</tt></a> <tt>bs=32 count=1</tt>
</p>

<ul>
<li><tt>bs</tt> (choose 32 for a 32-bit key - ZFS supports up to 32 bits)</li>
<li><tt>count</tt> (create 1 line)</li>
<li><tt>if</tt> (random device)</li>
<li><tt>of</tt> (path to the output file)</li>
</ul>

<p>
That's it. The key file will look like this:
</p>

<p>
<img src="./28/pasted_image.png">
</p>

<p>
This is OKAY, but if you want it in a human-readable format, consider using the passphrase or the hex option.
</p>

<p>
<tt>openssl rand -hex -out</tt> <a href="file:///path/to/keyfile/zfs.key" title="/path/to/keyfile/zfs.key" class="file"><tt>/path/to/keyfile/zfs.key</tt></a> <tt>32</tt>
</p>

<p>
<img src="./28/pasted_image001.png">
</p>




<span class="backlinks">
<hr class='footnotes'>
<b>Backlinks:</b>
<br />
<a href='../../../index.html'>index</a>

<br />
<a href='../../Index.html'>Journal:Index</a>

<br />
<a href='../09.html'>Journal:2024:09</a>

</span>



</main>
</div>
</div>
</body>
</html>
Binary file added Journal/2024/09/28/pasted_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Journal/2024/09/28/pasted_image001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion Journal/Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</div>
<div class="btn-toolbar" role="toolbar" aria-label="Button groups">
<div class="btn-group mr-2" role="group" aria-label="Navigation group">
<button type="button" class="btn btn-info btn-xs" role="button" onclick="location.href='./2024/09/16.html'">Prev</button>
<button type="button" class="btn btn-info btn-xs" role="button" onclick="location.href='./2024/09/28.html'">Prev</button>

<button type="button" class="btn btn-info btn-xs" role="button" onclick="location.href='../map.html'">Index</button>

Expand Down Expand Up @@ -111,6 +111,7 @@ <h1>Journal Post Index<a name='Journal Post Index_1_1' class="offset-anchor"></a
</p>

<ul>
<li><a href="./2024/09/28.html" title="Unlock ZFS with a key file" class="page">Unlock ZFS with a key file</a> (28/09/2024)</li>
<li><a href="./2024/09/16.html" title="Convert from ZFS mirror to raidz" class="page">Convert from ZFS mirror to raidz</a> (16/09/2024)</li>
<li><a href="./2024/07/23.html" title="Mount Shares Using SSH" class="page">Mount Shares Using SSH</a> (23/07/2024)</li>
<li><a href="./2024/05/12.html" title="ZFS Expansion" class="page">ZFS Expansion</a> (12/05/2024)</li>
Expand Down
Binary file modified Site.html
Binary file not shown.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ <h2>Me on the web<a name='Me on the web_1_4' class="offset-anchor"></a></h2>

<h2>Latest Journal Posts<a name='Latest Journal Posts_1_5' class="offset-anchor"></a></h2>
<ul>
<li><a href="./Journal/2024/09/28.html" title="Unlock ZFS with a key file" class="page">Unlock ZFS with a key file</a> (28/09/2024)</li>
<li><a href="./Journal/2024/09/16.html" title="Convert from ZFS mirror to raidz" class="page">Convert from ZFS mirror to raidz</a> (16/09/2024)</li>
<li><a href="./Journal/2024/07/23.html" title="Mount Shares Using SSH" class="page">Mount Shares Using SSH</a> (23/07/2024)</li>
<li><a href="./Journal/2024/05/12.html" title="ZFS Expansion" class="page">ZFS Expansion</a> (12/05/2024)</li>
Expand Down
1 change: 1 addition & 0 deletions map.html
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ <h1>Index of Website<a name='Index of Website_1_1' class="offset-anchor"></a></h
<li><a href="./Journal/2024/09.html" title="09" class="page">09</a>
<ul>
<li><a href="./Journal/2024/09/16.html" title="16" class="page">16</a></li>
<li><a href="./Journal/2024/09/28.html" title="28" class="page">28</a></li>
</ul></li>
</ul></li>
<li><a href="./Journal/Index.html" title="Index" class="page">Index</a></li>
Expand Down

0 comments on commit 759484e

Please sign in to comment.