summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2022-07-17 09:14:24 +0100
committerMatthew Lemon <matt@matthewlemon.com>2022-07-17 09:14:24 +0100
commit9a14f9d41f57673684f87c98fbfa7c3c588f93cd (patch)
tree5e00c5738efc9e98b896155e56ea140ff945ab94
parentbd856b0c078d14beb2d92cd7ef13c1f131b1bebc (diff)
update for jul 22
-rw-r--r--config.toml1
-rw-r--r--content/_index.md1
-rw-r--r--content/blog/cats/cat_kills/index.md2
-rw-r--r--content/blog/openbsd_partition.md39
-rw-r--r--layouts/partials/head.html17
-rw-r--r--static/css/style.css53
-rw-r--r--themes/problematic/layouts/partials/header.html6
7 files changed, 113 insertions, 6 deletions
diff --git a/config.toml b/config.toml
index c26650c..9b382b6 100644
--- a/config.toml
+++ b/config.toml
@@ -11,6 +11,7 @@ pygmentsUseClasses = true
copyright = "Copyright © 2022 Yulqen"
dark = "off"
highlight = true
+ custom_css = ["css/style.css"]
[menu]
[[menu.main]]
diff --git a/content/_index.md b/content/_index.md
index e9f54cf..69b4b5a 100644
--- a/content/_index.md
+++ b/content/_index.md
@@ -1,4 +1,5 @@
There is not much to see from the top of this particular mountain.
+<div>
<img src="/img/poser_guy.png" alt="Me Me on a mountain" style="margin-left: 0px;">
</div>
diff --git a/content/blog/cats/cat_kills/index.md b/content/blog/cats/cat_kills/index.md
index 36212db..4911c52 100644
--- a/content/blog/cats/cat_kills/index.md
+++ b/content/blog/cats/cat_kills/index.md
@@ -1,5 +1,5 @@
---
-title: "Cat Kill Log"
+title: "Cat Kill Log - 2021"
date: 2021-06-21T18:30:49+01:00
draft: false
category: "cats"
diff --git a/content/blog/openbsd_partition.md b/content/blog/openbsd_partition.md
new file mode 100644
index 0000000..3e05b4b
--- /dev/null
+++ b/content/blog/openbsd_partition.md
@@ -0,0 +1,39 @@
+---
+title: "Create new disk partition in OpenBSD"
+date: 2022-07-17T07:46:14+01:00
+slug: blog/create_new_partition_openbsd
+draft: false
+---
+
+1. When I installed OpenBSD, the autoinstaller created a partition table for me. Interestingly (and I only just discovered this), it left a percentage of the disk free. This is a brilliant strategy, because it saves you having to do a lot of annoying resizing when you want to change things. In my case, I wanted to add a new partition of about 10G or so, for a `/jails` thing - check out [https://www.tubsta.com/2020/01/creating-a-chroot-in-openbsd/](https://www.tubsta.com/2020/01/creating-a-chroot-in-openbsd/).
+1. Before I knew about the free space available, my thinking was to reduce the size of `/var` which is a whopping 32Gb on this laptop, waaaay more than I need. This isn't a web server I'm running here. So I started to think about shrinking that. Of course, I couldn't shrink the partition when it was mounted so I tried to remount, but I couldn't do that because it was in use, and the OS told me off for that. By the way, to find out what processes are using a partition, do `# fuser /dev/sd1a` - that tells you. Theoretically, you could go and kill all those processes and then unmount, but at that point, I thought I'd better do this using the OpenBSD installer shell.
+1. I rebooted to the Installer on a USB and hit 'S' to enter the shell.
+1. As a newbie, I thought I could just list the partitions of the drive (check `dmesg` to get the right drive - in my case it as `sd0`). But I got an error saying file not found. That is because there are no device nodes created for this razzer. Or that was my first thought anyway. To create the drive nodes, you do `cd /dev && sh ./MAKEDEV sd0` (replacing the correct drive of course). This creates the nodes.
+1. But when I did `# disklabel -p g sd0c` (you use `c` to get the whole drive), I saw only two partitions. Hm, I thought - why? The answer was because I encrypted my drive of course! One of the partitions I could see in the table was `RAID` - I needed to unencrypt the drive to access the partitions!
+1. This is where the famed OpenBSD man pages fell down for me - I couldn't work out how to use `bioctl` to do that (I knew it was `bioctl` though). So I hit the internet and found this: [https://alextsang.net/articles/20170422-192400/index.html](https://alextsang.net/articles/20170422-192400/index.html). The upshot is that to unlock a drive, you do `bioctl -c C -l /dev/sd0a softraid0`. You will be asked for your passphrase and you give it. This opens the volume in question which will reveal all the additional partitions within, tied to another device descriptor - in my case `sd2`. Check that with `# disklabel -p g /dev/sd2c` and there you are - you should see all your partitions.
+1. This was when I noticed that there was XGb of free space (look at the top of the partition table - it's there!). So I didn't need to shrink a volume - I needed to *add* a volume. So I came out of `disklabel` (Ctld+D) and rebooted into the machine.
+1. To a volume, I did `# disklabel -E sd2`. Then see the table with `p g` (`g`) gets sizes in Gb.
+1. `a` - it wanted to add `m` - fine. Do that.
+1. Size it appropriately as per the man pages (I tried to use `%` and `&` to denote sizes but it didn;t work, so just put a number that looked good in - aiming for 10% of available free space).
+1. `w` the parition. But notice - it did not create the mount point! I was a bit confused about that. I wanted to create the mount point now! But I couldn't - not even `disklabel` - the `m` option (modify) let me do it, and I'm damn sure the man pages say you can do it that way.
+1. By this time, I was resorting to using another *web page* (sorry, OpenBSD man pages): [https://cvs.afresh1.com/~andrew/o/faq/faq14.html](https://cvs.afresh1.com/~andrew/o/faq/faq14.html). After creating the partition, I now had to create a new file system on it. I did that with `# newfs sd2m`. At this point I could happily mount it, and I did: `# mount /dev/sd2m /jails`. THEN, I added it to `/etc/fstab` - For this, I reverted back to the original tutorial to get the correct flags ([https://www.tubsta.com/2020/01/creating-a-chroot-in-openbsd/](https://www.tubsta.com/2020/01/creating-a-chroot-in-openbsd/)), - this is how it looks in `/etc/fstab`:
+
+```console
+7da04eb499cd98e3.b none swap sw
+7da04eb499cd98e3.a / ffs rw,softdep,noatime 1 1
+7da04eb499cd98e3.l /home ffs rw,softdep,noatime,nodev,nosuid 1 2
+7da04eb499cd98e3.d /tmp ffs rw,softdep,noatime,nodev,nosuid 1 2
+7da04eb499cd98e3.f /usr ffs rw,softdep,noatime,nodev 1 2
+7da04eb499cd98e3.g /usr/X11R6 ffs rw,softdep,noatime,nodev 1 2
+7da04eb499cd98e3.h /usr/local ffs rw,softdep,noatime,wxallowed,nodev 1 2
+7da04eb499cd98e3.k /usr/obj ffs rw,softdep,noatime,nodev,nosuid 1 2
+7da04eb499cd98e3.j /usr/src ffs rw,softdep,noatime,nodev,nosuid 1 2
+7da04eb499cd98e3.e /var ffs rw,softdep,noatime,nodev,nosuid 1 2
+7da04eb499cd98e3.m /jails ffs rw 1 2
+swap /tmp mfs rw,nodev,nosuid,-s=800m 0 0
+swap /home/lemon/.cache mfs rw,nodev,nosuid,-s=3g 0 0
+```
+There is is, near the bottom: `/jails`.
+
+1. I rebooted, and prayed. I've had problems with fstab in the past. But not this time!
+1. Everything fired back up and all was well!
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
new file mode 100644
index 0000000..da8f4c4
--- /dev/null
+++ b/layouts/partials/head.html
@@ -0,0 +1,17 @@
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ {{ with .Site.Params.description -}}
+ <meta name="description" content="{{ . }}">
+ {{ end }}
+ {{ printf `<link rel="shortcut icon" href="%s">` ("favicon.ico" | absURL) | safeHTML }}
+ {{ with .OutputFormats.Get "rss" -}}
+ {{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
+ {{ end -}}
+
+ {{ range .Site.Params.custom_css -}}
+ <link rel="stylesheet" href="{{ . | absURL }}" type="text/css" media="screen">
+ {{- end}}
+
+ <title>{{ .Title }}</title>
+</head>
diff --git a/static/css/style.css b/static/css/style.css
new file mode 100644
index 0000000..6dc3657
--- /dev/null
+++ b/static/css/style.css
@@ -0,0 +1,53 @@
+@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@100;400;700&display=swap');
+
+* {
+ box-sizing: border-box;
+}
+
+.title {
+ font-size: 1.5em;
+ color: red;
+ background-color: yellow;
+}
+
+.subtitle {
+ font-size: 1.3em;
+ color: yellow;
+ background-color: red;
+}
+
+.sourceCode {
+ font-size: 0.86em;
+}
+
+figcaption {
+ font-size: 0.69em;
+}
+
+/* img { */
+/* display: block; */
+/* margin-left: auto; */
+/* margin-right: auto; */
+/* width: 50%; */
+/* } */
+
+body {
+ font-family: 'Roboto Slab', serif;
+ font-size: 22px;
+ margin-left: auto;
+ margin-right: auto;
+ max-width: 800px;
+ padding: 20px;
+}
+
+li {
+ margin-top: 1.2em;
+ margin-bottom: 1.2em;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ text-align: left;
+}
+a {
+ color: orange;
+}
diff --git a/themes/problematic/layouts/partials/header.html b/themes/problematic/layouts/partials/header.html
index 9a66449..7ad852b 100644
--- a/themes/problematic/layouts/partials/header.html
+++ b/themes/problematic/layouts/partials/header.html
@@ -1,12 +1,8 @@
<header id="banner">
<h2><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></h2>
<nav>
- <ul>
{{ range .Site.Menus.main.ByWeight -}}
- <li>
- {{ .Pre }}<a href="{{ .URL }}" title="{{ .Title }}">{{- .Name -}}</a>{{ .Post }}
- </li>
+ {{ .Pre }}<a href="{{ .URL }}" title="{{ .Title }}">{{- .Name -}}</a> | {{ .Post }}
{{- end }}
- </ul>
</nav>
</header>