<?xml version="1.0" encoding="utf-8" standalone="yes"?><?xml-stylesheet type="text/xsl" href="/index.xsl"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>./techtipsy</title><link>https://ounapuu.ee/categories/linux/</link><description>Recent content on ./techtipsy, a blog written by Herman Õunapuu.</description><generator>Hugo -- gohugo.io</generator><language>en-GB</language><managingEditor>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</managingEditor><webMaster>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</webMaster><lastBuildDate>Sun, 24 May 2026 06:00:00 +0300</lastBuildDate><atom:link href="https://ounapuu.ee/categories/linux/index.xml" rel="self" type="application/rss+xml"/><item><title>You can run Forza Horizon 6 on an unsupported AMD RX 400/500 series GPU on SteamOS</title><link>https://ounapuu.ee/posts/2026/05/24/forza/</link><pubDate>Sun, 24 May 2026 06:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2026/05/24/forza/</guid><description>Compatibility layers can work in more ways than I thought.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2026/05/24/forza/media/cover_hu_ee486cb9b26a259d.jpg" width="1200" height="630" alt="You can run Forza Horizon 6 on an unsupported AMD RX 400/500 series GPU on SteamOS" /><p>This post serves as a personal bookmark and a mirror
of <a href="https://www.reddit.com/r/linux_gaming/comments/1ti2xpd/fixes_for_forza_horizon_6_fh101_cpu_cores_or/">this fantastic guide by Ok-Pace-1900 on /r/linux_gaming</a>
to ensure that this information does not get lost.</p>
<p>I learned the hard way that the GPU I have in a DIY Steam Machine PC, the AMD RX
480, <a href="https://forza.net/news/forza-horizon-6-thank-you">is strictly unsupported by Forza Horizon 6.</a></p>
<blockquote>
<p>Forza Horizon 6 will not work for AMD users with GPUs based on the Polaris or Vega architectures and older (for
example Radeon 400 and 500 series players). These architectures are below our minimum supported specification.</p>
</blockquote>
<p>I knew that asking for a refund on Steam would be the easy way out. Deciding against it, I did a quick search for the
FH201 error code and stumbled on the Reddit post mentioned above. My CPU is good enough for Forza Horizon 6 (Intel
i5-10500), so the additional launch options command that worked for me is the following:</p>
<pre tabindex="0"><code>VKD3D_FEATURE_LEVEL=12_1 VKD3D_CONFIG=descriptor_heap,no_upload_h_vram RADV_EXPERIMENTAL=heap,sync2 radv_wait_for_vm_map_updates=true %command% 
</code></pre>








<figure class="center">
  <a href="/posts/2026/05/24/forza/media/gaming.jpg">
    <img src="/posts/2026/05/24/forza/media/gaming_hu_6d44b8474b83d8ff.webp"
     width="1000"
     height="591"
     loading="lazy"
     decoding="async"
     alt="It&#39;s Forza time!">

  </a>
  <figcaption class="center">It&#39;s Forza time!</figcaption>
</figure>

<p>Simple fix, but the context around this is actually kind of funny. The way a lot of Windows-only games work on SteamOS
is via a translation layer referred to as Proton. With this trick, you can pretend that your GPU has some DirectX
features that it actually does not have, but it doesn&rsquo;t matter since it can be successfully emulated via translation to
Vulkan, which the GPU supports well!</p>
<p>As a result, I can play Forza Horizon 6 on a hacky SteamOS build, with 1080p low or medium settings. Low settings is a
60 FPS experience, with medium settings some areas like Tokyo can struggle a bit and drop below it to ~40 FPS.</p>
<p>Now all I need to do is to get rid of the urge to splurge on a great GPU, which would also require a case and PSU
upgrade&hellip;</p>
<p>Slightly off-topic, but can <em>you</em> monitor your gaming PC via Prometheus Node Exporter and visualize it in Grafana? :)</p>









<figure class="center">
  <a href="/posts/2026/05/24/forza/media/node-exporter.png">
    <img src="/posts/2026/05/24/forza/media/node-exporter_hu_5c71223cb1c6ecfe.webp"
     width="1000"
     height="373"
     loading="lazy"
     decoding="async"
     alt="DIY Steam Machine metrics, visible in Grafana. Because I can.">

  </a>
  <figcaption class="center">DIY Steam Machine metrics, visible in Grafana. Because I can.</figcaption>
</figure>

]]></content:encoded></item><item><title>How I self-host this blog at home with a dynamic IPv4 address, IPv6 prefix, and a dash of Wireguard</title><link>https://ounapuu.ee/posts/2026/05/06/self-host-at-home/</link><pubDate>Wed, 06 May 2026 06:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2026/05/06/self-host-at-home/</guid><description>I think I've finally figured it out. For now.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2026/05/06/self-host-at-home/media/cover_hu_a0e9c758122adadf.jpg" width="1200" height="630" alt="How I self-host this blog at home with a dynamic IPv4 address, IPv6 prefix, and a dash of Wireguard" /><p>Networking has long been my Achilles heel. I know the very basics, but the more complex areas of networking have been a
bit puzzling to me. By the time I figured out how IPv4 works, I found IPv6 and that my ISP supports it.</p>
<p>Back to square one.</p>
<p>That didn&rsquo;t stop me from learning some bits, and after 8+ years of self-hosting as a hobby, I&rsquo;ve settled on a setup that
works for me and overcomes common residential internet connection nuances, such as dynamic IPv4 addresses and changing
IPv6 prefixes. I&rsquo;m sharing these tips and tricks with the goal of helping out other hobbyists out there that happen to
share a similar stack.</p>
<h2 id="background">
  <a class="heading-anchor" href="#background">Background<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>My ISP is polite enough to provide a public IPv4 address, and allowing incoming traffic is a toggle in their online
self-service. Not perfect, but at least you can do it. However, they charge about 6 EUR a month for the static IP
address service, which I am not willing to pay out of principle.</p>
<p>They also support IPv6, which is great, and they provide you a whole <code>/56</code> slice of it to play with using IPv6 prefix
delegation. Unfortunately they have configured the lease time for the prefix to be incredibly short: 26 <strong>minutes</strong>!</p>
<p>A router reboot or short power outage usually results in the IPv4 address and IPv6 prefix changing, which is really
annoying as my services become unavailable for a short time.</p>
<h2 id="dynamic-dns">
  <a class="heading-anchor" href="#dynamic-dns">Dynamic DNS<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>A common way to overcome the dynamic IP address limitation is to sign up with a provider to set up a DNS record that
changes whenever your home IP address changes. My domain registrar does not have this as a feature, and I&rsquo;m not
interested in using a different provider, so I went in a different direction and built a home-grown script that does the
same thing.</p>
<p>Initially, this script relied on a public service that tells you what your IP address is, and based on that I could
check if things have changed and I need to update my DNS record. This approach has one glaring catastrophic failure mode
though: that provider could lie to you one day and now you&rsquo;ve pointed your DNS records at the attackers&rsquo; servers. :)</p>
<p>I ignored that failure mode for a while, but once I learned about the effectiveness of LLM-based tooling, I decided to
give it a go and to build a better solution that takes into account my setup and requirements, while at the same time
saving me from the frustration of troubleshooting and debugging this in a late evening. I&rsquo;m still very limited on
available free time, so optimizing for that is a priority for me.</p>
<p>My main networking gear runs OpenWRT, and it supports running shell scripts periodically in a crontab. The router has
two WAN interfaces, one for IPv4 and one for IPv6. It already knows what IP address and prefix have been assigned to it,
so I don&rsquo;t have to rely on an external service provider for finding this out.</p>
<p>Handling IPv4 addresses is simple: check the IPv4 address of the WAN interface. Query your existing DNS records, diff
it, and if it has changed, push an update in a separate API call. Super simple!</p>
<p>With IPv6, the approach is slightly different. Instead of the WAN interface, I have to get the IPv6 address of the
target machine, and make sure that it&rsquo;s routable over the public internet. When you&rsquo;ve checked your network settings in
an IPv6 network, you may have noticed a lot of different IP addresses there, with lots of letters thrown into the mix.</p>
<p>Here&rsquo;s an example from the machine that is serving you this blog (likely out of date though!):</p>
<pre tabindex="0"><code>    inet6 fdb3:6dad:6dce::f41/128 scope global dynamic noprefixroute 
    inet6 fdb3:6dad:6dce:0:2e0:4cff:fe0c:9ddb/64 scope global noprefixroute 
    inet6 2001:7d0:856c:4000::f41/128 scope global dynamic noprefixroute 
    inet6 2001:7d0:856c:4000:2e0:4cff:fe0c:9ddb/64 scope global dynamic noprefixroute 
    inet6 fe80::2e0:4cff:fe0c:9ddb/64 scope link noprefixroute 
</code></pre><p>The two relevant ones are the ones that start with <code>2001:</code>, others are link-local or accessible over the local network
only. The shorter one consists of the IPv6 prefix part, and then the unique bit at the end is a predictable suffix that
the host gets. The other one also works, but is as far as I understand randomly generated and more difficult to predict
when we get around to next sections.</p>
<p>I know that there is probably a better way to do this, but I wanted to keep things simple enough so that I can
troubleshoot them if needed. It may be possible to trigger this updater script on events that WAN and WAN6 interfaces
send, but I have not validated this theory.</p>
<p>There are many different ways to find the IPv6 address of a particular host, so the script I have just tries multiple
approaches to find the one that we&rsquo;re looking for.</p>
<p><a href="/posts/2026/05/06/self-host-at-home/media/ddns.sh">Here&rsquo;s the script</a> in case you&rsquo;re interested in setting up something similar. It reads credentials from
an .env file and is built around <a href="https://api.zone.eu/">the Zone API</a>. On OpenWRT, the only dependency that you need to
install is <code>curl</code>, which to my surprise was not part of the default packages list, probably to save on space.</p>
<p>One lesson I learned from a previous iteration of the script: if you trigger DNS record updates every minute, then Zone
will actually reach out to you via e-mail telling you to cut that shit out, politely. It was just one missing <code>if</code>
statement, and yet it caused some frustration to engineers far away. Sorry!</p>
<h2 id="predictable-ip-addresses">
  <a class="heading-anchor" href="#predictable-ip-addresses">Predictable IP addresses<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>It&rsquo;s a good idea to set up static IP addresses for your hosts, both for IPv4 addresses and IPv6 prefix delegation via
DUID-s.</p>
<p>The OpenWRT GUI LuCI makes it quite simple, just set the addresses as static on the landing page for the hosts
that you are interested in forwarding traffic to, and you&rsquo;re done!</p>
<p>My recommendation here is to also set a predictable IPv6 suffix, otherwise all your IPv6 traffic rules may break once
again due to this nuance.</p>
<p>I like to make that host number the same for both IPv4 and IPv6, quick example:</p>
<ul>
<li><code>192.168.1.2</code></li>
<li><code>2001:7d0:854f:8e00::2</code></li>
</ul>
<p>Here&rsquo;s a configuration snippet example from <code>/etc/config/dhcp</code>, look for the <code>hostid</code> option:</p>
<pre tabindex="0"><code>config host
        option name &#39;mycoolserver&#39;
        option ip &#39;192.168.1.69&#39;
        list mac &#39;12:34:56:78:90:AB&#39;
        option duid &#39;yourduidgoeshere&#39;
        option hostid &#39;69&#39;
</code></pre><p>Apply with <code>service dnsmasq restart</code>.</p>
<p>In LuCI, as of OpenWRT 25.12, look for &ldquo;IPv6 token&rdquo;.</p>









<figure class="center">
  <a href="/posts/2026/05/06/self-host-at-home/media/ipv6token.png">
    <img src="/posts/2026/05/06/self-host-at-home/media/ipv6token_hu_556676a81dfcb972.webp"
     width="1000"
     height="103"
     loading="lazy"
     decoding="async"
     alt="Set an IPv6 token for a predictable IPv6 suffix.">

  </a>
  <figcaption class="center">Set an IPv6 token for a predictable IPv6 suffix.</figcaption>
</figure>

<p>Note that due to a bug, it doesn&rsquo;t seem to be possible to set a numeric IPv6 token via GUI, which is why you will need
to add it manually in CLI using the above approach.</p>
<h2 id="port-forwards-traffic-rules-potato-potahtoh">
  <a class="heading-anchor" href="#port-forwards-traffic-rules-potato-potahtoh">Port forwards, traffic rules, potato, potahtoh<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Whenever you want to make a local machine accessible on the internet for IPv4, the solution is simple: set up a port
forward to that particular machine, and you&rsquo;re done! It&rsquo;s a common enough flow for people who&rsquo;ve set up game servers and
the like, and well understood by more novice users.</p>
<p>With IPv6, port forwards don&rsquo;t help. You&rsquo;ll have to check one tab over at &ldquo;Traffic rules&rdquo; in OpenWRT GUI.</p>
<p>It&rsquo;s a common misconception that by using IPv6 you are exposing everything to the world as each device gets its own IPv6
address, but turns out that this is not the case in most common setups. By default, OpenWRT forwards only a few types of
traffic to IPv6 hosts, such as ICMP packets that make <code>ping</code> work between devices over IPv6 across the public internet.
If you are interested in allowing IPv6 clients to access services on your local server that has an IPv6 address, you
will have to explicitly allow it by adding a new traffic rule.</p>
<p>There&rsquo;s one issue with this approach that a lot of users seem to run into: if the IPv6 prefix changes, then all my
traffic rules that are pointing to a particular host are automatically broken!</p>
<p>Luckily there is a clever workaround implemented on OpenWRT that bypasses this issue. Assuming that you followed the
previous step and set yourself up with a predictable IPv6 suffix, when setting up a traffic rule, set the target device
up as <code>::69/-64</code>, just replace <code>69</code> with your actual suffix. The IPv6 prefix can now change, but the ports that you&rsquo;ve
made accessible on this specific host will remain working.</p>
<p>At this point, you should be all set with a reasonably well working setup where you&rsquo;ve handled the issues with dynamic
IPv4 and IPv6 prefix, and you can access your services over the public internet even when things happen.</p>
<h2 id="limitations">
  <a class="heading-anchor" href="#limitations">Limitations<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>One issue that this setup has is the fact that DNS change propagation takes time. Usually clients will pick up the new
records within 5 minutes, but in my professional career I&rsquo;ve seen some clients take up to 24 hours or longer to finally
start sending traffic to the new DNS record. Whenever your IP address changes, there will be a mini-outage. Not
catastrophic if you&rsquo;re just hosting hobby projects and personal services at home, but I wouldn&rsquo;t host anything
mission-critical in such a setup.</p>
<p>When your OpenWRT device is as underpowered as mine, then you may notice that the TLS encryption overhead when <code>curl</code>
-ing around can be significant. I have set my dynamic DNS script to run every 5 minutes, and it shows up on the CPU
usage graphs on my router.</p>









<figure class="center">
  <a href="/posts/2026/05/06/self-host-at-home/media/graph.png">
    <img src="/posts/2026/05/06/self-host-at-home/media/graph_hu_e39ff7b6e73083d4.webp"
     width="956"
     height="383"
     loading="lazy"
     decoding="async"
     alt="CPU usage graph on my router showing the scheduled dynamic DNS script doing work.">

  </a>
  <figcaption class="center">CPU usage graph on my router showing the scheduled dynamic DNS script doing work.</figcaption>
</figure>

<h2 id="wireguard-all-the-things">
  <a class="heading-anchor" href="#wireguard-all-the-things">Wireguard all the things!<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I know that Tailscale is a popular method of connecting up your devices and making your personal services privately
accessible over that, which significantly reduces your attack surface. Being behind a few updates or not being vigilant
enough is less of an issue compared to exposing your services over the public internet.</p>
<p>You don&rsquo;t necessarily need Tailscale for that though! If you just need a way to access your services over a private and
secure network, then setting up a dedicated mini PC or single-board computer is a very good starting point. Let it be
the server, allow traffic to move between the clients over the Wireguard interface, and you&rsquo;re all set!</p>
<p>Alternatively, if you have an OpenWRT router, then you can do it right there, but I found the GUI management setup to be
a bit clunky compared to deploying the plain configuration files to clients. When I <em>did</em> do that test, I discovered
quickly that my router and its single ARM CPU core with no cryptography extensions is too slow for managing my Wireguard
network, with speeds topping out at 20 Mbit/s. <strong>20.</strong> The LattePanda IOTA can easily saturate its gigabit link, as does
the ThinkPad T430, and even devices like the Orange Pi Zero can handle a theoretical maximum of about 240 Mbit/s over
Wireguard measured using <a href="https://github.com/cyyself/wg-bench">wg-bench</a>.</p>
<p>My current Wireguard host is <a href="/posts/2026/04/04/lattepanda/">the LattePanda V1, the most unstable computer in my fleet.</a>
With a USB adapter, it can push almost half a gigabit of traffic over Wireguard.</p>
<p>If you&rsquo;re like me, and you like hosting your services over Docker or Podman, then instead of listening on ports for all
interfaces on your containers (default behaviour when setting up port forwards), I recommend listening only on the
Wireguard interface. This makes the service only accessible over Wireguard, meaning that you only need to set up one
port forward and traffic rule to connect to the Wireguard network, and then you have access to all of your services. The
attack surface is significantly reduced, the whole Wireguard solution is stable and very small, and unless you leak your
private key, you are reasonably secure!</p>
<p>Here&rsquo;s a snippet from a compose file showcasing how to set this up for IPv4 and IPv6:</p>
<pre tabindex="0"><code>ports:
  - 10.69.69.12:2283:2283
  - &#34;[fded:abba:acca::12]:2283:2283&#34;
</code></pre><p>Want to make the service available over Wireguard <em>and</em> over the local network directly? Just add those to the list!
Note that if your local address changes and you don&rsquo;t update it in the compose file, your container will refuse to start
up as it cannot listen to the interface any longer, but you can mitigate that with the static IP addresses step.</p>
<p>When you are going with this route, it is unlikely but still possible that by the time the container starts up, the
Wireguard interface is not yet up. To resolve this, you can use <code>systemd</code> to set Wireguard up as a dependency that you
will have to wait for before the container starts up.</p>
<p>I manage my Wireguard connection with <code>wg-quick@interfacename</code> service. You can set up a <code>systemd</code> override for Docker,
or if you manage your Docker/Podman services via systemd, then you can set it up per-service using this pattern:</p>
<pre tabindex="0"><code># /etc/systemd/system/myimmichserver.service.d/override.conf
[Unit]
Requires=wg-quick@interfacename.service
After=wg-quick@interfacename.service
</code></pre><p>By the way, <code>systemd</code> overrides are also really useful for ensuring that your storage that your containers rely on is
properly mounted. If my service requires the path <code>/immich</code> to be available and mounted, add something like this:</p>
<pre tabindex="0"><code>BindsTo=immich.mount
After=immich.mount
</code></pre><p>If you unmount the mount point, it will also properly bring down the service. The service won&rsquo;t start if the mount point
is missing. I&rsquo;ve had the issue with containers seeing blank mount points more times than I&rsquo;d like to admit, and this has
eliminated this issue for me.</p>
<p><code>systemd</code> has received a lot of hate online, and I don&rsquo;t think it&rsquo;s fair. The ease with which you can set up
dependencies on your system, set up resource limits, make services more restricted to improve the security posture is
great and allows me to and avoid all sorts of failure modes. Production services that I&rsquo;m responsible for make use of
these <code>systemd</code> features, with great results.</p>
<p>For services that need to be public, such as Nextcloud and its public shareable links, this approach won&rsquo;t work,
obviously, but for things that only you and your family members use, this is a viable approach.</p>
<h2 id="conclusion">
  <a class="heading-anchor" href="#conclusion">Conclusion<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>This setup works well enough for me to confidently host my blog and self-hosted services off of it. I&rsquo;ve hit a lot of
paper cuts and frustrations along the way, but after following this guide, you don&rsquo;t have to do the same.</p>
<p>Yes, VLAN-s are intentionally missing from this guide. I&rsquo;ll get to them eventually, maybe by Q4 2037 given my lack of
free time.</p>
<p>And no, IPv6 isn&rsquo;t complicated, it&rsquo;s just different from what everyone is used to. If we started out with IPv6 right
from the get-go, <a href="https://www.ietf.org/archive/id/draft-thain-ipv8-00.html">we wouldn&rsquo;t be having dumb arguments online.</a></p>
]]></content:encoded></item><item><title>You can fake SSD-like disk speeds in any Linux VM, but it's unsafe (literally)</title><link>https://ounapuu.ee/posts/2026/04/08/ka-chow/</link><pubDate>Wed, 08 Apr 2026 06:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2026/04/08/ka-chow/</guid><description>Ka-chow!</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2026/04/08/ka-chow/media/cover_hu_f29d29bcfd325b39.jpg" width="1200" height="630" alt="You can fake SSD-like disk speeds in any Linux VM, but it's unsafe (literally)" /><p>Do you have a need for <del>speed</del> really fast disk performance?</p>
<p>Are you unwilling or <a href="/posts/2026/03/01/cloud/">unable</a> to buy/rent a machine with fast, NVMe-based storage?</p>
<p>Are you OK with potential data corruption?</p>
<p>Then <code>cache=unsafe</code> is the solution to all your problems!</p>
<p>We had an interesting conundrum at work recently. Our platform does not use a lot of resources, but there are bursts of
activity that require a lot of CPU and performant disk IO from our infrastructure. This was previously handled by
manually starting some expensive AWS EC2 instances to cope with the load, but this manual process was error-prone due to
the human factor (which did end up causing an actual production outage once), and AWS is stupidly expensive for what you
get in return.</p>
<p>Around this time I also learned about a Proxmox server that we were underutilizing. My goal was to investigate the
resources that we had available and to ensure that we didn&rsquo;t have to think about taking any manual actions while at the
same time not relying on AWS and its expensive resources.</p>
<p>I set up a few VM-s on the Proxmox machine, and did some testing. CPU, memory, that was all fine, but the IO-bound
workloads that we had to run during those bursty periods would still be relatively slow. Not much slower than the main
infrastructure provider that we were using, but slow enough for a beefy machine to not be able to handle more than a few
parallel IO-heavy workloads running at the same time.</p>
<p>We exhausted a few other wild-ass ideas during the investigation:</p>
<ul>
<li>Docker on a RAM-backed storage drive
<ul>
<li>online resources did not inspire confidence in this working well, so we didn&rsquo;t try this</li>
</ul>
</li>
<li>optimizing the workload to not be IO-heavy
<ul>
<li>unsuccessful after spending a few hours on it, the high IO was a consequence of making an intentional trade-off to
reduce CPU load, and the IO requirement was much more manageable</li>
</ul>
</li>
<li>putting certain folders in the container itself on RAM-backed storage
<ul>
<li>highly container specific, and did not yield the desired results</li>
</ul>
</li>
</ul>
<p>Then one day I was browsing around Proxmox and noticed an interesting option on the virtual storage drives: setting the
cache mode to <code>unsafe</code>. With this one trick, your VM will see really fast disk speeds up to a certain point, and it&rsquo;s
invisible from the perspective of your workloads, no customization needed. In a way, this is like one of the RAM-backed
storage options, but for the whole VM.</p>
<p>The major trade-off is that an unexpected shutdown of the VM or the VM host will likely result in data corruption. This
is because you&rsquo;re writing everything to memory first, and <em>eventually</em> the writes will end up on persistent storage,
whenever the disks catch up with you. Something happens while changes are in memory, and they are lost.</p>
<p>In our case, the data corruption risk is completely OK, as the workloads are ephemeral, the results of the work are
sent to another machine immediately after completion, and the configuration of the machine is largely automated with
Ansible.</p>
<p>One instance of our workload would usually result in writing 50 MB to disk, and we observed about 300-500 IOPS of
performance from HDD-backed storage. The disks were not able to handle more than one at a time if we cared about
execution time.</p>
<p>With the <code>unsafe</code> trick, and on some relatively old hardware (assume DDR3 memory), we saw numbers as high as 15K IOPS
and disk throughput of 500+ MB/s. This was more than enough to handle peak loads, and the resources were always on and
available on a rented server with a stable price that compared extremely well to AWS.</p>
<p>Cloud service providers have their benefits, sure, but when all you need is raw speed and configurability to make it
happen, then owning a physical Linux server (or a few of them for redundancy) is a no-brainer, slam-dunk decision, as
long as you have someone in your team that knows how to manage one. Since you&rsquo;re working with Linux VM-s already in the
cloud, then you already have that person in your team, don&rsquo;t you? :)</p>
]]></content:encoded></item><item><title>I gave the MacBook Pro a try</title><link>https://ounapuu.ee/posts/2026/03/04/apfel/</link><pubDate>Wed, 04 Mar 2026 06:00:00 +0200</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2026/03/04/apfel/</guid><description>Dancing with the devil.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2026/03/04/apfel/media/cover_hu_5f1c1caf8eadf1a6.jpg" width="1200" height="630" alt="I gave the MacBook Pro a try" /><p>I got the opportunity to try out a MacBook Pro with the M3 Pro with 18GB RAM (not Pro).</p>
<p>I&rsquo;ve been rocking a <a href="/posts/2024/04/12/lenovo-p14s-gen4/">ThinkPad P14s gen 4</a>
and am reasonably happy with it, but after realizing that I am the only person in the whole company <em>not</em> on a MacBook,
and one was suddenly available for use, I set one up for work duties to see if I could ever like using one.</p>
<p>It&rsquo;s nice.</p>
<p>I&rsquo;ve used various flavours of Linux on the desktop since 2014, starting with Linux Mint. 2015 was the year I deleted the
Windows dual boot partition. Over those years, the experience on Linux and especially Fedora Linux has improved a lot,
and for some reason it&rsquo;s controversial to say that I love GNOME and its opinionated approach to building a cohesive and
yet functional desktop environment.</p>
<p>When transitioning over to macOS, I went in with an open mind. I won&rsquo;t heavily customise it, won&rsquo;t install Asahi Linux
on it, or make it do things it wasn&rsquo;t meant to do. This is an appliance, I will use it to get work done and that&rsquo;s it.</p>
<p>With this introduction out of the way, here are some observations I&rsquo;ve made about this experience so far.</p>
<h2 id="ergonomics">
  <a class="heading-anchor" href="#ergonomics">Ergonomics<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>The first stumbling block was an expected one: all the shortcuts are wrong, and the Ctrl-Super-Alt friendship has been
replaced with these new weird ones. With a lot of trial and error, it is not that difficult to pick it up, but I still
stumble around with copy-paste, moving windows around, or operating my cursor effectively. It certainly doesn&rsquo;t help
that in terminal windows, Ctrl is still king, while elsewhere it&rsquo;s Cmd.</p>
<p>Mouse gestures are nice, and not that different from the GNOME experience.</p>
<p>macOS has window snapping by default, but only using the mouse. I had to install a specific program to enable window
moving and snapping with keyboard shortcuts <a href="https://rectangleapp.com/">(Rectangle)</a>, which is something I use heavily
in GNOME. Odd omission by Apple.</p>
<p>For my Logitech keyboard and mouse to do the right thing, I did have to install the Logitech Logi+ app, which is not
ideal, but is needed to have an acceptable experience using my MX series peripherals, especially the keyboard where it
needs to remap some keys for them to properly work in macOS.</p>
<p>I still haven&rsquo;t quite figured out why Page up/down and Home/End keys are not working as they should be. Also, give my
Delete key back!</p>
<p>Opening the laptop with Touch ID is a nice bonus, especially on public transport where I don&rsquo;t really want my neighbour
to see me typing in my password.</p>
<p>The macOS concept of showing open applications that don&rsquo;t have windows on them as open in the dock is a strange choice,
that has caused me to look for those phantom windows and is generally misleading.</p>
<p>Not being able to switch between open windows instead of applications echoes the same design choice that GNOME made, and
I&rsquo;m not a big fan of it here as well. But at least in GNOME you can remap the Alt+Tab shortcut to fix it.</p>
<h2 id="installing-stuff">
  <a class="heading-anchor" href="#installing-stuff">Installing stuff<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>The default macOS application installation process of downloading a .dmg file, then opening it, then dragging an icon in
a window to the Applications folder feels super odd.</p>
<p>Luckily I was aware of the tool <code>brew</code> and have been using that heavily to get everything that I need installed, in a
Linux-y way.</p>
<h2 id="permissions">
  <a class="heading-anchor" href="#permissions">Permissions<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I appreciate the concern that macOS has about actions that I take on my laptop, but my god, the permission popups get
silly sometimes. When a CLI app is doing things and accessing data on my drive, I can randomly be presented with a
permissions pop-up, stealing my focus from writing a Slack message.</p>
<h2 id="day-to-day-work">
  <a class="heading-anchor" href="#day-to-day-work">Day to day work<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Video calls work really well, I can do my full stack engineer things, and overall things work, even if it is sometimes
slightly different.</p>
<p>The default Terminal app is not good, I&rsquo;m still not quite sure why it does not close the window when I exit it, that
&ldquo;Process exited&rdquo; message is not helpful.</p>
<h2 id="hardware">
  <a class="heading-anchor" href="#hardware">Hardware<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>No contest, the hardware on a MacBook Pro feels nice and premium compared to the ThinkPad P14s gen 4. The latter now
feels like a flexible plastic piece of crap.</p>
<p>The screen is beautiful and super smooth due to the higher refresh rate.</p>
<p>The MacBook does not flex when I hold it.</p>
<p>Battery life is phenomenal, the need to have a charger is legitimately not a concern in 90% of the situations I use a
MacBook in.</p>
<p>Keyboard is alright, good to type on, but layout is not my preference.</p>
<p>M3 Pro chip is fast as heck. 18 GB of memory is a solid downgrade from 32 GB, but so far it has not prevented me from
doing my work.</p>
<p>I have never heard the fan kick on, even when testing a lot of Go code in dozens of containers, pegging the CPU at 100%,
using a lot of memory, and causing a lot of disk writes. I thought that I once heard it, but no, that fan noise was
coming from a nearby ThinkPad.</p>
<p>The alumin<strong>i</strong>um case does have one downside: the MacBook Pro is incredibly slippery. I once put it in my backpack
and it made a loud <em><strong>thunk</strong></em> as it hit the table that the backpack was on. Whoops.</p>
<h2 id="external-displays">
  <a class="heading-anchor" href="#external-displays">External displays<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>macOS does not provide scaling options on my 3440x1440p ultra-wide monitor. Even GNOME has that, with fractional
scaling!</p>
<p>The two alternatives are to use a lower resolution (disgusting), or increase the text size across the OS so that I
don&rsquo;t suffer with my poor eyesight.</p>
<h2 id="apple-id-and-app-store">
  <a class="heading-anchor" href="#apple-id-and-app-store">Apple ID and App Store<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Never needed those. I like that. Having used an iPhone for a while, I sort of expected this to be a requirement, but no,
you can completely ignore those aspects of macOS and work with a local account. Even Windows 11 doesn&rsquo;t want to allow
that!</p>
<h2 id="language-switching">
  <a class="heading-anchor" href="#language-switching">Language switching<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Switching the keyboard language using the keyboard shortcut is broken about 50% of the time, which feels odd given that
it&rsquo;s something that just works on GNOME. This is quite critical for me since I shift between the Estonian and US
keyboard a lot when working, as the US layout has the brackets and all the other important characters in the right
places for programming and writing, while Estonian keyboard has all the Õ Ä Ö Ü-s that I need.</p>
<h2 id="the-day-it-fell-apart">
  <a class="heading-anchor" href="#the-day-it-fell-apart">The day it fell apart<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I upgraded to macOS 26.3 Tahoe on 23rd of February. SSH worked in the morning. Upgrade during lunch, come back, bam,
broken.</p>
<p>The SSH logins would halt at the part where public key authentication was taking place, the process just hung. I
confirmed that by adding <code>-vvv</code> into the SSH command.</p>
<p>With some vibe-debugging with Claude Code, I found that something with the SSH agent service had broken after the
upgrade. One reasonably simple fix was to put this in your <code>.zshrc</code>:</p>
<pre tabindex="0"><code>export SSH_AUTH_SOCK=$(mktemp -d)/agent.sock
ssh-agent -a &#34;$SSH_AUTH_SOCK&#34; &gt; /dev/null 2&gt;&amp;1
ssh-add --apple-use-keychain ~/.ssh/id_ed25519 2&gt;/dev/null
</code></pre><p>Then it works in the shell, but all other git integrations, such as all the repos I have cloned and am using via
IntelliJ IDEA, were still broken.</p>
<p>Claude suggested that I build my own SSH agent, and install that until this issue is fixed. That&rsquo;s when I decided to
stop.</p>
<p>macOS was supposed to just work, and not get into my way when doing work. This level of workaround is something I expect
from working with Linux, and even there it usually doesn&rsquo;t get that odd, I can roll back a version of a package easily,
or fix it by pulling in the latest development release of that particular package.</p>
<h2 id="conclusion">
  <a class="heading-anchor" href="#conclusion">Conclusion<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I went into this experiment with an open mind, no expectations, and I have to admit that a MacBook Pro with M3 Pro chip
is not bad at all, as long as it works.</p>
<p>Unfortunately it doesn&rsquo;t work for me right now. I might have gotten very unlucky with this issue and the timing, but
first impressions matter a lot. The hardware can be nice and feel nice, but if the software lets me down and stops me
from doing what&rsquo;s more important, then it makes the hardware useless.</p>
<p>It turns out that I like Linux and GNOME a lot. Things are simple, improvements are constant and iterative in nature, so
you don&rsquo;t usually notice it (with Wayland and Pipewire being rare exceptions), and you have more control when you need
to fix something. Making those one-off solutions like a DIY coding agent sandbox, or a backup script, or setting up
<a href="/posts/2022/07/09/btrbk-is-awesome/">snapshots</a> on my workstation are also super easy.</p>
<p>If <a href="https://asahilinux.org/">Asahi Linux</a> had 100% compatibility on all modern M-series MacBooks, then that would be a
killer combination.<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup></p>
<p>Until then, back to the ol&rsquo; reliable ThinkPad P14s gen 4 I go. I can live with fan noise, Bluetooth oddities and Wi-Fi
roaming issues, but not with something as basic as SSH not working one day.<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup></p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>any kind billionaires want to bankroll the project? Oh wait, that&rsquo;s an oxymoron.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>the fan noise can actually be fixed quite easily by setting a lower temperature target on the Ryzen APU and tuning
the fan to only run at the lowest speed after a certain temperature threshold.&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>SteamOS on a ThinkPad P14s gen 4 (AMD) is quite nice</title><link>https://ounapuu.ee/posts/2026/02/09/year-of-the-linux-desktop/</link><pubDate>Mon, 09 Feb 2026 06:00:00 +0200</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2026/02/09/year-of-the-linux-desktop/</guid><description>This is the year of the Linux (gaming) desktop. Or laptop.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2026/02/09/year-of-the-linux-desktop/media/cover_hu_fedc9f8a0aa21ac7.jpg" width="1200" height="630" alt="SteamOS on a ThinkPad P14s gen 4 (AMD) is quite nice" /><p>In April 2024, I wrote on the Lenovo ThinkPad P14s gen 4
and <a href="/posts/2024/04/12/lenovo-p14s-gen4/">how it does not suck under Linux.</a></p>
<p>That is still true. It&rsquo;s been fantastic, and a very reliable laptop during all that time.</p>
<p>The P14s gen 4 comes with a CPU that is still solid today, the AMD Ryzen 7 PRO 7840U, and that comes with impressive
integrated graphics in the form of an AMD Radeon 780M.</p>
<p><a href="/posts/2024/06/02/steam-deck/">I&rsquo;ve had a Steam Deck.</a></p>
<p><a href="/posts/2025/12/01/steam-machine/">I&rsquo;ve also accidentally built a Steam Machine.</a></p>
<p>I <em>had</em> to put SteamOS on this laptop to see how well it does. I did a quick Bazzite test the last time around, but
after being impressed with how well the stock SteamOS image runs on a random machine with an AMD GPU, I had to test
that, too.</p>
<h2 id="installing-steamos-on-usb-storage">
  <a class="heading-anchor" href="#installing-steamos-on-usb-storage">Installing SteamOS on USB storage<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>The normal way to install SteamOS on a machine is
to <a href="https://help.steampowered.com/en/faqs/view/65B4-2AA3-5F37-4227">take the Steam Deck recovery image</a> and to install
it on your own machine that has one NVMe SSD.</p>
<p>I didn&rsquo;t want to do <em>exactly</em> that, I wanted to run it off of an USB SATA SSD, which the recovery image does not
support, as it hard-codes the target SSD for the SteamOS installation to <code>/dev/nvme0n1</code>. There&rsquo;s a handy project out
there <a href="https://github.com/louij2/steamos_custom_install">that customizes the recovery script</a> to allow you to install
SteamOS to <em>any</em> target device, but I learned about that after the fact.</p>
<p>I went a slightly different route: I imaged the SteamOS installation from
my <a href="/posts/2025/12/01/steam-machine/">DIY Steam Machine build,</a> wrote it to the 4TB USB SSD that I had available for
testing, and after that I resized the <code>/home</code> partition to take up the full disk. <em>Bam,</em> clean SteamOS on a USB SSD!</p>
<p>Oh, and before I did that, I did the same process but to a 128 GB Samsung FIT USB 3.0 thumb drive.</p>
<p><strong><em>It worked.</em></strong></p>
<p>The game library images did load a bit slowly, but it was a great demonstration of how low you can go with the hardware
requirements. I wouldn&rsquo;t recommend <em>actually</em> installing games on such a setup as that would likely kill the USB thumb
drive very quickly.</p>
<h2 id="performance">
  <a class="heading-anchor" href="#performance">Performance<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I ran the SteamOS setup on this laptop over a USB-C dock that only supports running at up to 4K at 30Hz, so I did
testing at 1080p 60Hz setup. You&rsquo;re unlikely to want to run this setup at 4K anyway, unless you&rsquo;re a fan of light, easy
to run games like Katamari or Donut County.</p>
<p>In most games, the experience was enjoyable. 1080p resolution, maybe change the settings to medium or low in some cases,
and you&rsquo;ll likely have a solid gaming experience.</p>
<p>Forza Horizon 4? No problem, 1080p high settings and a solid, consistent experience.</p>
<p>Need for Speed Hot Pursuit Remastered was an equally enjoyable experience, and I did not have to turn the settings down
from high/ultra.</p>
<p>God of War Ragnarök was pushing the setup to the limits. With 1080p, low/medium settings you can expect 30+ FPS. If you
include AMD FSR settings in the mix and also enable FSR frame generation, you can have a perfectly enjoyable 50-60 FPS
experience. Some UI hints were a bit &ldquo;laggy&rdquo; with frame generation, but I&rsquo;m genuinely surprised how well that rendering
trick worked. I&rsquo;ll admit it, my eyesight is not the best, but given the choice of a crisp but laggy picture, and a
slightly blurrier but smoother experience, I&rsquo;d pick the latter. After a pint of Winter Stout, you won&rsquo;t even notice the
difference.<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup></p>
<p>Wreckfest was also heaps fun. It did push the limits of the GPU at times, but running it at 1080p and medium/high
settings is perfectly enjoyable.</p>
<p>The observed power usage throughout the heaviest games measured via SteamOS performance metrics (<code>mangohud</code>) were around
30-40 W, with the GPU using up the most of that budget. In most games, the CPU was less heavily loaded, and in the games
that required good single thread performance, it could provide it.</p>
<h2 id="the-steamos-revolution">
  <a class="heading-anchor" href="#the-steamos-revolution">The SteamOS revolution<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I like SteamOS. It&rsquo;s intentionally locked down in some aspects (but you can unlock it with one command), and the
Flatpak-only approach to software installation will make some people mad, but I like this balance. It almost feels like
a proper console-type experience, <em>almost</em>.</p>
<p>Valve does not officially support running SteamOS on random devices, but they haven&rsquo;t explicitly prevented it either.
I <em><strong>love</strong></em> that.</p>
<p>Take any computer from AMD that has been manufactured from the last 5 years, slap SteamOS on it, and there is a very
high chance that you&rsquo;ll have a lovely gaming experience, with the level of detail and resolution varying depending on
what hardware you pick.</p>
<p>A top of the line APU from AMD seems to do the job well enough for most casual gamers like
myself, and if <a href="https://frame.work/ee/en/desktop?tab=gaming">the AMD Strix Halo based systems were more affordable,</a> I
would definitely recommend getting one if you want a small but efficient SteamOS machine.</p>
<p>Last year, we saw the proliferation of gaming-oriented Linux distros.</p>
<p>The Steam Machine is shipping this year.</p>
<p><a href="https://www.youtube.com/watch?v=URbW3j_GYKg">DankPods is covering gaming on Linux.</a></p>
<p>2026 <em><strong>has</strong></em> to be the year of the Linux (gaming) desktop.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>that&rsquo;s the <em>tipsy</em> part in <em>techtipsy</em>&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>Meet the Garbage PC</title><link>https://ounapuu.ee/posts/2026/02/02/garbage-time/</link><pubDate>Mon, 02 Feb 2026 06:00:00 +0200</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2026/02/02/garbage-time/</guid><description>It's garbage. Extremely good looking garbage, but garbage nevertheless.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2026/02/02/garbage-time/media/cover_hu_851cb952f1831142.jpg" width="1200" height="630" alt="Meet the Garbage PC" /><p>This is the Garbage PC.</p>









<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/its-garbage-time.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/its-garbage-time_hu_364928ad68f9442b.webp"
     width="751"
     height="1000"
     loading="lazy"
     decoding="async"
     alt="It is made of garbage.">

  </a>
  <figcaption class="center">It is made of garbage.</figcaption>
</figure>

<p>Not too long ago, I received a half-broken Dell Inspiron N5110, sporting 6 GB of RAM, a dual core Intel i3-2110M, and an
unsupported NVIDIA GPU of some sort.</p>
<p>One of the hinges was loose from the case because it was screwed into plastic (common issue for these types of laptops),
the touchpad did not work, and to insert a drive into it, you had to disassemble the whole machine.</p>
<p>I&rsquo;m quite confident that I&rsquo;ve worked on this laptop model in a very distant past, around 2012-2013, and I remember it
well because during the disassembly plastic bits were falling off everywhere and the right hinge was broken in exactly
the
same way.</p>
<p>I&rsquo;ve always wanted to take a half-broken laptop and to mount it on some acrylic panels (plexiglass) using brass
standoffs. I <em><strong>love</strong></em> how bare PCB-s look. They&rsquo;re just so damn cool, and I can&rsquo;t be the only one who thinks this
way, right?</p>
<p>I also get a good feeling out of taking trash/obsolete parts and making them useful once again.
This laptop was destined for the e-waste pile, which meant that it was a fantastic candidate to try this idea on.</p>
<p>The main constraint in this project was time. I&rsquo;m a parent, I have a job, and sometimes between all that I like to rest,
so the amount of available time for this project was about 8 hours spread across a month. I also lack proper tooling to
do a good job, so this was achieved using whatever I had available, mainly a cordless jigsaw and a hand drill. On the
upside, this means that if I can do it, then you can likely do it as well!</p>
<h2 id="disassembly-and-testing">
  <a class="heading-anchor" href="#disassembly-and-testing">Disassembly and testing<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>This laptop turned out to be a total pain to work on.</p>
<p>During initial testing, it was very clear that the laptop needed a good thermal paste and pads replacement, as it tried
to overheat playing casual videos off of YouTube.</p>
<p>After I disassembled the laptop to bare essentials and put it together as a test run for the &ldquo;mount it on acrylic panel&rdquo;
idea, the extension board containing two USB ports and the Ethernet port just stopped working. I probably broke
something, but annoying nevertheless. On the positive side, the overall size of the build was smaller as a result of
this happy little accident.</p>









<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/disassembly.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/disassembly_hu_78ddd76790fbf6bf.webp"
     width="1000"
     height="751"
     loading="lazy"
     decoding="async"
     alt="The motherboard with the extension board.">

  </a>
  <figcaption class="center">The motherboard with the extension board.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/disassembly-ssd.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/disassembly-ssd_hu_3caf459da565070c.webp"
     width="1000"
     height="751"
     loading="lazy"
     decoding="async"
     alt="SSD, now mounted.">

  </a>
  <figcaption class="center">SSD, now mounted.</figcaption>
</figure>

<p>Using this laptop via the HDMI output only also turned out to be an unnecessary headache. LibreELEC did not play well
with it, often resulting in a blank screen, and on Fedora Workstation 43, there was a &ldquo;ghost&rdquo; display somewhere that
always showed up on the display settings view. So did the internal display, even when it was disconnected.</p>









<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/testing-libreelec.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/testing-libreelec_hu_a5bc1bb7bc054468.webp"
     width="751"
     height="1000"
     loading="lazy"
     decoding="async"
     alt="LibreELEC was fine, if the internal display was connected, but it didn&#39;t support the USB WiFi dongle I was using.">

  </a>
  <figcaption class="center">LibreELEC was fine, if the internal display was connected, but it didn&#39;t support the USB WiFi dongle I was using.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/ghost-displays.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/ghost-displays_hu_b45c6533147b83f5.webp"
     width="1000"
     height="751"
     loading="lazy"
     decoding="async"
     alt="At this time, only two displays were actually connected.">

  </a>
  <figcaption class="center">At this time, only two displays were actually connected.</figcaption>
</figure>

<p>This caused an issue when trying to get Fedora installed on this machine, as the installation UI would be placed on a
screen that
was <em>not</em> the HDMI output one that I was actually using. This issue can be mitigated similar
to <a href="/posts/2023/02/28/lattepanda-v1/">my LattePanda V1 adventure</a> by disabling video outputs completely. For this
laptop, I modified kernel parameters via <code>/etc/default/grub</code> and added the following kernel parameters:</p>
<pre tabindex="0"><code>video=VGA-1:d video=LVDS-1:d video=VGA-2:d
</code></pre>








<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/kernel-params.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/kernel-params_hu_884e677133983942.webp"
     width="1000"
     height="353"
     loading="lazy"
     decoding="async"
     alt="How to ensure that only HDMI output is actually connected from the perspective from the OS.">

  </a>
  <figcaption class="center">How to ensure that only HDMI output is actually connected from the perspective from the OS.</figcaption>
</figure>

<p>Yes, it&rsquo;s possible to modify the display setup on your desktop environment of choice to disable certain outputs that
way, but using kernel parameters ensures that if you change monitors, you won&rsquo;t have to do that all over again.</p>
<p>To make this whole build even more garbage-tier, I used an 256GB SATA SSD with 5 known bad blocks.</p>
<h2 id="the-build">
  <a class="heading-anchor" href="#the-build">The build<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I sourced a large 4mm thick plexiglass panel from a hardware store, as that seemed to be the most accessible place where
I can get one. In Estonia, these types of panels are often sold in the gardening sections of general hardware stores.</p>
<p>For attaching the motherboard to the board, I sourced an assortment of M2.5 brass standoffs and screws, and multiple
sets in case I need more of a specific height (turned out to be a good call on my part). I chose M2.5 because the laptop
used screws of that size, and this size is common in the world of Raspberry Pi and other SBC-s, which can be handy for
any future <del>dumb ideas</del> experiments.</p>
<p>To mark the positions on the plexiglass, I put the motherboard assembly on it, marked some good spots with an awl <sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>,
and then drilled holes using a hand drill and 2.5mm drill bit.</p>









<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/build-1.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/build-1_hu_71b731da1502508c.webp"
     width="1000"
     height="751"
     loading="lazy"
     decoding="async"
     alt="Marking the spots for the standoffs.">

  </a>
  <figcaption class="center">Marking the spots for the standoffs.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/build-0.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/build-0_hu_2e24aa7c9f563aca.webp"
     width="1000"
     height="751"
     loading="lazy"
     decoding="async"
     alt="The drilling station.">

  </a>
  <figcaption class="center">The drilling station.</figcaption>
</figure>

<p>I also sourced heat inserts so that I can melt them into the plexiglass assembly, but those didn&rsquo;t work out very well. I
used my Pinecil soldering iron to push these in to the 2mm pre-drilled holes that I set up for these, but I had
alignment issues and the threads ended up getting gunked up by the melted remains of the plexiglass, so I could not
screw any brass standoffs in there.</p>
<p>I tried to be very careful with getting the drill holes to line up, and it went mostly alright. My recommendation here
is to be precise, and don&rsquo;t screw everything tight before you&rsquo;ve got screws and standoffs lined up for all planned
holes, otherwise you lose the option of wiggling things a bit to get them to line up.</p>









<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/build-2.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/build-2_hu_ff6530350c6ce602.webp"
     width="1000"
     height="751"
     loading="lazy"
     decoding="async"
     alt="First standoffs installed!">

  </a>
  <figcaption class="center">First standoffs installed!</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/build-3.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/build-3_hu_ce7550ca0f7f3766.webp"
     width="1000"
     height="751"
     loading="lazy"
     decoding="async"
     alt="It&#39;s all coming together.">

  </a>
  <figcaption class="center">It&#39;s all coming together.</figcaption>
</figure>

<p>The standoffs and screws were screwed on tight enough to keep things in place, but not <em>too</em> tight to avoid cracking.</p>









<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/build-4.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/build-4_hu_f56c085ce05afe6c.webp"
     width="1000"
     height="751"
     loading="lazy"
     decoding="async"
     alt="The laptop motherboard, installed on the plexiglass. This was genuinely exciting!">

  </a>
  <figcaption class="center">The laptop motherboard, installed on the plexiglass. This was genuinely exciting!</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/build-5.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/build-5_hu_e1fd01e432a6006a.webp"
     width="1000"
     height="751"
     loading="lazy"
     decoding="async"
     alt="Another angle.">

  </a>
  <figcaption class="center">Another angle.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/build-6.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/build-6_hu_cf8db5a3dd0cffc7.webp"
     width="1000"
     height="751"
     loading="lazy"
     decoding="async"
     alt="The parts look so cool under this panel! Almost makes you forget that you&#39;re working with 15 year old parts.">

  </a>
  <figcaption class="center">The parts look so cool under this panel! Almost makes you forget that you&#39;re working with 15 year old parts.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/build-7.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/build-7_hu_a62b98850cc83adb.webp"
     width="1000"
     height="751"
     loading="lazy"
     decoding="async"
     alt="Really lucked out with the height of the standoffs, accommodating the power jack PCB was no issue at all.">

  </a>
  <figcaption class="center">Really lucked out with the height of the standoffs, accommodating the power jack PCB was no issue at all.</figcaption>
</figure>

<p>For the other panel, I cut out a similarily sized plexiglass panel, marked the holes again, and repeated the process.
Since I was using a cordless jigsaw, I positioned the new piece so that the flat side of the plexiglass panel that I
bought lined up with the other straight end on the existing assembly, because I will never get a good straight cut with
a freehanded jigsaw. That worked out well enough.</p>
<p>For the power button, I reused the small PCB that contains the power button and power LED-s from the original case. To
house that, I drilled a small hole with 1cm diameter to slip the ribbon cable in, and I used small pieces of 3M VHB
double-sided tape<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup> to secure it to the panel.</p>









<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/power-button.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/power-button_hu_c30b19e1af3f5d4d.webp"
     width="751"
     height="1000"
     loading="lazy"
     decoding="async"
     alt="Not the best solution, but it works well enough.">

  </a>
  <figcaption class="center">Not the best solution, but it works well enough.</figcaption>
</figure>

<p>And there you have it, the garbage PC. The shine of the plexiglass does a fantastic job of bringing out the beauty of
the motherboard and all its components. Standoffs leave plenty of room for the machine to breathe.</p>
<p>Since the extension board is missing, this build relies heavily on one USB port and one eSATA port that also supports
USB connectivity. WiFi, Bluetooth, keyboard/mouse, it&rsquo;s all over USB 2.0 ports.</p>









<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/garbage-0.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/garbage-0_hu_8bef081e22471e52.webp"
     width="751"
     height="1000"
     loading="lazy"
     decoding="async"
     alt="The Garbage PC.">

  </a>
  <figcaption class="center">The Garbage PC.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/garbage-1.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/garbage-1_hu_660d7f7386f5159f.webp"
     width="751"
     height="1000"
     loading="lazy"
     decoding="async"
     alt="The Garbage PC, in use.">

  </a>
  <figcaption class="center">The Garbage PC, in use.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/garbage-2.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/garbage-2_hu_c57a4e4c36b6764.webp"
     width="1000"
     height="801"
     loading="lazy"
     decoding="async"
     alt="The white LED-s on the bottom of the motherboard and on the power button look quite nice in darker environments.">

  </a>
  <figcaption class="center">The white LED-s on the bottom of the motherboard and on the power button look quite nice in darker environments.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/garbage-3.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/garbage-3_hu_c4a6f4f9d8be13f6.webp"
     width="1000"
     height="842"
     loading="lazy"
     decoding="async"
     alt="It&#39;s booting Linux!">

  </a>
  <figcaption class="center">It&#39;s booting Linux!</figcaption>
</figure>

<p>One thing that I have yet to do is to add a base to the build so that it does not tip over that easily. Double-sided
tape plus a wooden trim piece might do the trick.</p>
<h2 id="the-experience">
  <a class="heading-anchor" href="#the-experience">The experience<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>This build is using parts that are about 15 years old. For context, that was when dubstep was popular, it was cool to
hate on Justin Bieber, rage comics and bad memes were a thing, and the news in Europe were worried about Greece going
bankrupt or something.</p>
<p>That does mean that the performance on this machine is not great.</p>









<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/garbage-4.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/garbage-4_hu_fed7647b93b2abe3.webp"
     width="1000"
     height="751"
     loading="lazy"
     decoding="async"
     alt="The performance is... garbage.">

  </a>
  <figcaption class="center">The performance is... garbage.</figcaption>
</figure>

<p>The machine still runs warm, but not nearly as hot as before. In its stock form and before any thermal paste
replacements, it ran about 85+°C, but now it doesn&rsquo;t seem to ever hit 70°C.</p>
<p>As a basic desktop PC, assuming that you&rsquo;re not trying to run a 1440p or 4K display, the experience feels completely
usable!</p>
<p>If you&rsquo;re thinking about setting this up as a media player PC, then you&rsquo;re limited to H.264 playback. H.265 was just too
much for this machine. If you use Kodi with Jellyfin, then it is luckily possible to enforce transcoding content to
H.264, ensuring a smooth experience on the client side.</p>
<h2 id="other-notes">
  <a class="heading-anchor" href="#other-notes">Other notes<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I wish that this laptop supported a &ldquo;power on with AC attach&rdquo; type feature that turns the laptop on once the power
adapter is connected, that would&rsquo;ve made it more useful as a crappy little home server. If you don&rsquo;t mind extended
downtime during a power outage, then it can still do that job well enough, but it&rsquo;s just something I was slightly
annoyed with.</p>
<p>The board has a small SATA port that can be converted to a normal SATA port, plus an eSATA port, making it perfectly
plausible to add two drives to this and to totally turn it into a home server.</p>
<p>I tried running Windows 11 on it once, but I tried to do that with the official installer and didn&rsquo;t get past the &ldquo;lol
your hardware is too old&rdquo; view. I know that you can remove that limitation, but given the 6GB of RAM and Windows 11
being awful with using resources, it was probably for the best to give up here.</p>
<p>The fan is audible when doing things. I did in fact take it apart and added some silicon oil inside the center to give
it a fighting chance and it did improve the acoustics, but it&rsquo;s something to keep in mind if you&rsquo;re doing similar
projects with these old laptops. There does seem to be a way to control the fan by writing values to <code>dell_smm</code> kernel
module controls in <code>/sys/class/hwmon/</code>, and if you overwrite the <code>pwm</code> value often enough, like in a 0.1 second loop,
then you can definitely overpower the BIOS fan control on this board. The control does not seem to be fine-tuned, it&rsquo;s
either off, on, or full speed, but at least you can get <em>some</em> control over the fan speed if you really need to.
Alternatively, you can slap a huge heat sink on the CPU and GPU if you want to, and you should be getting away with it.</p>
<p>The CPU throttles heavily once you hit 80°C while playing back video, so that seems to be the soft temperature ceiling
for this laptop.</p>
<h2 id="conclusion">
  <a class="heading-anchor" href="#conclusion">Conclusion<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Overall, I&rsquo;m happy I did this project. There were <em><strong>way</strong></em> more obstacles and challenges associated with this project
that I expected, but the end result looks cool, so that makes it worth it in my view. It was also a good trial run to
work with plexiglass and brass standoffs, and I will very likely do something cooler in the future based on this
experience.</p>
<p>I hope that this inspires more people to reuse older hardware instead of just throwing it into the e-waste pile,
especially with new computer parts sometimes experiencing price spikes due to the economy doing weird things.</p>
<p>If you&rsquo;ve built something similar, then do share a link to it (ideally in blog post format) and I will happily link to
it here!</p>
<h2 id="2026-02-22-update">
  <a class="heading-anchor" href="#2026-02-22-update">2026-02-22 update<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>There was something missing from the garbage PC.</p>
<p>A garbage OS.</p>
<p>So I went ahead, connected the internal display temporarily, and installed Windows 10 on it. The included activation key
did not work on it.</p>
<p>The GPU is confirmed to be a NVIDIA GT 525M. Latest supported drivers are version 391.xx, and had to be downloaded
manually.</p>
<p>Unless you use higher resolutions like 3440x1440p, the experience is not bad at all, actually, and Kodi does a superb
job playing back videos, even in H.265 format.</p>
<p>I hate to say it, but installing a legacy OS over Linux seems to be the best way forward for this particular combination
of Dell and NVIDIA horribleness. Just don&rsquo;t open any shady links on the internet with it, or connect it to the internet
at all.</p>
<p>Microsoft seems to allow you to get security updates on it for a year for free, but only if you sign up with a Microsoft
account, otherwise it&rsquo;s paid. Sneaky. Still not falling for it.</p>









<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/garbage-os.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/garbage-os_hu_2966f872d9df6fef.webp"
     width="1000"
     height="751"
     loading="lazy"
     decoding="async"
     alt="Installing Windows 10.">

  </a>
  <figcaption class="center">Installing Windows 10.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/garbage-os-installed.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/garbage-os-installed_hu_61d7da27cc509df4.webp"
     width="1000"
     height="826"
     loading="lazy"
     decoding="async"
     alt="Well, it works.">

  </a>
  <figcaption class="center">Well, it works.</figcaption>
</figure>

<h2 id="2026-june-update">
  <a class="heading-anchor" href="#2026-june-update">2026 June update<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>The lack of a connected internal display was a real limiting factor in making this setup useful, so I attached it.</p>
<p>This display has some of the most horrific viewing angles of any display that I&rsquo;ve used in the past decade, so I&rsquo;ll
probably have to add some adjustable hinges to it to make using it bearable. Alternatively, I&rsquo;m considering getting the
cheapest possible monitor arm that&rsquo;s freely adjustable and attaching it there to turn this into the crappiest iMac-like
experience that you can get.</p>









<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/garbage-v2.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/garbage-v2_hu_36b77dd4f9ae695e.webp"
     width="1000"
     height="751"
     loading="lazy"
     decoding="async"
     alt="Garbage time, now with a screen.">

  </a>
  <figcaption class="center">Garbage time, now with a screen.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/garbage-v2-tape.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/garbage-v2-tape_hu_ffe160d9526e889f.webp"
     width="1000"
     height="751"
     loading="lazy"
     decoding="async"
     alt="I used a modest amount of 3M VHB double-sided tape, mainly on top of screws and edges of the display.">

  </a>
  <figcaption class="center">I used a modest amount of 3M VHB double-sided tape, mainly on top of screws and edges of the display.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2026/02/02/garbage-time/media/garbage-gaming.jpg">
    <img src="/posts/2026/02/02/garbage-time/media/garbage-gaming_hu_9a794ac67441469e.webp"
     width="1000"
     height="751"
     loading="lazy"
     decoding="async"
     alt="GRID (2007) runs. Not well, but well enough to have some fun with it.">

  </a>
  <figcaption class="center">GRID (2007) runs. Not well, but well enough to have some fun with it.</figcaption>
</figure>

<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>this is the first time I actually have referred to this tool in English. What a weird word.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>it&rsquo;s good, but it smells like microplastics and cancer.&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>Running cheap and crappy USB hard drives in RAID0 is indeed a very terrible idea</title><link>https://ounapuu.ee/posts/2026/01/14/raid0/</link><pubDate>Wed, 14 Jan 2026 10:00:00 +0200</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2026/01/14/raid0/</guid><description>I know, shocker.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2026/01/14/raid0/media/cover_hu_4c078f678ba01857.jpg" width="1200" height="630" alt="Running cheap and crappy USB hard drives in RAID0 is indeed a very terrible idea" /><p>Some of my dumb experiments result in interesting findings and unexpected successes.</p>
<p>Some end up with very predictable failures.</p>
<p>What happens when you have two <a href="/posts/2020/08/22/disk-is-ok/">crappy</a> USB hard drives running <code>btrfs</code><sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> in <code>raid0</code>
mode?
Nothing, until something goes wrong on one of the drives.</p>
<p>Here&rsquo;s what it looks like:</p>
<pre tabindex="0"><code>[188574.681476] BTRFS error (device dm-1): bdev /dev/dm-0 errs: wr 0, rd 0, flush 0, corrupt 5114512, gen 0
[188574.681479] BTRFS warning (device dm-1): csum failed root 719 ino 1133 off 175546368 csum 0x899d8def expected csum 0x6bd987b6 mirror 1
[188574.681481] BTRFS error (device dm-1): bdev /dev/dm-0 errs: wr 0, rd 0, flush 0, corrupt 5114513, gen 0
[188574.681484] BTRFS warning (device dm-1): csum failed root 719 ino 1133 off 175550464 csum 0xab3e9209 expected csum 0xb9ea310f mirror 1
[188574.681486] BTRFS error (device dm-1): bdev /dev/dm-0 errs: wr 0, rd 0, flush 0, corrupt 5114514, gen 0
[188574.681489] BTRFS warning (device dm-1): csum failed root 719 ino 1133 off 175554560 csum 0xc2f14e0c expected csum 0x503c7709 mirror 1
[188574.681491] BTRFS error (device dm-1): bdev /dev/dm-0 errs: wr 0, rd 0, flush 0, corrupt 5114515, gen 0
[188574.681494] BTRFS warning (device dm-1): csum failed root 719 ino 1133 off 175558656 csum 0x6ae8a7c9 expected csum 0xb4c26691 mirror 1
[188574.681496] BTRFS error (device dm-1): bdev /dev/dm-0 errs: wr 0, rd 0, flush 0, corrupt 5114516, gen 0
[188574.681498] BTRFS warning (device dm-1): csum failed root 719 ino 1133 off 175562752 csum 0x97db9766 expected csum 0xbe2e8040 mirror 1
[188574.681500] BTRFS error (device dm-1): bdev /dev/dm-0 errs: wr 0, rd 0, flush 0, corrupt 5114517, gen 0
[188574.681503] BTRFS warning (device dm-1): csum failed root 719 ino 1133 off 175566848 csum 0x86568469 expected csum 0x863fbb4a mirror 1
[188574.681505] BTRFS error (device dm-1): bdev /dev/dm-0 errs: wr 0, rd 0, flush 0, corrupt 5114518, gen 0
[189615.784048] BTRFS warning (device dm-1): csum failed root 719 ino 1181 off 23457792 csum 0xb19058fa expected csum 0x5d11a400 mirror 1
[189615.784086] BTRFS error (device dm-1): bdev /dev/dm-0 errs: wr 0, rd 0, flush 0, corrupt 5114519, gen 0
[189615.784119] BTRFS warning (device dm-1): csum failed root 719 ino 1181 off 23461888 csum 0x256ea900 expected csum 0xabd1eafb mirror 1
[189615.784133] BTRFS error (device dm-1): bdev /dev/dm-0 errs: wr 0, rd 0, flush 0, corrupt 5114520, gen 0
[189615.784153] BTRFS warning (device dm-1): csum failed root 719 ino 1181 off 23465984 csum 0x7b10000b expected csum 0x647fd7bf mirror 1
[189615.784165] BTRFS error (device dm-1): bdev /dev/dm-0 errs: wr 0, rd 0, flush 0, corrupt 5114521, gen 0
[189615.784178] BTRFS warning (device dm-1): csum failed root 719 ino 1181 off 23470080 csum 0xef791959 expected csum 0x175f7adc mirror 1
</code></pre><p>But in a way, this setup worked exactly as expected.</p>
<p>If you want to have a lot of storage on the cheap, or simply care about performance, or both, then running disks in
RAID0 mode is a very sensible thing to do. I used it mainly for having a place where I can store a bunch of data
temporarily, such a full disk images or data that I can easily replace.</p>
<p>Now I can test that theory out!</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>I feel like I need to point out that this is not the fault of <code>btrfs</code>. When you instruct a file system to provide
zero redundancy, then that is what you will get.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>Oops, I accidentally built a Steam Machine</title><link>https://ounapuu.ee/posts/2025/12/01/steam-machine/</link><pubDate>Mon, 01 Dec 2025 06:00:00 +0200</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2025/12/01/steam-machine/</guid><description>I was longing for a Steam Deck that had more oomph. Guess Valve felt that way, too.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2025/12/01/steam-machine/media/cover_hu_1163f60b6daf33d9.jpg" width="1200" height="630" alt="Oops, I accidentally built a Steam Machine" /><p><a href="/posts/2024/06/02/steam-deck/">I like the Steam Deck.</a> It&rsquo;s what convinced me that gaming on Linux is actually viable
now.</p>
<p>But after playing through games like God of War Ragnarök<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>, I felt like I needed an upgrade. I love playing with the
Steam Deck, but what I love more is playing without having to worry about playing around with graphics settings a lot.
Great story and gameplay can only hide the fact that you&rsquo;re running at 720p 30Hz on a big screen for a little bit.</p>
<p>I also get to play relatively rarely, so I might as well make it a better, more enjoyable experience. Quality vs
quantity.</p>
<h2 id="the-specs">
  <a class="heading-anchor" href="#the-specs">The specs<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I went on a look-out for a used PC with roughly these requirements:</p>
<ul>
<li>any modern 6-core CPU or better
<ul>
<li>includes both Intel and AMD as the CPU does not matter much here<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup></li>
</ul>
</li>
<li>an AMD GPU that can do 1080p/4K gaming, depending on the game
<ul>
<li>NVIDIA was out of the question due to lack of support on SteamOS</li>
<li>Intel GPUs are a risk that I was not willing to take right now</li>
</ul>
</li>
<li>16+GB RAM</li>
<li>has to support an NVMe drive
<ul>
<li>using the SteamOS recovery image method is dependent on this</li>
</ul>
</li>
<li>acceptable case, PSU and cooling setup
<ul>
<li>if it does not burn the house down and makes the machine cool and quiet, then I&rsquo;m fine with anything</li>
</ul>
</li>
</ul>
<p>The AMD GPU being a hard requirement turned out to be an interesting challenge. I wasn&rsquo;t looking into putting together a
custom build, but was rather going for a setup that works and that I can customize according to my specific needs. Turns
out that most of the PC-s out there on the market are all based around NVIDIA GPU-s, and AMD builds of this range are
relatively rare, with a guesstimate of the ratio being roughly 10 NVIDIA-based machines to 1 AMD-based machine. The good
side of this is that the selection process was made way simpler as I got to choose between 3-4 options in the end.</p>
<p>During my search I also saw some machines that I would call absolute overkill, and I <em>almost</em> got one in a bidding war,
but eventually I found a more sensible option. It also included a monitor, keyboard, mouse and three SSD-s that I didn&rsquo;t
really need, but the PC itself was decent.</p>
<p>Here&rsquo;s what I landed on:</p>
<ul>
<li>Intel i5-10500
<ul>
<li>6 cores 12 threads at a reasonable speed (4.2 GHz in real-life use)</li>
</ul>
</li>
<li>adequate Cooler Master CPU cooler that does a lot of RGB if needed</li>
<li>16 GB DDR4 RAM @ 2666 MT/s
<ul>
<li>I soon upgraded this to 32 GB because my brother had some leftover modules from his own memory upgrade</li>
<li>I forced the modules to run at 3200 MT/s. It&rsquo;s memtest-stable so good enough for me.</li>
</ul>
</li>
<li>AMD RX 6600XT with 8GB VRAM
<ul>
<li>some might scoff at the VRAM amount, but coming from a Steam Deck where 16GB was shared between CPU <em>and</em> GPU,
this is plenty!</li>
</ul>
</li>
<li>512GB NVMe SSD</li>
<li>three 256GB SATA SSD-s
<ul>
<li>previous owner put them in as RAID0, which is clever and works well as a game library</li>
</ul>
</li>
<li>some Gigabyte motherboard that works
<ul>
<li>it really doesn&rsquo;t matter here</li>
</ul>
</li>
<li>some Fractal Design case, possibly a Define-series one
<ul>
<li>all I know is that it&rsquo;s huuuuuuuuuge</li>
</ul>
</li>
</ul>









<figure class="center">
  <a href="/posts/2025/12/01/steam-machine/media/internals.jpg">
    <img src="/posts/2025/12/01/steam-machine/media/internals_hu_bf4c78ee5ba4e1f5.webp"
     width="1000"
     height="751"
     loading="lazy"
     decoding="async"
     alt="The inside look into the build.">

  </a>
  <figcaption class="center">The inside look into the build.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2025/12/01/steam-machine/media/rgb.jpg">
    <img src="/posts/2025/12/01/steam-machine/media/rgb_hu_7d50a9a9017e9a2e.webp"
     width="751"
     height="1000"
     loading="lazy"
     decoding="async"
     alt="The RGB glow doubles as a night light.">

  </a>
  <figcaption class="center">The RGB glow doubles as a night light.</figcaption>
</figure>

<p>All-in-all, it cost me 365 EUR in Estonia in October 2025, and so far I&rsquo;ve made about 25 EUR back from the SSD sales
alone, with some items still up for sale. It&rsquo;s not as portable as a Steam Deck, but it&rsquo;s cheaper even if we account for
the cost of the game controller and cables/accessories/adapters that you usually need.</p>
<h2 id="the-setup">
  <a class="heading-anchor" href="#the-setup">The setup<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Regarding the operating system choice, I tried both SteamOS from the Steam Deck recovery image,
and <a href="https://bazzite.gg/">Bazzite</a>. Both work fine and in the default couch gaming mode you won&rsquo;t notice a difference,
but I ended up defaulting to SteamOS because I had my setup and configuration changes tuned around that. The SteamOS
recovery image approach does assume that you have an NVMe drive available, so if you lack one, you&rsquo;re better off trying
Bazzite as that can be installed on any drive.</p>
<p>I replaced the NVMe SSD with a cheap 128GB one and utilized the bigger drive
in <a href="/posts/2025/11/18/lattepanda-iota/">the LattePanda IOTA setup</a> that now serves as my home server.</p>
<p>As a game library drive, I took a 1TB Samsung SSD that I had around, which roughly matches the storage that I had
available on my Steam Deck that I ended up modding with a 1TB M.2 2230 SSD. With games like God of War Ragnarök taking
up around <strong><em>176GB</em></strong>, it&rsquo;s not going to be the most luxurious arrangement, but for now it&rsquo;s okay.</p>
<p>The Fractal case that it came up with was one that is fully metal, with sound dampening material present on the side
panels. It&rsquo;s a bit banged up, but still a pretty nice experience if you have the room for storing one in your setup. The
case had one flaw that I stumbled upon: the power button on the Fractal case liked to get stuck, which seems to be a
common issue with that model. I fixed that with a random power button that I sourced from a local electronic parts
supplier for a few euros and that works really well now, with the additional bonus of it being <em>slightly</em> more
cat-proof.</p>
<p>The default fan curves on the motherboard were a bit too aggressive, so I had to slightly tune them down, and now the
machine is quiet while doing a great job with keeping the internals cool. You can hear a subtle whirring when you&rsquo;re in
the same room with it, but during gaming it stays at reasonable volumes and is not noticeable. Certainly quieter than a
Steam Deck would be.</p>
<h2 id="the-gaming-experience">
  <a class="heading-anchor" href="#the-gaming-experience">The gaming experience<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>The AMD GPU is a low/midrange model, but it gets the job done in 1080p gaming, and with a lot of titles it can do 4K
with ease. In God of War Ragnarök I stuck with 1080p and cranked the settings, but with games like Need for Speed Hot
Pursuit Remastered, I pushed the resolution to 4K with high/ultra settings, and it runs smoothly at 60Hz.</p>
<p>This setup also taught me that <em><strong>Linux supports HDR now</strong></em>, which was news to me! My tech setup usually lags behind the
state of the art, mostly because I don&rsquo;t really see a need to upgrade to the latest and greatest thing out there if the
current one works well enough, but this was a really nice surprise. My TV has a crappy HDR implementation, so I don&rsquo;t
get the full HDR experience, but it&rsquo;s nice to see the TV show that HDR logo when I start up the machine.</p>
<p>Regarding the gaming experience, I&rsquo;ve only noticed a few sore spots.</p>
<p>For whatever reason, the Need for Speed (2015) just does not start up on anything but an actual Steam Deck. It just
doesn&rsquo;t work here. I can&rsquo;t be arsed to investigate this yet, the wonky physics in this game are perhaps not worth that
effort.</p>
<p>It&rsquo;s also clear that the choice of an Intel CPU is generally fine, but in God of War Ragnarök it was running <em>too</em> well,
so the CPU kept dropping down to lower clock speeds, which then made the game performance inconsistent. Finding that
this was the issue was actually quite straightforward: when I first loaded the game, the shader compilation was taking
place in the background and even though the CPU was at a constant 100% usage, the game ran quite smoothly. It only
started stuttering after that was done, and the integrated <code>mangohud</code> setup helped confirm the issue as its most
detailed preset shows the frame time and CPU clock speed graphs really well.</p>
<p>Since this is just a Linux box, then you can of course run a few commands to fix it.<sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup></p>
<p>Here&rsquo;s how I fixed it.</p>
<p>Create a desktop entry at <code>/home/deck/.local/bin/its-gaming-time.desktop</code> with the contents:</p>
<pre tabindex="0"><code>[Desktop Entry]
Name=Gaming Time!
Exec=/home/deck/.local/bin/its-gaming-time
Comment=
Icon=
Type=Application
Terminal=true
</code></pre><p>Create a file <code>/home/deck/.local/bin/its-gaming-time</code> with the contents:</p>
<pre tabindex="0"><code>#!/bin/bash
# Set performance mode
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

# Set min_perf_pct to 100 (forces min freq = max freq)
echo 100 | sudo tee /sys/devices/system/cpu/intel_pstate/min_perf_pct
</code></pre><p>Don&rsquo;t forget to mark the script as executable with <code>chmod +x /home/deck/.local/bin/its-gaming-time</code>.</p>
<p>Note that the script above does require that you have set up passwordless <code>sudo</code> on the SteamOS installation.
This can be configured in <code>/etc/sudoers.d/wheel</code>, just make sure that the line starting with <code>%wheel</code> looks like this:</p>
<pre tabindex="0"><code>%wheel ALL=(ALL) NOPASSWD: ALL
</code></pre><p>With all that set up, in desktop mode, right-click on the desktop shortcut, &ldquo;Add to Steam&rdquo;, and now you can run this
script any time in Steam gaming mode, even while a game is running!</p>
<p>All-in-all, I&rsquo;m very satisfied with the experience that a cheap gaming PC box provides with SteamOS. The installation is
painless, my wireless controllers just work, and aside from a few rare exceptions, my games run really well.</p>
<p>It&rsquo;s also way easier on my eyes and with the 4K resolution I can actually see oncoming cars better in games like Need
for Speed Hot Pursuit Remastered.<sup id="fnref:4"><a href="#fn:4" class="footnote-ref" role="doc-noteref">4</a></sup></p>
<h2 id="the-gabecube">
  <a class="heading-anchor" href="#the-gabecube">The GabeCube<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Less than three weeks after buying that gaming
PC, <a href="https://store.steampowered.com/sale/steammachine">the Steam Machine was officially announced.</a></p>
<p>The <strong><em>rumored</em></strong> specs suggesting a 6 core/12 thread CPU, 16GB DDR5 RAM, and a custom 8GB VRAM AMD GPU that seems
to be roughly comparable to an AMD RX 6600XT-ish level of performance.</p>
<p>It seems that I have accidentally built a Steam Machine. Oops.</p>
<p>Of course, the specs and final performance are not public at the time of writing, and the Steam Machine has many
benefits (better SteamOS compatibility, good WiFi, smaller size, likely more efficient and quiet), but it&rsquo;s still
interesting how close I got with my setup and selection criteria.</p>
<p>I was slightly disappointed that I got this machine right before that announcement, but then I reminded myself of the
fact that I can enjoy games on the big screen <em><strong>right now,</strong></em> and the Steam Machine is scheduled for a release in Q1
2026, which can be as late as 31st of March 2026.</p>
<p>And hey, when the Steam Machine <em>does</em> come out and I decide to get one, the current gaming desktop will make for a very
good home server candidate with all the room that it has available, and all the six SATA ports on the motherboard
sure look tempting. I&rsquo;m pretty sure that the Fractal case also allows something crazy like 17+ hard drives installed in
it.</p>
<p>This approach of building my own Steam Machine of sorts did lead to me selling my Steam Deck. Better to have someone
else enjoy it than having it sit in a box until its battery dies. That also serves as a major sign of confidence for
this big box that makes my sparse downtime sessions more fun.</p>
<p>If you have a machine with a modern AMD GPU, then give SteamOS a try, you might be surprised at how well it works. Even
a laptop with an AMD APU can do it, as long as you temper your expectations regarding the image quality.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>it&rsquo;s a banger, try it if you&rsquo;re into the story, or you just want to indiscriminately smash and kill.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>this is called <em>foreshadowing</em>&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:3">
<p>some might see it as &ldquo;ugh, Linux moment&rdquo; type of thing, but I see it as freedom to fix issues that you would
otherwise be unable to even diagnose and address. Power to the players!&#160;<a href="#fnref:3" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:4">
<p>you can probably tell that I had a blast replaying that game for the 5th time recently. It&rsquo;s not even the best NFS
game, and yet I love playing it over and over again.&#160;<a href="#fnref:4" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>./project2038: can I keep the Orange Pi Zero running until 2038 and beyond?</title><link>https://ounapuu.ee/posts/2025/10/20/project2038/</link><pubDate>Mon, 20 Oct 2025 06:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2025/10/20/project2038/</guid><description>Only one way to find out!</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2025/10/20/project2038/media/cover_hu_b330c3c2c479a395.jpg" width="1200" height="630" alt="./project2038: can I keep the Orange Pi Zero running until 2038 and beyond?" /><p><em>Start of experiment: September 2025</em></p>
<p><em>Post last updated: October 2025</em></p>
<p><a href="https://project2038.ounapuu.ee/">Check the live status of my Orange Pi Zero here!</a></p>
<p>I love the <a href="https://www.armbian.com/orange-pi-zero/">Orange Pi Zero.</a> It&rsquo;s tiny, uses very little power and it&rsquo;s just
neat! It&rsquo;s also the subject of <a href="/posts/2020/07/23/the-little-wifi-ap-that-could/">the very first post on my blog,</a> which
makes it a bit special.</p>
<p>Unfortunately I haven&rsquo;t really found a good use case for it, given that its performance is quite limited and the CPU is
a 32-bit ARM CPU with 4 relatively weak cores, which rules out using it as a Docker container host due to the
architectural limitations.</p>
<p>The board is currently not doing much, but I&rsquo;ll figure out a use case for it.</p>
<p>The board also has a few quirks at the moment that I&rsquo;ve worked around. For example, rebooting seems to be broken, and
it&rsquo;s unlikely to get fixed any time soon. I resolved it by simply not rebooting it<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>, at least not on a regular
schedule, anyway. I&rsquo;m hoping that any short-term power outages at home will take care of the need to reboot it.</p>
<p>It also runs quite hot in its stock Armbian configuration, which I worked around by running <code>powertop --auto-tune</code> on
startup as that forces the CPU to always run at its slowest clock speed (480 MHz). Without it, I found that this board
can run its CPU at 105°C, and it does have a thermal shutdown feature.</p>
<p>This board has been featured in a few previous posts as well, and even then it was quite underpowered:</p>
<ul>
<li><a href="/posts/2020/07/23/the-little-wifi-ap-that-could/">the little Wi-Fi AP that could</a></li>
<li><a href="/posts/2021/03/20/whacky-setups-1/">seedbox on a wall</a></li>
<li><a href="/posts/2021/02/27/database-optimization-adventures-on-low-end-hardware/">database optimization adventures on low-end hardware</a></li>
</ul>
<p>Now that I have it set up, will it be able to survive
to <a href="https://en.wikipedia.org/wiki/Year_2038_problem">year 2038 and beyond?</a> Only time will tell.</p>
<p>Which issue will we run into first? Plausible options based on my previous experience:</p>
<ul>
<li>the cheap 8GB SD card craps out</li>
<li>component on the board dies from heat-related issues</li>
<li>the USB power supply dies
<ul>
<li>it&rsquo;s currently running off of an IKEA extension cord that has two USB-A ports, so hopefully not</li>
</ul>
</li>
<li>board loses Armbian support completely (currently under community maintenance status)</li>
</ul>
<p>The board is currently running the latest version of Armbian, and I might occasionally refresh its version from time to
time.</p>
<p><a href="https://www.armbian.com/donate/">If you like Armbian, then please support them!</a> They&rsquo;re doing great work with keeping
all sorts of SBC-s up and running with usable versions of Debian and Ubuntu Linux.</p>
<h2 id="2025-10-20-update">
  <a class="heading-anchor" href="#2025-10-20-update">2025-10-20 update<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>What are the chances that the day I make this project
public, <a href="https://aws.amazon.com/message/101925/">AWS suffers a massive outage?</a>
Poetic in a way. And yes, my website and the Orange Pi Zero were fully operational.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>the first time in my career that the solution ended up being &ldquo;have you tried <em><strong>not</strong></em> turning it off and on
again?&rdquo;&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>I'm done with Ubuntu</title><link>https://ounapuu.ee/posts/2025/02/05/done-with-ubuntu/</link><pubDate>Wed, 05 Feb 2025 06:00:00 +0200</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2025/02/05/done-with-ubuntu/</guid><description>A few busted upgrades and the heavy-handed push of a software packaging solution has ruined Ubuntu for me.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2025/02/05/done-with-ubuntu/media/cover_hu_c169fc8a62b2d61.jpg" width="1200" height="630" alt="I'm done with Ubuntu" /><p>I liked Ubuntu. For a very long time, it was the sensible default option.
Around 2016, I used the Ubuntu GNOME flavor, and after they ditched the Unity desktop environment, GNOME became the
default
option.</p>
<p>I was really happy with it, both for work and personal computing needs.</p>
<p><a href="https://www.id.ee/en/article/install-id-software/">Estonian ID card software</a> was also officially supported on Ubuntu,
which made Ubuntu a good choice for family members.</p>
<p>But then something changed.</p>
<h2 id="upgrades-suck">
  <a class="heading-anchor" href="#upgrades-suck">Upgrades suck<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Like many Ubuntu users, I stuck to the long-term support releases and upgraded every two years to the next major
version. There was just one tiny little issue: every upgrade broke <em>something.</em></p>
<p>Usually it was a relatively minor issue, with some icons, fonts or themes being a bit funny. Sometimes things went
completely wrong.</p>
<p>The worst upgrade was the one I did on my mothers&rsquo; laptop. During the upgrade process from Ubuntu 20.04 to 22.04,
everything blew up spectacularly. The UI froze, the machine was completely unresponsive. After a 30-minute wait and a
forced restart later, the installation was absolutely <em><strong>fucked.</strong></em> In frustration, I ended up installing <em><strong>Windows</strong></em>
so
that I don&rsquo;t have to support Ubuntu.</p>
<p>Another family member, another upgrade. This is one that they did themselves on Lubuntu 18.04, and they upgraded to the
latest version. The result: Firefox shortcuts stopped working, the status bar contained duplicate icons, and random
errors popped up after logging
in. <a href="/posts/2024/10/14/fedora-starter-pack/#-specific-to-estonia-id-card-support">After making sure that ID card software works on Fedora 40,</a>
I installed that instead. All they need is a working browser, and that&rsquo;s too difficult for Ubuntu to handle.</p>
<h2 id="snaps-ruined-ubuntu">
  <a class="heading-anchor" href="#snaps-ruined-ubuntu">Snaps ruined Ubuntu<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p><a href="https://ubuntu.com/core/services/guide/snaps-intro">Snaps</a>. I hate them.</p>
<p>They sound great in theory, but the poor implementation and heavy-handed push by Canonical has been a mess.</p>
<p>Snaps auto-update by default. Great for security<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>, but horrible for users who want to control what their <em>personal</em>
computer is doing.</p>
<p>Snaps get forced upon users as more and more system components are forcibly switched from Debian-based packages to
Snaps, which breaks compatibility, functionality and introduces a lot of new issues. You can upgrade your Ubuntu
installation and then discover that your browser is now contained within a Snap, the desktop shortcut for it doesn&rsquo;t
work and your government ID card does not work for logging in to your bank any longer.</p>
<p>Snaps also destroy productivity. A colleague was struggling to get any work done because the desktop environment on
their Ubuntu installation was flashing certain UI elements, being unresponsive and blocking them from doing any work.
Apparently the whole GNOME desktop environment is a Snap now, and that lead to issues.</p>
<p>The fix was <em>super easy, barely an inconvenience:</em></p>
<ul>
<li>roll back to the previous version of the GNOME snap</li>
<li>restart
<ul>
<li>still broken</li>
</ul>
</li>
<li>update to the latest version again</li>
<li>restart
<ul>
<li>still broken</li>
</ul>
</li>
<li>restart again
<ul>
<li>it is fixed now</li>
</ul>
</li>
</ul>
<p>What was the issue?</p>
<p>Absolutely no clue, but a days&rsquo; worth of developers&rsquo; productivity was completely wasted.</p>
<p>Some of these issues have <em>probably</em> been fixed by now, but if I executed migration projects at my day job with a
similar track record, I would be fired.<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup></p>
<h2 id="snaps-done-right-flatpak">
  <a class="heading-anchor" href="#snaps-done-right-flatpak">Snaps done right: Flatpak<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Snaps can be implemented in a way that doesn&rsquo;t suck for end users. <a href="https://flatpak.org/">It&rsquo;s called a Flatpak.</a></p>
<p>They work reasonably well, you can update them whenever you want and they are <em><strong>optional</strong></em>. Your Firefox installation
won&rsquo;t suddenly turn into a Flatpak overnight.</p>
<p>On the <a href="/posts/2024/06/02/steam-deck/">Steam Deck,</a> Flatpaks are the main distribution method for user-installed apps
and I don&rsquo;t mind it at all. The
only issue is the software selection, not every app is available as a Flatpak just yet.</p>
<h2 id="consider-fedora">
  <a class="heading-anchor" href="#consider-fedora">Consider Fedora<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Fedora works fine.</p>
<p><a href="/posts/2024/10/14/fedora-starter-pack/">It&rsquo;s not perfect,</a> but I like it.</p>
<p>At this point I&rsquo;ve used it for longer than Ubuntu
and <a href="https://www.redhat.com/en/blog/message-red-hat-associates-today">unless IBM ruins it for all of us,</a> I think it
will be a perfectly <a href="https://en.wiktionary.org/wiki/cromulent">cromulent</a> distro go get work done on.</p>
<p>Hopefully it&rsquo;s not too late for Canonical to reconsider their approach to building a Linux distro.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>the <a href="https://en.wikipedia.org/wiki/XZ_Utils_backdoor">xz backdoor</a> demonstrated that getting the latest versions
of all software can also be problematic from the security angle.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>technical failures themselves are not the issue, but not responding to users&rsquo; feedback and not testing things
certainly is, especially if you keep repeatedly making the same mistake.&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>Why my blog was down for over 24 hours in November 2024</title><link>https://ounapuu.ee/posts/2025/01/21/downtime/</link><pubDate>Tue, 21 Jan 2025 06:00:00 +0200</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2025/01/21/downtime/</guid><description>Everything I learned from an incident that made me consider switching careers. It was a close one!</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2025/01/21/downtime/media/cover_hu_e9bbb9d03e5c963f.jpg" width="1200" height="630" alt="Why my blog was down for over 24 hours in November 2024" /><p>In November 2024, my blog was down for over 24 hours.</p>
<p>Here&rsquo;s what I learned from this absolute clusterfuck of an incident.</p>
<h2 id="lead-up-to-the-incident">
  <a class="heading-anchor" href="#lead-up-to-the-incident">Lead-up to the incident<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I was browsing through photos on my <a href="https://nextcloud.com/">Nextcloud</a> instance. Everything was fine, until Nextcloud
started generating preview images for older photos.
This process is quite resource intensive, but generally manageable. However, this time the images were high quality
photos in the 10-20 MB size range.</p>
<p>Nextcloud crunched through those, but ended up spawning so many processes that it ended up using all the available
memory on my home server.</p>









<figure class="center">
  <a href="/posts/2025/01/21/downtime/media/oom.png">
    <img src="/posts/2025/01/21/downtime/media/oom_hu_a7bb1706f8142c5e.webp"
     width="577"
     height="278"
     loading="lazy"
     decoding="async"
     alt="Uh-oh.">

  </a>
  <figcaption class="center">Uh-oh.</figcaption>
</figure>

<p>And thus, the server was down.</p>
<p>This could have been solved by a forced reboot. Things were complicated by the simple fact that I was 120 kilometers
away from my server, and I had no IPMI-like device set up.</p>
<p>So I waited.</p>
<p>50 minutes later, I successfully logged in to my server over SSH again! The load averages were in the three-digit realm,
but the system was mostly operational.</p>









<figure class="center">
  <a href="/posts/2025/01/21/downtime/media/loadaverage.png">
    <img src="/posts/2025/01/21/downtime/media/loadaverage_hu_33a3a2e52fb68add.webp"
     width="548"
     height="279"
     loading="lazy"
     decoding="async"
     alt="Load average after logging in after the out of memory incident, shown with htop.">

  </a>
  <figcaption class="center">Load average after logging in after the out of memory incident, shown with htop.</figcaption>
</figure>

<p>I thought that it would be a good idea to restart the server, since who knows what might&rsquo;ve gone wrong while the server
was handling the out-of-memory situation.</p>
<p>I reboot.</p>
<p>The server doesn&rsquo;t seem to come back up. Fuck.</p>









<figure class="center">
  <a href="/posts/2025/01/21/downtime/media/reboot.png">
    <img src="/posts/2025/01/21/downtime/media/reboot_hu_d91afcae7d436db8.webp"
     width="950"
     height="278"
     loading="lazy"
     decoding="async"
     alt="Kurwa.">

  </a>
  <figcaption class="center">Kurwa.</figcaption>
</figure>

<h2 id="the-downtime">
  <a class="heading-anchor" href="#the-downtime">The downtime<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>The worst part of the downtime was that I was simply unable to immediately fix it due to being 120 kilometers away from
the server.</p>
<p>My VPN connection back home was also hosted right there on the server,
using <a href="https://hub.docker.com/r/linuxserver/wireguard">this Docker image.</a></p>
<p>I eventually got around to fixing this issue the next day when I could finally get hands-on with the
server, <a href="/posts/2024/10/16/third-times-the-charm/">my trusty ThinkPad T430.</a>
I open the lid and am greeted with the console login screen. This means that the machine <em>did</em> boot.</p>
<p>I log in to the server over SSH and quickly open <code>htop</code>. My <code>htop</code> configuration shows metrics like <code>systemd</code> state, and
it was showing 20+ failed services. This is very unusual.</p>
<p><code>lsblk</code> and <code>mount</code> show that the storage is there. What was the issue?</p>
<p>Well, apparently the Docker daemon was not starting. I was searching for the error messages and ended
up <a href="https://github.com/moby/moby/issues/21215#issuecomment-568445170">on this GitHub issue.</a>
I tried the fix, which involved deleting the Docker folder with all the containers and configuration, and restarted the
daemon and containers. Everything is operational once again.</p>
<p>I then rebooted the server.</p>
<p>Everything is down again, with the same issue.</p>
<p>And thus began a 8+ hours long troubleshooting session that ran late into the night. <em>04:00-ish</em> late, on a Monday.</p>
<p>I tried everything that I could come up with:</p>
<ul>
<li>used the <code>btrfs</code> Docker storage driver instead of the default overlay one
<ul>
<li>Docker is still broken after a reboot</li>
</ul>
</li>
<li>replaced everything with <code>podman</code>
<ul>
<li>I could not get <code>podman</code> to play well with my containers and IPv6 networking</li>
</ul>
</li>
<li>considered switching careers
<ul>
<li>tractors are surprisingly expensive!</li>
</ul>
</li>
</ul>
<p>I&rsquo;m unable to put into words how frustrating this troubleshooting session was. The sleep deprivation, the lack of
helpful information, the failed attempts at finding solutions. I&rsquo;m usually quite calm and very rarely feel anger,
but during these hours I felt <em><strong>enraged.</strong></em></p>
<h2 id="the-root-cause">
  <a class="heading-anchor" href="#the-root-cause">The root cause<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>The root cause will make more sense after you understand the storage setup I had at the time.</p>
<p>The storage on my server consisted of four 4 TB SSD-s, two were mounted inside the laptop, and the remaining two were
connected via USB-SATA adapters. The filesystem in use was <code>btrfs</code>, both on the OS drive and the 4x 4TB storage pool. To
avoid
hitting the OS boot drive with unnecessary writes, I moved the Docker data root to a separate <code>btrfs</code> subvolume on the
main storage pool.</p>
<p>What was the issue?</p>
<p>Apparently the Docker daemon on Fedora Server is able to start up <em><strong>before every filesystem was mounted.</strong></em> In this
case, Docker daemon started up before the subvolume containing all the Docker images, containers and networks was
mounted.</p>
<p>I tested out this theory by moving the Docker storage back to <code>/var/lib/docker</code>, which lives on the root filesystem, and
after a reboot everything remained functional.</p>
<p>In the past, I ran a similar setup, but with the Docker storage on the SATA SSD-s that are mounted inside the laptop
over a native SATA connection. With the addition of two USB-connected SSD-s, the mounting process took longer for the
whole pool, which resulted in a race condition between the Docker daemon startup and the storage being mounted.</p>
<h2 id="fixing-the-root-cause">
  <a class="heading-anchor" href="#fixing-the-root-cause">Fixing the root cause<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>The fix for Docker starting up before all of your storage is mounted is actually quite elegant.</p>
<p>The Docker service definition is contained in <code>/etc/systemd/system/docker.service</code>. You can override this configuration
by creating a new directory at <code>/etc/systemd/system/docker.service.d</code> and dropping a file with the name <code>override.conf</code>
in there with the following contents:</p>
<pre tabindex="0"><code>[Unit]
RequiresMountsFor=/containerstorage
</code></pre><p>The rest of the service definition remains the same and your customized configuration won&rsquo;t be overwritten with a Docker
version update. The <code>RequiresMountsFor</code> setting prevents the Docker service from starting up before that particular
mount exists.</p>
<p>You can specify multiple mount points on the same line, separated by spaces.</p>
<pre tabindex="0"><code>[Unit]
RequiresMountsFor=/containerstorage /otherstorage /some/other/mountpoint
</code></pre><p>You can also specify the mount points over multiple lines if you prefer.</p>
<pre tabindex="0"><code>[Unit]
RequiresMountsFor=/containerstorage 
RequiresMountsFor=/otherstorage 
RequiresMountsFor=/some/other/mountpoint
</code></pre><p>If you&rsquo;re using <code>systemd</code> unit files for controlling containers, then you can use the same <code>systemd</code> setting to prevent
your containers from starting up before the storage that the container depends on is mounted.</p>
<h2 id="avoiding-the-out-of-memory-incident">
  <a class="heading-anchor" href="#avoiding-the-out-of-memory-incident">Avoiding the out of memory incident<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Nextcloud taking down my home server for 50 minutes was not the root cause, it only highlighted an issue that had been
there for days at that point. That doesn&rsquo;t mean that this area can&rsquo;t be improved.</p>
<p>After this incident, every Docker Compose file that I use includes resource limits on all containers.</p>
<p>When defining the limits, I started with very conservative limits based on the average resource usage as observed from
<code>docker stats</code> output.</p>
<p>Over the past few months I&rsquo;ve had to continuously tweak the limits, especially the memory ones, due to the containers
themselves running out of memory when the limits were set too low. Apparently software is getting increasingly more
resource hungry.</p>
<p>An example Docker Compose file with resource limits looks like this:</p>
<pre tabindex="0"><code>name: nextcloud
services:
  nextcloud:
    container_name: nextcloud
    volumes:
      - /path/to/nextcloud/stuff:/data
    deploy:
      resources:
        limits:
          cpus: &#34;4&#34;
          memory: 2gb
    image: docker.io/nextcloud:latest
    restart: always
  nextcloud-db:
    container_name: nextcloud-db
    volumes:
      - /path/to/database:/var/lib/postgresql/data
    deploy:
      resources:
        limits:
          cpus: &#34;4&#34;
          memory: 2gb
    image: docker.io/postgres:16
    restart: always
</code></pre><p>In this example, each container is able to use up to 4 CPU cores and a maximum of 2 GB of memory. And just like that,
Nextcloud is unable to take down my server by eating up all the available memory.</p>
<p>Yes, I&rsquo;m aware of the <a href="https://github.com/nextcloud/previewgenerator">Preview Generator Nextcloud app.</a> I have it, but
over multiple years of running Nextcloud, I have not found it to be very effective against the resource-hungry preview
image generation happening during user interactions.</p>
<h2 id="decoupling-my-vpn-solution-from-docker">
  <a class="heading-anchor" href="#decoupling-my-vpn-solution-from-docker">Decoupling my VPN solution from Docker<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>With this incident, it was also clear that running your gateway to your home network inside a container was a really
stupid idea.</p>
<p>I&rsquo;ve mitigated this issue by taking the WireGuard configuration generated by the container and moving it to the host. I
also used this as an opportunity to get a to-do list item done and
used <a href="https://stanislas.blog/2019/01/how-to-setup-vpn-server-wireguard-nat-ipv6/">this guide</a> to add IPv6 support inside
the
virtual WireGuard network. I can now access IPv6 networks everywhere I go!</p>
<p>I briefly considered setting WireGuard up on my openWRT-powered router, but I decided against it as I&rsquo;d like to own
one computer that I don&rsquo;t screw up with my configuration changes.</p>
<h2 id="closing-thoughts">
  <a class="heading-anchor" href="#closing-thoughts">Closing thoughts<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I have not yet faced an incident this severe, even at work. The impact wasn&rsquo;t that big, I guess a hundred people
were not able to read my blog, but the stress levels were off the charts for me during the troubleshooting process.</p>
<p>I&rsquo;ve long advocated for self-hosting and running basic and boring solutions, with the main benefits being ease of
maintenance, troubleshooting and low cost. This incident is a good reminder that even the most basic setups can have
complicated issues associated with them.</p>
<p>At least I got it fixed and learned about a new <code>systemd</code> unit setting, which is nice.</p>
<p>Still better than handling <a href="/posts/2024/10/01/kubernetes/">Kubernetes</a> <a href="/posts/2024/04/04/helm-rollbljat/">issues.</a></p>
]]></content:encoded></item><item><title>Backing up another PC with a single Ethernet cable</title><link>https://ounapuu.ee/posts/2025/01/15/backups-without-disk/</link><pubDate>Wed, 15 Jan 2025 06:00:00 +0200</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2025/01/15/backups-without-disk/</guid><description>If all you have is an Ethernet cable, then everything looks like a temporary storage device.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2025/01/15/backups-without-disk/media/cover_hu_9014625e7ebdbb4.jpg" width="1200" height="630" alt="Backing up another PC with a single Ethernet cable" /><p>I was in a pinch.</p>
<p>I needed to make a full disk backup of a PC, but I had no external storage device with me to store it on.
The local Wi-Fi network was also way too slow to transfer the disk over it.</p>
<p>All I had was my laptop with an Ethernet port, a Fedora Linux USB stick, and a short Ethernet cable.</p>
<p>I took the following steps:</p>
<ul>
<li>boot the target machine up with the Fedora Linux installer in a live environment</li>
<li>modify the SSH configuration on the target machine to allow <code>root</code> user login with a password
<ul>
<li>it&rsquo;s OK to do this on a temporary setup like this one, but don&rsquo;t do it on an actual Linux server</li>
</ul>
</li>
<li>set a password for the <code>root</code> user on the target machine
<ul>
<li>only required because a live environment usually does not set one for <code>root</code> user</li>
</ul>
</li>
<li>connect both laptops with the Ethernet cable</li>
<li>set static IPv4 addresses on both machines using network settings <sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>
<ul>
<li>edit the &ldquo;Wired&rdquo; connection and open the IPv4 tab</li>
<li>example IP address on target: 192.168.100.5</li>
<li>example IP address on my laptop: 192.168.100.1</li>
<li>make sure to set the netmask to 255.255.255.0 on both!</li>
</ul>
</li>
<li>verify that the SSH connection works to the target machine</li>
<li>back up the disk to your local machine using <code>ssh</code> and <code>dd</code>
<ul>
<li>example: <code>ssh root@192.168.100.5 &quot;dd if=/dev/sda&quot; | dd of=disk-image-backup.iso status=progress</code></li>
<li>replace <code>/dev/sda</code> with the correct drive name!</li>
</ul>
</li>
</ul>
<p>And just like that, I backed up the 120 GB SSD at gigabit speeds to my laptop.</p>









<figure class="center">
  <a href="/posts/2025/01/15/backups-without-disk/media/setup-0.jpg">
    <img src="/posts/2025/01/15/backups-without-disk/media/setup-0_hu_9fc5ce3a493235ab.webp"
     width="1000"
     height="750"
     loading="lazy"
     decoding="async"
     alt="Copying in progress.">

  </a>
  <figcaption class="center">Copying in progress.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2025/01/15/backups-without-disk/media/setup-1.jpg">
    <img src="/posts/2025/01/15/backups-without-disk/media/setup-1_hu_5f8d76c41d88289b.webp"
     width="1000"
     height="750"
     loading="lazy"
     decoding="async"
     alt="It might be only 105 MB/s, but it beat doing the same over Wi-Fi at 1.5 MB/s!">

  </a>
  <figcaption class="center">It might be only 105 MB/s, but it beat doing the same over Wi-Fi at 1.5 MB/s!</figcaption>
</figure>

<p>I&rsquo;ve used a similar approach in the past when switching between laptops by running a live environment on both machines
and copying the disk over with <code>dd</code> bit by bit.</p>
<p>You&rsquo;ll also save time on not having to copy the data over twice, first to an external storage device, and then to the
target device.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>there&rsquo;s probably a simpler way to do this with IPv6 magic, but I have not tested it yet&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>What I've learned running Linux and Windows off of USB flash drives</title><link>https://ounapuu.ee/posts/2024/12/02/linux-on-usb/</link><pubDate>Mon, 02 Dec 2024 06:00:00 +0200</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2024/12/02/linux-on-usb/</guid><description>I took some USB flash drives I had around and put Windows and Linux on them, here's how it went.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2024/12/02/linux-on-usb/media/cover_hu_545a86df87185231.jpg" width="1200" height="630" alt="What I've learned running Linux and Windows off of USB flash drives" /><p>I&rsquo;ve recently made an effort to reduce the amount of tech stuff that I own. Lack of space, lack of time and the guilt
of storing perfectly functional hardware unused in a box were the main motivators.</p>
<p>This has resulted in experiments with my assortment of USB flash storage that I&rsquo;ve acquired over the years. They&rsquo;re too
old and cheap to be worth selling, so why not run them to the ground?</p>
<p>I&rsquo;ve always liked the idea of USB sticks. They&rsquo;re small and the good ones are actually surprisingly fast, especially
compared to hard drives. This is why I started installing operating systems on them.
It&rsquo;s really handy to have a USB stick around with a full operating system on it for testing purposes, and I&rsquo;m too cheap
to buy an <a href="https://www.iodd.shop/Home">IODD device.</a><sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup></p>
<p>What I&rsquo;ve learned is that Linux installed on a USB stick is a much nicer experience compared to a Windows To Go
installation, even on the cheaper and crappier ones.</p>
<h2 id="the-windows-experience">
  <a class="heading-anchor" href="#the-windows-experience">The Windows experience<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I&rsquo;ve used <a href="https://rufus.ie/en/">Rufus</a> for creating portable Windows installations in the past, mostly on portable
SSD-s.
These have come in handy when I&rsquo;ve had to update the firmware on certain PC-s or associated hardware, like USB-C
docks.<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup></p>
<p>Recently, I took a Samsung FIT 128GB USB 3.0 drive to see how well Windows can operate off of it.</p>
<p>It&rsquo;s horrible.</p>
<p>Windows will run, but the first time you boot it, you will have to wait for all sorts of driver and update
installations,
which puts a huge strain on the storage, making the whole experience borderline unusable. Once that process is
complete (multiple hours later), it&rsquo;s actually not that bad, until you receive yet another Windows update.</p>
<p>For a USB stick that you use only occasionally to troubleshoot hardware, Windows is a really poor choice. Even on a
proper portable SSD, it will still be relatively slow due to all that driver and update installation
taking place in the background.</p>
<p>Eventually, that installation will also probably brick itself in one way or another, and not even due to any storage
failures. Simply using the same disk on multiple machines will accrue configuration and driver cruft that likely results
in Windows giving up. It&rsquo;s just a guesstimate on my side, but I would not be surprised if it was true.</p>
<p>After a Windows update run completely fried one USB stick<sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup> that I used for testing, I gave up on it.</p>
<h2 id="the-linux-experience">
  <a class="heading-anchor" href="#the-linux-experience">The Linux experience<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Most Linux distributions have supported a LiveCD/LiveUSB solution for at least 15+ years at this point. It&rsquo;s a neat
idea: your installation media also doubles as an emergency portable installation of that Linux distro, which you can use
to quickly test the functionality of a PC, repair an existing installation or install it on a new machine.</p>
<p>The downside of that solution is that the software on it cannot be changed. You can temporarily install new software or
update existing packages during that session, or have a separate writeable partition set aside on the USB stick for
storing any permanent changes, but it&rsquo;s a bit of a hassle to think about that nuance every time.</p>
<p>This is why I went ahead and installed Fedora Linux 40 on a Sandisk Ultra 16GB USB 3.0 flash drive <a href="/posts/2023/02/15/shrinkflation/">(the
one that is actually 16GB).</a>
The storage speed is still a bottleneck, but it&rsquo;s much less noticeable during normal use.</p>
<p>After the installation is done, you&rsquo;re simply using the system as-is. Opening programs will have a slightly longer
delay, but it&rsquo;s still a perfectly <a href="https://en.wiktionary.org/wiki/cromulent">cromulent</a> Linux experience.</p>
<p>A fresh installation of Fedora Workstation 40 uses only <strong>3.6GB</strong> of storage! On a 16GB USB flash drive, this leaves
plenty
of room for performing system updates and installing a small number of applications. If you choose the <code>btrfs</code>
filesystem during the installation (the default option), then the files will also be compressed to save even more space
and increase the effective storage bandwidth.<sup id="fnref:4"><a href="#fn:4" class="footnote-ref" role="doc-noteref">4</a></sup></p>









<figure class="center">
  <a href="/posts/2024/12/02/linux-on-usb/media/fedora-disk-usage.png">
    <img src="/posts/2024/12/02/linux-on-usb/media/fedora-disk-usage_hu_529947b4729ff43e.webp"
     width="684"
     height="264"
     loading="lazy"
     decoding="async"
     alt="Disk usage on a fresh Fedora Workstation 40 installation.">

  </a>
  <figcaption class="center">Disk usage on a fresh Fedora Workstation 40 installation.</figcaption>
</figure>

<p>You&rsquo;ll only notice that you&rsquo;re running off of a USB flash drive when installing new packages, performing system updates
or downloading large files. At least with Linux you have control over <em>when</em> you want to install the updates.</p>









<figure class="center">
  <a href="/posts/2024/12/02/linux-on-usb/media/fedora-update.png">
    <img src="/posts/2024/12/02/linux-on-usb/media/fedora-update_hu_3fe675a2983581f9.webp"
     width="870"
     height="599"
     loading="lazy"
     decoding="async"
     alt="It&#39;s not terribly fast, but it&#39;s not terrible!">

  </a>
  <figcaption class="center">It&#39;s not terribly fast, but it&#39;s not terrible!</figcaption>
</figure>

<p>Using <code>btrfs</code> also allows you to easily check the flash drive for any integrity issues. Simply
run <code>sudo btrfs scrub start -B /</code>
and you&rsquo;ll know soon enough if your flash drive is messing with your data.</p>
<h2 id="the-backerupper-usb-stick">
  <a class="heading-anchor" href="#the-backerupper-usb-stick">The <em>backerupper</em> USB stick<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>One actual use case that I have for a full Linux installation on a USB stick is the <em>backerupper</em> solution: a fully
featured Fedora Linux installation, stored on a small USB stick, and with limited access to networked storage.</p>
<p>Most people working in IT know the joys of working with hardware that family members and relatives own. Before doing any
destructive changes, it&rsquo;s always a good idea to make a full disk copy of the storage on the machine you&rsquo;re fixing. If
you screw up, you&rsquo;ll have a way of setting everything back just as it was before you did any work on it.
A full disk image will also mean that nothing will be left behind before you do a fresh installation.</p>
<p>I already have a home server with some spare storage, so using it as a target for any backups makes perfect sense to me.</p>
<p>This solution has already come in handy once when I had to deal with a 10-year-old laptop with a dying hard drive.<sup id="fnref:5"><a href="#fn:5" class="footnote-ref" role="doc-noteref">5</a></sup></p>
<h2 id="crappy-storage-is-still-crappy">
  <a class="heading-anchor" href="#crappy-storage-is-still-crappy">Crappy storage is still crappy<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Don&rsquo;t expect any kind of longevity with USB sticks, the wear leveling and endurance is not on the level of proper
SSD-s. Linux is nicer to the USB stick regarding the wear and tear, but given enough time, the USB flash drive will
still fail.</p>
<p>I will still keep using USB flash sticks for this purpose. I have backups of the USB stick installations on my server,
so restoring it will simply mean getting another USB stick and writing the full disk image back to it.</p>
<p>USB sticks are also great for specialized solutions that don&rsquo;t do a lot of IO
operations. <a href="https://libreelec.tv/">LibreELEC</a>, a media-center oriented Linux distro, can be run off of a USB flash
drive without any major issues, since its storage demands are very small (unless you install a ton of plugins).</p>
<h2 id="conclusion">
  <a class="heading-anchor" href="#conclusion">Conclusion<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Linux and USB flash storage is a great option for making backups or having a working operating system available for
disaster recovery scenarios. Just mind the endurance of the flash storage, and don&rsquo;t use Windows.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>I won&rsquo;t trust Ventoy <a href="https://github.com/ventoy/Ventoy/issues/2795">until they address this issue.</a>&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>Linux can also install firmware updates on some machines and hardware, but it&rsquo;s not a guaranteed success.&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:3">
<p>only the third time that I&rsquo;ve actually fried a solid state flash storage device through write abuse in my life.
Flash is actually pretty good!&#160;<a href="#fnref:3" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:4">
<p>compression allows us to push more data through a small pipe, be it a slow storage device or the network, at the
cost of additional CPU usage.&#160;<a href="#fnref:4" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:5">
<p>I utilized my sick tech skills to force a full rewrite of the disk to reduce the number of pending bad sectors,
and that made Windows happy enough to run on it once again with a fresh installation. It&rsquo;s a ticking time bomb, but the
user is well aware of it and just wants to have a working backup laptop around.&#160;<a href="#fnref:5" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>You can use almost anything as a key file for your encrypted storage device</title><link>https://ounapuu.ee/posts/2024/11/20/keyfiles/</link><pubDate>Wed, 20 Nov 2024 06:00:00 +0200</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2024/11/20/keyfiles/</guid><description>Yes, you can decrypt your storage with a picture of your cat.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2024/11/20/keyfiles/media/cover_hu_13983d04e0e274a1.jpg" width="1200" height="630" alt="You can use almost anything as a key file for your encrypted storage device" /><p>Imagine that you have an unencrypted drive containing your private data and one day it starts throwing a bunch of
errors. You have backups of the data so you&rsquo;ve got that part covered, but would you feel comfortable sending the drive
in to be warrantied? You have no control over who has access to that drive, and due to the drive failing you can&rsquo;t
format it as well.</p>
<p>Do you take the financial hit and buy a new drive, or send it in regardless and risk
someone looking through your files?</p>
<p>I&rsquo;ve bought and sold a bunch of hard drives and SSD-s over the years<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>, and warrantied a few of them. I encrypt the
disk
on my personal and work machines because of the obvious security benefits, but for a long time I avoided doing the same
for other storage devices.</p>
<p>Then I realized that I can just encrypt them and use almost anything as the key. All you need is a reasonably sized file
to pass to <code>cryptsetup</code> as a key-file, refer to that key-file in <code>/etc/crypttab</code>, and you&rsquo;re good to
go!</p>
<p>Be creative! The key file can be anything:</p>
<ul>
<li>a dank meme</li>
<li>a very short low resolution cat video</li>
<li>an adorable photo of your dog</li>
<li>a precious family photo</li>
<li>Twilight fan fiction that you wrote back in 2011</li>
<li>your letter of resignation at your last job</li>
</ul>
<p>Just mind the size, <code>cryptsetup</code> wasn&rsquo;t very happy with a 17MB full resolution image. A JPEG that&rsquo;s less than a megabyte
in size worked well enough for me.</p>
<p>On Linux, you can encrypt a partition with a cat picture using a command like this:</p>
<pre tabindex="0"><code>cryptsetup luksFormat /dev/sdx1 --key-file /path/to/cat.jpg
</code></pre><p>You can make sure that the drive gets automatically decrypted at boot by defining it in <code>/etc/crypttab</code>.
Find the UUID of the encrypted partition by running <code>ls -lah /dev/disk/by-uuid</code> and see which one matches with
<code>/dev/sdx1</code>.
If the UUID is <code>ef277bc2-d953-44c4-88af-8320aca76969</code>, then a line in <code>/etc/crypttab</code> would look like this:</p>
<pre tabindex="0"><code>encryptedcatdrive UUID=ef277bc2-d953-44c4-88af-8320aca76969 /path/to/cat.jpg 
</code></pre><p>Once unlocked, your decrypted partition will be available as <code>/dev/mapper/encryptedcatdrive</code>.</p>
<p>Just make sure that the key file isn&rsquo;t placed on the encrypted drive itself, otherwise you&rsquo;ll lock yourself out for
good.</p>
<p>For more information on LUKS disk encryption and its
capabilities, <a href="https://wiki.archlinux.org/title/Dm-crypt/Device_encryption">see this handy Arch Wiki page.</a></p>
<p>This approach comes with some great benefits and a few downsides.</p>
<p>On the bright side, you don&rsquo;t have to worry about a stranger getting their hands on your data when selling a storage
device
or sending it in to be warrantied, assuming that you haven&rsquo;t posted the key file on social media or anywhere else.<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup>
Just do a quick format of the drive, or format a very specific part to clear the LUKS headers, and the contents of the
drive are gone!</p>
<p>If you can&rsquo;t format the drive due to hardware issues, then you should still be safe, the attacker would
have to first <em>fix</em> the drive (which isn&rsquo;t a guaranteed success) and <em>then</em> figure out the key, which will require a lot
of effort and time.</p>
<p>The one obvious downside is that if you lose the key file, you lose the data. You can mitigate this by either adding
multiple key files as a backup option, or setting <a href="https://xkcd.com/936/">a strong password</a> that you can use in case
you lose your original key file.</p>
<p>If the drive contains something of value to your family members, then it may be a good idea to specify those details in
a will, or by taping the backup password with instructions on the drive itself. If you end up selling the drive before
your personal expiration date arrives, then you can simply remove the instructions. Just make sure that your family
members or relatives know to plug in the drive to a Linux machine.<sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup></p>
<p>I also like the thrill of hiding a key in plain sight. Did I use the cover photo of this post to encrypt my drives?
You&rsquo;ll never know, and that&rsquo;s what makes it fun!</p>
<p>If you&rsquo;re paranoid or targeted by state actors, then you probably shouldn&rsquo;t follow this advice, except the part where I
encourage encrypting stuff.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>Hello, my name is Herman, and I&rsquo;m a recovering data hoarder.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>if we use a simple .jpg as an example key file, then it&rsquo;s highly likely that this won&rsquo;t be an issue as most
messaging and social media platforms compress the hell out of the image. The compression is also lossy, meaning that the
process is irreversible and the end result is a completely different file from the perspective of the encrypted disk.&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:3">
<p>if you&rsquo;ve ever plugged in a drive with a Linux filesystem on a Windows machine, then you&rsquo;ll know that it will
happily recommend formatting it. Oh, goodie.&#160;<a href="#fnref:3" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>The Fedora Linux starter pack: everything you need for a smooth experience</title><link>https://ounapuu.ee/posts/2024/10/14/fedora-starter-pack/</link><pubDate>Mon, 14 Oct 2024 06:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2024/10/14/fedora-starter-pack/</guid><description>Fedora Linux is a great Linux distribution, but it has a few quirks that can impact your experience. Here's how to fix them.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2024/10/14/fedora-starter-pack/media/cover_hu_a4c43ff367b3786d.jpg" width="1200" height="630" alt="The Fedora Linux starter pack: everything you need for a smooth experience" /><p>I like <a href="https://fedoraproject.org/">Fedora Linux.</a></p>
<p>It&rsquo;s the Linux distro that stopped my habit of <a href="https://en.wiktionary.org/wiki/distro-hopping">distro-hopping.</a> Big
deal? Ooh, big deal!</p>
<p>It&rsquo;s stable in day-to-day use, ships with up-to-date software, and the software selection is adequate out of the box.</p>
<p>It also ships with a fresh Linux kernel version<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>, resulting in a good experience even on modern hardware.</p>
<p>I&rsquo;ve been happily using it for about 4 years at this point, both on personal and work computers.</p>
<p>However, every time I recommend it to my friends, family and colleagues, I have to mention a few things that a new
Fedora Linux user might want to do first so that the experience is as smooth as possible.</p>
<p>If it weren&rsquo;t for those aspects, Fedora would be pretty much perfect.</p>
<h2 id="set-up-rpm-fusion">
  <a class="heading-anchor" href="#set-up-rpm-fusion">Set up RPM Fusion<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>There are some packages that are not available on Fedora by default, likely as a result of copyright laws, lawyers and
Red Hat (IBM) not having the appetite to fight it out in the courts.</p>
<p>This is why <a href="https://rpmfusion.org/">RPM Fusion</a> exists:</p>
<blockquote>
<p>RPM Fusion provides software that the Fedora Project or Red Hat doesn&rsquo;t want to ship.</p>
</blockquote>
<p>The installation instructions are <a href="https://rpmfusion.org/Configuration">here</a>, and I personally prefer this one-liner
setup:</p>
<pre tabindex="0"><code>sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
</code></pre><p>This step is a prerequisite to the next one.</p>
<h2 id="enable-hardware-accelerated-video-playback">
  <a class="heading-anchor" href="#enable-hardware-accelerated-video-playback">Enable hardware accelerated video playback<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>This is the part where I blame lawyers.</p>
<p>To have a good chance at smoothly playing back videos in a browser or using VLC, you have to do a few extra steps,
because someone fucked up.</p>
<p><a href="https://rpmfusion.org/Howto/Multimedia">Check this guide for up-to-date information.</a></p>
<p>Switch to the full version of <code>ffmpeg</code>:</p>
<ul>
<li><code>sudo dnf swap ffmpeg-free ffmpeg --allowerasing</code></li>
</ul>
<p>AMD GPU users:</p>
<ul>
<li><code>sudo dnf swap mesa-va-drivers mesa-va-drivers-freeworld</code></li>
<li><code>sudo dnf swap mesa-vdpau-drivers mesa-vdpau-drivers-freeworld</code></li>
</ul>
<p>Intel GPU users (Broadwell and newer, 2014+):</p>
<ul>
<li><code>sudo dnf install intel-media-driver</code></li>
</ul>
<p>Old Intel GPU users (Ivy Bridge and older, &lt;=2013):</p>
<ul>
<li><code>sudo dnf install libva-intel-driver</code></li>
</ul>
<p>NVIDIA GPU users: good luck.<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup></p>
<p>You can verify the enabled profiles using <code>vainfo</code>.</p>
<p>Here&rsquo;s the output on my machine before completing the steps (AMD GPU).</p>
<p>Note the lack of H.264 and HEVC profiles.</p>
<pre tabindex="0"><code>me@mymachine:~$ vainfo
Trying display: wayland
libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib64/dri-nonfree/radeonsi_drv_video.so
libva info: Trying to open /usr/lib64/dri-freeworld/radeonsi_drv_video.so
libva info: Trying to open /usr/lib64/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.21 (libva 2.21.0)
vainfo: Driver version: Mesa Gallium driver 24.1.7 for AMD Radeon 780M (radeonsi, gfx1103_r1, LLVM 18.1.6, DRM 3.57, 6.10.8-200.fc40.x86_64)
vainfo: Supported profile and entrypoints
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD
      VAProfileAV1Profile0            :	VAEntrypointVLD
      VAProfileAV1Profile0            :	VAEntrypointEncSlice
      VAProfileNone                   :	VAEntrypointVideoProc
</code></pre><p>Here&rsquo;s what it looks like after the tweaks are applied.</p>
<pre tabindex="0"><code>me@mymachine:~$ vainfo
Trying display: wayland
libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib64/dri-nonfree/radeonsi_drv_video.so
libva info: Trying to open /usr/lib64/dri-freeworld/radeonsi_drv_video.so
libva info: Trying to open /usr/lib64/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.21 (libva 2.21.0)
vainfo: Driver version: Mesa Gallium driver 24.1.7 for AMD Radeon 780M (radeonsi, gfx1103_r1, LLVM 18.1.6, DRM 3.57, 6.10.8-200.fc40.x86_64)
vainfo: Supported profile and entrypoints
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointEncSlice
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD
      VAProfileAV1Profile0            :	VAEntrypointVLD
      VAProfileAV1Profile0            :	VAEntrypointEncSlice
      VAProfileNone                   :	VAEntrypointVideoProc
</code></pre><h2 id="enable-flathub">
  <a class="heading-anchor" href="#enable-flathub">Enable Flathub<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>This step is only necessary if you did not enable <a href="https://github.com/minosimo">third-party repositories</a> during the
inital setup of your Fedora Linux installation.</p>
<p>Setting up Flathub is just one command:</p>
<pre tabindex="0"><code>flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
</code></pre><p>Check <a href="https://flathub.org/setup/Fedora">the Flathub setup instructions for Fedora</a> for up-to-date info.</p>
<h2 id="-specific-to-estonia-id-card-support">
  <a class="heading-anchor" href="#-specific-to-estonia-id-card-support">🇪🇪 Specific to Estonia: ID card support<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Estonia has <a href="https://www.id.ee/en/">an ID Card system</a> (<em>Eesti ID kaart</em>), and the desktop application is
also officially supported on Linux. <em><strong>Ubuntu</strong></em> Linux.</p>
<p>To use the ID card in Fedora, you&rsquo;ll need to install the necessary packages:</p>
<p><code>sudo dnf install -y open-eid</code></p>
<p>Firefox users will need to make sure that the Web eID extension is installed. If
it wasn&rsquo;t installed with the above
command, <a href="https://addons.mozilla.org/en-US/firefox/addon/web-eid-webextension/">you can also get it here.</a></p>
<p>The desktop application used for opening and digitally signing documents, DigiDoc4, has a bad habit of breaking
sometimes due to changes. Luckily there exists an unofficial version of DigiDoc4 as a Flatpak
and <a href="https://flathub.org/apps/ee.ria.qdigidoc4">it&rsquo;s available on Flathub.</a></p>
<p>It&rsquo;s mentioned
in <a href="https://github.com/open-eid/linux-installer/wiki/Linux-Packages">the official open-eid/linux-installer repo</a> as
well, which lends some credibility (plus I know
the person that built it).</p>
<p>As of 2024-10-14, ID card works on Firefox and the DigiDoc4 client from the Fedora official repository does not crash
and burn.</p>
<h3 id="gnome-fix-the-alttab-behaviour">
  <a class="heading-anchor" href="#gnome-fix-the-alttab-behaviour">GNOME: fix the &ldquo;Alt+Tab&rdquo; behaviour<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h3>
<p>GNOME is a great desktop environment, but it, too, has its quirks.<sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup></p>
<p>If you&rsquo;re used to &ldquo;Alt+Tab&rdquo; keyboard shortcut simply switching windows, then you&rsquo;ll have to tweak it in settings.</p>
<ul>
<li>Open &ldquo;Settings&rdquo;</li>
<li>Navigate to &ldquo;Keyboard&rdquo;</li>
<li>Click on &ldquo;View and Customize shortcuts&rdquo;</li>
<li>Use the search bar to:
<ul>
<li>disable &ldquo;Switch applications&rdquo; shortcut</li>
<li>set the &ldquo;Switch windows&rdquo; shortcut to &ldquo;Alt+Tab&rdquo;</li>
</ul>
</li>
</ul>
<p>Here&rsquo;s what it looks like on GNOME 46.</p>









<figure class="center">
  <a href="/posts/2024/10/14/fedora-starter-pack/media/shortcuts-1.png">
    <img src="/posts/2024/10/14/fedora-starter-pack/media/shortcuts-1_hu_6f7375171fc4c57d.webp"
     width="979"
     height="642"
     loading="lazy"
     decoding="async"
     alt="Navigate to &#39;Keyboard&#39; and click on &#39;View and Customize shortcuts&#39;">

  </a>
  <figcaption class="center">Navigate to &#39;Keyboard&#39; and click on &#39;View and Customize shortcuts&#39;</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2024/10/14/fedora-starter-pack/media/shortcuts-2.png">
    <img src="/posts/2024/10/14/fedora-starter-pack/media/shortcuts-2_hu_77f97c17c799a6fb.webp"
     width="979"
     height="642"
     loading="lazy"
     decoding="async"
     alt="Select &#39;Navigation&#39;">

  </a>
  <figcaption class="center">Select &#39;Navigation&#39;</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2024/10/14/fedora-starter-pack/media/shortcuts-3.png">
    <img src="/posts/2024/10/14/fedora-starter-pack/media/shortcuts-3_hu_6e48f954c4c4565b.webp"
     width="979"
     height="642"
     loading="lazy"
     decoding="async"
     alt="Disable &#34;Switch applications&#34; shortcut.">

  </a>
  <figcaption class="center">Disable &#34;Switch applications&#34; shortcut.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2024/10/14/fedora-starter-pack/media/shortcuts-4.png">
    <img src="/posts/2024/10/14/fedora-starter-pack/media/shortcuts-4_hu_bb17f5e558874f8a.webp"
     width="979"
     height="642"
     loading="lazy"
     decoding="async"
     alt="Set the &#34;Switch windows&#34; shortcut to &#34;Alt&#43;Tab&#34;.">

  </a>
  <figcaption class="center">Set the &#34;Switch windows&#34; shortcut to &#34;Alt&#43;Tab&#34;.</figcaption>
</figure>

<h3 id="gnome-minimize-maximize-buttons-on-windows">
  <a class="heading-anchor" href="#gnome-minimize-maximize-buttons-on-windows">GNOME: minimize, maximize buttons on windows<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h3>
<p>By default, you&rsquo;ll only see the &ldquo;Close&rdquo; button on windows, but it is possible to also show minimize and maximize
buttons.</p>
<p>Install GNOME tweaks with <code>sudo dnf install -y gnome-tweaks</code>.</p>
<p>Open it, navigate to <code>Windows</code>, and toggle <code>Maximize</code> and <code>Minimize</code> settings.</p>









<figure class="center">
  <a href="/posts/2024/10/14/fedora-starter-pack/media/min-max.png">
    <img src="/posts/2024/10/14/fedora-starter-pack/media/min-max_hu_bdeba6f163b4dd79.webp"
     width="984"
     height="647"
     loading="lazy"
     decoding="async"
     alt="GNOME tweaks settings as of GNOME 40.">

  </a>
  <figcaption class="center">GNOME tweaks settings as of GNOME 40.</figcaption>
</figure>

<h3 id="gnome-app-status-indicators">
  <a class="heading-anchor" href="#gnome-app-status-indicators">GNOME: app status indicators<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h3>
<p>Some apps, such as Solaar, like to run in the background and show you a status indicator on your taskbar.
This functionality is not present on GNOME by default, but you can easily fix it with
the <a href="https://extensions.gnome.org/extension/615/appindicator-support/">AppIndicator and KStatusNotifierItem Support</a>
extension.</p>









<figure class="center">
  <a href="/posts/2024/10/14/fedora-starter-pack/media/appindicator.png">
    <img src="/posts/2024/10/14/fedora-starter-pack/media/appindicator_hu_104aeeaf3327e956.webp"
     width="525"
     height="262"
     loading="lazy"
     decoding="async"
     alt="I used to install a handful of extensions in the past to &#34;fix&#34; GNOME, but in 2024 this is the only one I actually need.">

  </a>
  <figcaption class="center">I used to install a handful of extensions in the past to &#34;fix&#34; GNOME, but in 2024 this is the only one I actually need.</figcaption>
</figure>

<h3 id="gnome-corner-tiling">
  <a class="heading-anchor" href="#gnome-corner-tiling">GNOME: corner tiling<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h3>
<p>As of GNOME 46, you cannot do corner tiling out of the box. The best you can do is split windows horizontally, which
is fine for single ultra-wide monitor setups. There are situations where corner tiling comes in really handy.</p>
<p>The best solution I have found so far seems to
be the <a href="https://extensions.gnome.org/extension/3733/tiling-assistant/">Tiling Assistant</a>
extension. It&rsquo;s configurable and will probably suit your workflow well.</p>
<p>At the time of writing, it does have a few small but annoying enough bugs that are a show-stopper for me, but compared
to other solutions this one at least works.</p>
<h3 id="optional-disable-selinux">
  <a class="heading-anchor" href="#optional-disable-selinux">Optional: disable SELinux<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h3>
<p>There are two types of people: those that swear by <a href="https://github.com/SELinuxProject">SELinux</a>, and those that swear
<em>due to</em> SELinux.</p>
<p>If you&rsquo;re running into weird issues and you don&rsquo;t know why, then see if SELinux is to blame.</p>
<p>I run into issues with SELinux every time I try to move files around with <code>rsync</code>, resulting in a simple
<code>rsync -aAXv source/ destination/</code> command becoming <code>rsync -aAXv --filter='-x security.selinux' source/ destination/</code>.
It&rsquo;s frustrating.</p>
<p>To fix this, I simply disable SELinux. Open up <code>/etc/selinux/config</code>, find the line <code>SELINUX=enforcing</code> and change it to
<code>SELINUX=disabled</code>.</p>
<p>You&rsquo;ll need to restart your machine for it to take effect.</p>
<h3 id="dont-use-zfs">
  <a class="heading-anchor" href="#dont-use-zfs">Don&rsquo;t use ZFS<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h3>
<p><a href="https://github.com/openzfs/zfs">ZFS</a> is a great filesystem, but not on distros that ship new kernel versions.</p>
<p>This is due to OpenZFS needing to be built against the Linux kernel, and new kernel releases often break compatibility.
Those breakages may lead to your ZFS pools not being imported at boot as a result.</p>
<p>You <em>can</em> use ZFS if you use LTS kernels built by someone else, or if you simply don&rsquo;t update your system, but I don&rsquo;t
recommend either approach.</p>
<p>Use a different distribution, such as Debian, if you really need to use ZFS daily.</p>
<p>If you don&rsquo;t care for ZFS but like data integrity checks, snapshots and don&rsquo;t use a lot of disks in an array, then
<code>btrfs</code> <a href="/posts/2023/10/09/zimaboard/#fedora-server-and-btrfs">is totally fine.</a></p>
<h3 id="dont-use-nvidia-gpu-s">
  <a class="heading-anchor" href="#dont-use-nvidia-gpu-s">Don&rsquo;t use NVIDIA GPU-s<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h3>
<p>I&rsquo;ve never had a good experience with the open source driver <code>nouveau</code>, and the proprietary drivers are a headache and
break things.</p>
<p><a href="https://developer.nvidia.com/blog/nvidia-transitions-fully-towards-open-source-gpu-kernel-modules/">This might be about to change,</a>
but I&rsquo;ll believe it when I see it.</p>
<h3 id="conclusion">
  <a class="heading-anchor" href="#conclusion">Conclusion<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h3>
<p>I hope that this has made your Fedora Linux experience just a little bit better.</p>
<p>Here&rsquo;s to hoping that IBM does not fuck up Fedora
Linux. <a href="https://www.redhat.com/en/blog/message-red-hat-associates-today">My expectations are low.</a></p>
<p>If you have any other tips to share then please contact me! You can find the contact details below.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>one thing that I appreciate with Fedora is that the kernel versions are ever-so-slightly lagging behind the likes
of Arch Linux, meaning that you&rsquo;ll be less likely to hit any kernel bugs, and yet you don&rsquo;t have to worry about being
too far behind (like on Ubuntu or Debian).&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>no, seriously, I wish you all the luck in the world. I have never managed to have a good experience with NVIDIA on
Linux. I&rsquo;ve completely given up.&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:3">
<p>use whatever desktop environment floats your boat, I don&rsquo;t judge!&#160;<a href="#fnref:3" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>How to copy media off of an iPhone the hard way (using Linux)</title><link>https://ounapuu.ee/posts/2024/09/02/iphone-media-recovery/</link><pubDate>Mon, 02 Sep 2024 06:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2024/09/02/iphone-media-recovery/</guid><description>If your iPhone doesn't show any photos when connected to a PC, then this guide may help you out.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2024/09/02/iphone-media-recovery/media/cover_hu_e9b0badd6a9c5a39.jpg" width="1200" height="630" alt="How to copy media off of an iPhone the hard way (using Linux)" /><p>I helped a family member upgrade to a newer iPhone and make some room so that the internal storage does not run out.</p>
<p>They had <a href="https://nextcloud.com/">Nextcloud</a> installed on the current phone, but due to limitations of the Nextcloud iOS
app, the backups only take place if the app itself is open, meaning that we had hundreds of photos and videos that were
not yet backed up.<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup></p>
<p>The network was slow and I was in a time crunch, so I opted to copy the media off of the phone by connecting the iPhone
to my laptop over
a Lightning cable. After entering the PIN on the phone again and approving the connection, I could see the iPhone
in my file manager, but opening it would show nothing at all. This was very unusual as other iPhones I used in the past
just worked on my laptop.</p>









<figure class="center">
  <a href="/posts/2024/09/02/iphone-media-recovery/media/happypath.png">
    <img src="/posts/2024/09/02/iphone-media-recovery/media/happypath_hu_c02c82f42067017e.webp"
     width="482"
     height="378"
     loading="lazy"
     decoding="async"
     alt="This is what you&#39;d expect to see when connecting an iPhone to a PC.">

  </a>
  <figcaption class="center">This is what you&#39;d expect to see when connecting an iPhone to a PC.</figcaption>
</figure>

<p>Rebooting the phone and connecting it again did nothing. Different known good Lightning cables did not improve things,
either.
Even a separate Windows 10 machine could not see any images, so it wasn&rsquo;t a Linux thing.</p>
<p>Various Apple-related posts online were devoid of useful advice.<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup></p>
<p>I was not ready to give up just yet and I finally stumbled
upon <a href="https://askubuntu.com/a/1159559">this Ask Ubuntu answer</a>.
This had potential, so I gave it a go, and I&rsquo;m happy to report that it worked on my Fedora Linux machine!</p>
<p>These are the steps that I took. The commands need to be run in a terminal window.</p>
<p>Tested with Fedora Linux 40.</p>
<ul>
<li>install the necessary packages
<ul>
<li>on Fedora, run <code>sudo dnf install -y ifuse libimobiledevice libimobiledevice-utils</code></li>
</ul>
</li>
<li>connect your iPhone to your PC
<ul>
<li>if your phone is not yet paired, then run <code>idevicepair pair</code></li>
<li>if it&rsquo;s already paired, verify the connection by running <code>idevicepair validate</code></li>
</ul>
</li>
<li>mount your phone to an empty folder of your choice
<ul>
<li>if an empty folder does not exist, run <code>mkdir ~/my-iphone</code> (use any folder name that you want)</li>
<li>to mount the phone, run <code>ifuse ~/my-iphone</code></li>
</ul>
</li>
<li>you can now browse your media via your file manager or terminal by navigating to <code>~/my-iphone</code>
<ul>
<li>photos and videos taken by the camera will be in the <code>DCIM</code> folder</li>
<li>other folders, such as <code>Photos</code> and <code>Downloads</code> may also interest you</li>
<li>to make a full copy of your phone to a folder named <code>iphone-backup</code>, run <code>cp -r ~/my-iphone ~/iphone-backup</code></li>
<li>alternative way to create a full backup: <code>rsync -aAXv ~/my-iphone ~/iphone-backup</code></li>
</ul>
</li>
<li>once you&rsquo;re done, unmount the iPhone by running <code>umount ~/my-iphone</code></li>
<li>it is now safe to disconnect your iPhone from the PC</li>
</ul>









<figure class="center">
  <a href="/posts/2024/09/02/iphone-media-recovery/media/iphone-contents.png">
    <img src="/posts/2024/09/02/iphone-media-recovery/media/iphone-contents_hu_ab4faea4df55ae20.webp"
     width="556"
     height="515"
     loading="lazy"
     decoding="async"
     alt="The directory listing of an iPhone.">

  </a>
  <figcaption class="center">The directory listing of an iPhone.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2024/09/02/iphone-media-recovery/media/iphone-photos.png">
    <img src="/posts/2024/09/02/iphone-media-recovery/media/iphone-photos_hu_f0e63d72cd9690cb.webp"
     width="556"
     height="515"
     loading="lazy"
     decoding="async"
     alt="Photos are located under DCIM folder, nested into a bunch of subfolders.">

  </a>
  <figcaption class="center">Photos are located under DCIM folder, nested into a bunch of subfolders.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2024/09/02/iphone-media-recovery/media/iphone-transfer.png">
    <img src="/posts/2024/09/02/iphone-media-recovery/media/iphone-transfer_hu_a53310547121c017.webp"
     width="593"
     height="252"
     loading="lazy"
     decoding="async"
     alt="Ah yes, USB 2.0 speeds.">

  </a>
  <figcaption class="center">Ah yes, USB 2.0 speeds.</figcaption>
</figure>

<p>If you have copied everything over and want to make more space on your phone using this method, then you need to delete
files under
the <code>DCIM</code> folder <em><strong>and</strong></em> the cached thumbnails under the <code>PhotoData</code> folder. iOS seems to generate thumbnails for
the photos you take and even if you delete all the actual photos off of the device, then the photo thumbnails will still
show up in the Photos app and elsewhere. This confused the hell out of me after I deleted the backed up photos off the phone the first time.</p>









<figure class="center">
  <a href="/posts/2024/09/02/iphone-media-recovery/media/iphone-thumbnails.png">
    <img src="/posts/2024/09/02/iphone-media-recovery/media/iphone-thumbnails_hu_2ff5b8bcd23711f9.webp"
     width="800"
     height="235"
     loading="lazy"
     decoding="async"
     alt="Thumbnails are in a separate folder.">

  </a>
  <figcaption class="center">Thumbnails are in a separate folder.</figcaption>
</figure>

<p>Alternatively, you can just delete files from the Photos app on the phone itself to avoid this nuance.</p>
<p>Linux has its flaws, but at least it provides you with the power and tools needed to get you out of tricky situations.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>I can&rsquo;t wait for <a href="https://immich.app/">Immich</a> to get a stable release&hellip;&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>Apple and Microsoft related forums are <em>the worst</em> for getting an actual solution to your problem, which is in stark
contrast to FOSS/Linux related discussions.&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>Running my ThinkPad T430 with an eGPU in 2024</title><link>https://ounapuu.ee/posts/2024/08/07/thinkpad-t430-egpu/</link><pubDate>Wed, 07 Aug 2024 06:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2024/08/07/thinkpad-t430-egpu/</guid><description>Not all experiments end up being successful.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2024/08/07/thinkpad-t430-egpu/media/cover_hu_7607aeacfc765e1e.jpg" width="1200" height="630" alt="Running my ThinkPad T430 with an eGPU in 2024" /><p>I probably shouldn&rsquo;t have written down <a href="/posts/2024/07/03/thinkpad-t430-egpu/">my notes on the eGPU setup I had years ago.</a></p>
<blockquote>
<p>I’d be lying if I wasn’t considering remaking this setup with everything I’ve learned 6 years later.</p>
</blockquote>
<p>Oops.</p>
<p>I got access to an allegedly-faulty AMD Radeon RX 480 and an NVIDIA GTX 1650 for free thanks to my friend, so I ordered
the EXP GDC Beast v8.5c, two sorts of 6/8pin power cables, and a 12V 12A DC power supply.</p>
<p>The idea was to take a ThinkPad T430, bolt a GPU to it, and use it as a stationary workstation until the laptop
dies or gets too slow for modern tasks. The resale value of the T430 is too low for me to justify selling it, and if there&rsquo;s anyone
out there who can run a T430 into the ground 5+ years from now, then it&rsquo;s probably going to be me.</p>
<p>Quick specs:</p>
<ul>
<li>CPU: Intel i7-3820QM</li>
<li>RAM: 16GB DDR3</li>
<li>Storage: 4TB Samsung 870 QVO</li>
</ul>
<p>Side-note: I also went ahead and replaced the thermal paste with a bootleg Honeywell PTM7950 phase-changing
thermal pad. It works just as well as fresh thermal paste, but hopefully it won&rsquo;t drip out if the laptop is running
up-right, in a vertical laptop stand.</p>









<figure class="center">
  <a href="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-adapter-1.jpg">
    <img src="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-adapter-1_hu_a8376f85c0f96b27.webp"
     width="800"
     height="600"
     loading="lazy"
     decoding="async"
     alt="Side-view of the EXP GDC Beast adapter.">

  </a>
  <figcaption class="center">Side-view of the EXP GDC Beast adapter.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-adapter-2.jpg">
    <img src="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-adapter-2_hu_9646ac571f827866.webp"
     width="800"
     height="600"
     loading="lazy"
     decoding="async"
     alt="Top-down view.">

  </a>
  <figcaption class="center">Top-down view.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-adapter-3.jpg">
    <img src="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-adapter-3_hu_45028255a3f303c.webp"
     width="800"
     height="600"
     loading="lazy"
     decoding="async"
     alt="Backside of the adapter, with the AMD RX 480 attached.">

  </a>
  <figcaption class="center">Backside of the adapter, with the AMD RX 480 attached.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-closeup.jpg">
    <img src="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-closeup_hu_4a851ee24fa4d474.webp"
     width="800"
     height="600"
     loading="lazy"
     decoding="async"
     alt="The extra power cable was barely long enough to fit.">

  </a>
  <figcaption class="center">The extra power cable was barely long enough to fit.</figcaption>
</figure>

<h2 id="testing">
  <a class="heading-anchor" href="#testing">Testing<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>My testing with the GTX 1650 was brief, as the open source <code>nouveau</code> driver crashed on the Wayland desktop<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>, the proprietary
drivers under Fedora did not seem to work, and under Windows
the NVIDIA driver intentionally triggers the <code>error code 43</code> issue. <a href="https://egpu.io/forums/expresscard-mpcie-m-2-adapters/script-nvidia-error43-fixer/">A tweak exists for the Windows issue,</a> but
that didn&rsquo;t help much either.</p>
<p>The AMD Radeon RX 480 seems to work well out of the box on Windows 11, plug-and-play. However, it wasn&rsquo;t that stable,
but that could be related to the possibly faulty GPU itself or the power supply that can barely drive it under load.
Or the fact that Windows itself was running off of a 128GB Samsung USB 3.0 flash drive. Probably the latter, given that the
USB stick died as a result of this experiment.</p>









<figure class="center">
  <a href="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-win11.jpg">
    <img src="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-win11_hu_d6ea1e4bee937dd2.webp"
     width="800"
     height="600"
     loading="lazy"
     decoding="async"
     alt="Microsoft does not approve of this setup for at least 3 reasons.">

  </a>
  <figcaption class="center">Microsoft does not approve of this setup for at least 3 reasons.</figcaption>
</figure>

<p>On Fedora Linux 40, I discovered that eGPU-s aren&rsquo;t really plug and play. Sure, the image is there, but on my
ultrawide monitor I saw a whopping 11 frames per second! Turns out that by default GNOME on Wayland doesn&rsquo;t like
to use the eGPU as the main rendering device, even on more legitimate Thunderbolt-based eGPU setups.
It&rsquo;s a common enough problem that there exist <a href="https://github.com/hertg/egpu-switcher">multiple</a> <a href="https://github.com/ewagner12/all-ways-egpu">solutions</a> to this issue.</p>
<p>I didn&rsquo;t like any of them<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup>, so I disabled the <code>i915</code> kernel driver responsible for driving the iGPU, which did the trick.
The 3440x1440p ultrawide monitor was being rendered by the eGPU and for the most part the experience was very smooth.</p>









<figure class="center">
  <a href="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-linux.jpg">
    <img src="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-linux_hu_3f10c6f9f7d8ff15.webp"
     width="800"
     height="600"
     loading="lazy"
     decoding="async"
     alt="It&#39;s booting Linux!">

  </a>
  <figcaption class="center">It&#39;s booting Linux!</figcaption>
</figure>

<p>The iGPU in the T430 can also run the ultrawide monitor at 60 Hz via the DisplayPort port on the dock, but it can&rsquo;t
run things at 60 FPS at all times because it&rsquo;s really, really weak.</p>
<p>The eGPU ran things much smoother, which made the whole setup feel more responsive
and great to use. It&rsquo;s not the fastest setup in the world, but the GUI running smoothly certainly makes it feel like one.</p>
<p>I didn&rsquo;t have a ton of games installed for testing, but I did give Minecraft a try, and it ran just fine. The CPU was
struggling when building new parts of the map, but the visuals were doing fine and I could see myself playing on this
setup for hours.</p>
<p>There were some things that weren&rsquo;t running smoothly even with the eGPU. For example, 1080p H.265 video playback was awfully
choppy. Using <code>radeontop</code> revealed around 80% GPU usage, so either the decoding engine is crap on this GPU, or the very limited
PCIe bandwidth and CPU-GPU data transferring is the culprit.</p>
<p>I also tested LibreELEC to see how it handles the eGPU and I&rsquo;m happy to report that it renders Kodi on it by default,
with the UI running very smoothly.</p>
<p>On Linux I also saw some stability issues and crashes, but those could also be down to the faulty GPU or the PSU
being underpowered. I can probably rule out the latter by limiting the GPU clock speeds, and <a href="https://wiki.archlinux.org/title/AMDGPU#Manually">the Arch wiki</a>
has some great instructions for that. Those toggles do work, but I noticed that GNOME can be a bit choppier when the GPU
switches between lower power states to higher ones.</p>
<p>The physical stability of this setup is questionable, especially if you use a bigger GPU. Most prefabricated cases
for this eGPU adapter assume that you&rsquo;re running it with an ATX/SFX PSU, so those are out of the question for me.
There exist some 3D printable designs out there, but they can sometimes be very specific to a particular setup or GPU,
so I&rsquo;d have to design my own.</p>









<figure class="center">
  <a href="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-setup-2.jpg">
    <img src="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-setup-2_hu_cd6d8588c5f6c78c.webp"
     width="800"
     height="600"
     loading="lazy"
     decoding="async"
     alt="Work in progress.">

  </a>
  <figcaption class="center">Work in progress.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-setup-3.jpg">
    <img src="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-setup-3_hu_d7e920a5e3276e9.webp"
     width="800"
     height="600"
     loading="lazy"
     decoding="async"
     alt="I really like the look of the GPU, no need to worry about a case. Unless you have cats, which I do have. Uh-oh.">

  </a>
  <figcaption class="center">I really like the look of the GPU, no need to worry about a case. Unless you have cats, which I do have. Uh-oh.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-setup-1.jpg">
    <img src="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-setup-1_hu_4c6b14621f6471a0.webp"
     width="800"
     height="600"
     loading="lazy"
     decoding="async"
     alt="The final setup.">

  </a>
  <figcaption class="center">The final setup.</figcaption>
</figure>

<p>The power consumption of this setup isn&rsquo;t great, unfortunately. Using a smart plug I measured the idle power of the
eGPU component to be about 20W. Typical desktop usage and video playback results in around 50W and peaks around 120-130W,
which is right on the limit of the shoddy PSU I&rsquo;m using.</p>
<p>If I had the choice to pick any GPU for this setup, then I&rsquo;d likely opt for a modern AMD GPU that didn&rsquo;t require additional
power via the 6/8 pin power connector as that option would likely be a lot more efficient while yielding similar performance.</p>
<p>I ended up disassembling the setup in the end, partly because I
misdiagnosed <a href="https://gitlab.freedesktop.org/mesa/mesa/-/issues/11566">a Mesa bug</a> to be a GPU issue,
and because the RX 480 really was acting weird from time to time, even with LibreELEC.</p>









<figure class="center">
  <a href="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-error.jpg">
    <img src="/posts/2024/08/07/thinkpad-t430-egpu/media/egpu-error_hu_680842c76ceb91fe.webp"
     width="800"
     height="600"
     loading="lazy"
     decoding="async"
     alt="That can&#39;t be good.">

  </a>
  <figcaption class="center">That can&#39;t be good.</figcaption>
</figure>

<p>Not all experiments end up being successful.</p>
<h2 id="conclusion">
  <a class="heading-anchor" href="#conclusion">Conclusion<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I think that these types of eGPU adapters are great even in 2024, but only for a small number of very specific use cases,
and with GPU-s that actually work.</p>
<p>If you already have an older laptop around, and a compatible spare GPU collecting dust, then this setup will make sense for
desktop or media playback machines, and perhaps gaming if your demands are not very high.</p>
<p>I don&rsquo;t suggest building this setup from scratch, it&rsquo;s probably not worth the money and hassle. Used gaming PC-s
that have similar specifications to this eGPU build, but with no funny PCIe bandwidth limitations, go for less than
200 EUR at this point.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p><code>nouveau</code>? More like <code>novideo</code>, am I right?&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>not that they&rsquo;re bad, they are just made for a different type of setup.&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>How to save an old printer from the e-waste pile with a Raspberry Pi</title><link>https://ounapuu.ee/posts/2024/06/12/save-old-printer/</link><pubDate>Wed, 12 Jun 2024 06:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2024/06/12/save-old-printer/</guid><description>Turning a 15-year-old Canon PIXMA MP250 printer into a network printer was much easier than I initially thought.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2024/06/12/save-old-printer/media/cover_hu_8b18de1695374b7c.jpg" width="1200" height="630" alt="How to save an old printer from the e-waste pile with a Raspberry Pi" /><p>A family member has a Canon PIXMA MP250 printer, originally released in 2009.
It has been a very reliable piece of hardware, especially for a printer.</p>
<p>Then came Windows 10. The printer would not work out of the box with it and
the official drivers got stuck during installation. Fiddling with the printer
in device manager, trying to install drivers via Windows Update and stars
aligning
got the printer to work again.</p>
<p>Then came Windows 11. Nothing I did could get it working now, and the printer
is not even officially supported by Canon on this version of Windows.</p>
<p>This printer works out of the box on any mainstream Linux distribution, and
the family member had been using the printer with Ubuntu for years,
but <a href="https://www.id.ee/en/article/install-id-software/">a certain piece
of important software in Estonia</a>
was not working properly a lot of the time, which triggered a switch to Windows.<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup></p>
<p>Quick searches online suggested that I could turn this printer into a network
printer, as long as I had some patience and a spare computer.</p>
<p>The idea is simple: take a spare computer, hook it up to the printer, install
CUPS on it, configure it and you&rsquo;re good to go!</p>
<p>I initially tested this setup with a Zimaboard running Fedora Server, but the
final solution used an old Raspberry Pi B+ running the latest version of
Raspberry Pi OS.</p>
<h2 id="how-to-set-it-up">
  <a class="heading-anchor" href="#how-to-set-it-up">How to set it up<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>The steps will be similar with other pieces of hardware and Linux distributions,
you may just need to adjust a few commands and package names.</p>
<p>The steps are roughly based on these two guides:</p>
<ul>
<li><a href="https://m-hussainul-islam.medium.com/setting-up-network-printer-with-raspberry-pi-and-cups-d5a18e91b1f3">Setting up Network Printer with Raspberry Pi and CUPS</a></li>
<li><a href="https://pimylifeup.com/raspberry-pi-print-server/">Raspberry Pi Print Server: Setup a Network Printer</a></li>
</ul>
<p>If you&rsquo;re following along with a Raspberry Pi, set up your OS first. A minimal
installation with no graphical interface will be just fine.</p>
<p>Next, install <a href="https://www.cups.org/">CUPS</a> and optionally the right printer
drivers for your printer. The Canon PIXMA MP250 requires the
package <code>printer-driver-gutenprint</code>.</p>
<pre tabindex="0"><code>sudo apt install -y cups printer-driver-gutenprint
</code></pre><p>Make sure that CUPS is running.</p>
<pre tabindex="0"><code>sudo systemctl enable --now cups.service
</code></pre><p>Next, allow your user to manage printing. In this example, the username is <code>pi</code>.</p>
<pre tabindex="0"><code>sudo usermod -a -G lpadmin pi
</code></pre><p>Next, make sure that CUPS allows connections from other machines in your
network, and then restart it.</p>
<pre tabindex="0"><code>sudo cupsctl --remote-any
sudo systemctl restart cups
</code></pre><p>Find out the IP address of the Pi and navigate to it in your browser.
It will look something like <code>https://192.168.0.49:631</code>. The browser will likely
warn you about a self-signed certificate. It&rsquo;s safe to proceed.</p>
<p>If you haven&rsquo;t already connected your printer to the Raspberry Pi via USB, then
do so now.</p>
<p>Use the graphical interface to add a new printer under the <code>Administration</code>
section.
You&rsquo;ll need to enter the username and password for your user here. It&rsquo;s the same
user we used earlier, so in this example it&rsquo;s <code>pi</code>.</p>
<p>If you can&rsquo;t find your printer model listed in the <code>Add printer</code> view, then you
are probably missing the proper driver package, or your printer simply isn&rsquo;t
supported.</p>









<figure class="center">
  <a href="/posts/2024/06/12/save-old-printer/media/add-printer.png">
    <img src="/posts/2024/06/12/save-old-printer/media/add-printer_hu_6f3d551a1ca09828.webp"
     width="800"
     height="780"
     loading="lazy"
     decoding="async"
     alt="You should be able to find your printer in this view.">

  </a>
  <figcaption class="center">You should be able to find your printer in this view.</figcaption>
</figure>

<p>After adding your printer, you can use the CUPS web interface to print a test
page.</p>
<p>If that worked, then you should now be able to use any other device on the
network
to print!</p>
<p>On Linux and Windows, open the settings section that handles printing, and add a
new printer.
This networked printer should appear automagically, no additional configuration
required.</p>
<p>I also did testing using a Fairphone 5 running Android 13, and an iPhone X
running iOS 16. In both
cases the printing just worked.</p>









<figure class="center">
  <a href="/posts/2024/06/12/save-old-printer/media/test-page-windows.jpg">
    <img src="/posts/2024/06/12/save-old-printer/media/test-page-windows_hu_1a44a0e7cfd60776.webp"
     width="600"
     height="800"
     loading="lazy"
     decoding="async"
     alt="Test page printed using Windows 11.">

  </a>
  <figcaption class="center">Test page printed using Windows 11.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2024/06/12/save-old-printer/media/test-page-fedora.jpg">
    <img src="/posts/2024/06/12/save-old-printer/media/test-page-fedora_hu_686fc992f2a4cbdf.webp"
     width="600"
     height="800"
     loading="lazy"
     decoding="async"
     alt="Test page printed using Fedora. Yes, most of the colors in the colored ink
cassette have run out.">

  </a>
  <figcaption class="center">Test page printed using Fedora. Yes, most of the colors in the colored ink
cassette have run out.</figcaption>
</figure>

<p>I&rsquo;ve used the scanning functionality of this particular printer on Linux and it
has worked, however I forgot to test this out using this setup. I&rsquo;ll try to
test that out once I get the chance to try the printer out again.</p>
<h2 id="hardware-tech-tips">
  <a class="heading-anchor" href="#hardware-tech-tips">Hardware tech tips<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I first ran this setup with a Zimaboard to test the idea out. It worked very
well,
but as a simple print server it is a bit overkill.</p>
<p>I then replaced it with a Raspberry Pi B+, and while the printing works, I
discovered that a single ARM CPU core is apparently a limiting factor during
printing. A simple test page print pegged the CPU at 100%, and that&rsquo;s with the
700-&gt;1000 MHz overclock applied.</p>









<figure class="center">
  <a href="/posts/2024/06/12/save-old-printer/media/cups-high-cpu.png">
    <img src="/posts/2024/06/12/save-old-printer/media/cups-high-cpu_hu_dd8b775751f19ff5.webp"
     width="800"
     height="435"
     loading="lazy"
     decoding="async"
     alt="Raspberry Pi B&#43; struggling during printing.">

  </a>
  <figcaption class="center">Raspberry Pi B&#43; struggling during printing.</figcaption>
</figure>

<p>If you don&rsquo;t mind a slower printing speed, then any Raspberry Pi will be
absolutely OK.
More performant versions of Raspberry Pi will likely fare even better.</p>
<p>If you already have a small home server running, then you may want to hook the
printer up to that and set up the printer there. It&rsquo;s already running 24/7, so
it would be a perfect match.</p>
<p>One useful aspect of this setup is that you can queue up print jobs even when
the printer itself is powered off. Once you turn it on, the print jobs will
start, assuming that you have enough paper and ink.</p>
<p>Free open source software prolongs the useful life of hardware once again.
<a href="https://www.canalys.com/insights/end-of-windows-10-support-could-turn-240-million-pcs-into-e-waste">See y&rsquo;all in October 2025!</a></p>
<h2 id="2024-06-15-update">
  <a class="heading-anchor" href="#2024-06-15-update">2024-06-15 update<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>This post got featured on:</p>
<ul>
<li><a href="https://www.xda-developers.com/raspberry-pi-unsupported-printer-on-windows/">XDA Developers</a></li>
<li><a href="https://www.hackster.io/news/herman-ounapuu-brings-an-abandoned-printer-back-from-the-brink-with-a-raspberry-pi-90701ccb1ab9">hackster.io</a></li>
<li><a href="https://hackaday.com/2024/06/13/raspberry-pi-saves-printer-from-junk-pile/">Hackaday</a></li>
<li><a href="https://news.ycombinator.com/item?id=40657753">Hacker News</a></li>
</ul>
<p><a href="https://ubuntu.social/@till/112616367405119050">And even the leader of OpenPrinting, Till Kamppeter, chimed in!</a>
They also held a talk about <a href="https://fosdem.org/2024/schedule/event/fosdem-2024-1930-openprinting-we-make-printing-just-work-/">OpenPrinting at FOSDEM 2024.</a></p>
<p>Regarding scanning, seems like there&rsquo;s a separate project for that called <a href="http://www.sane-project.org/">SANE - Scanner Access Now Easy.</a></p>
<p><a href="https://openprinting.github.io/">Find out more about OpenPrinting here.</a></p>
<h2 id="2024-11-14-update">
  <a class="heading-anchor" href="#2024-11-14-update">2024-11-14 update<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>A reader shared with me the <a href="https://github.com/kenyapcomau/p910nd">p910nd</a> project that can be used for a similar
purpose. I have not yet tried this myself.</p>
<p>There&rsquo;s even
an <a href="https://openwrt.org/docs/guide-user/services/print_server/p910ndprinterserver">OpenWRT page that describes its use on a router!</a></p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>that might be about to change as there is an <a href="https://flathub.org/apps/ee.ria.qdigidoc4">unofficial Flatpak version</a> out there.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>Steam Deck: I like it</title><link>https://ounapuu.ee/posts/2024/06/02/steam-deck/</link><pubDate>Sun, 02 Jun 2024 06:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2024/06/02/steam-deck/</guid><description>It runs Linux and you can peek under the hood if you want to, but that's not the point.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2024/06/02/steam-deck/media/cover_hu_de171b612b822e85.jpg" width="1200" height="630" alt="Steam Deck: I like it" /><p>I got a <a href="https://store.steampowered.com/steamdeck">Steam Deck</a>.</p>
<p>Only took me a year or so of contemplating getting
one, <a href="/posts/2022/12/01/holoiso-steam-deck-experience/">and trying out HoloISO, the unofficial SteamOS installer</a>
finally convinced me to get one.<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup></p>
<p>It took another year to actually get down to writing down my thoughts on it.</p>
<p>This post is written from the perspective of a software developer who used to play video games a lot as a teenager,
less so as an adult, and as someone who dabbles with Linux as a hobby.</p>
<h2 id="overview">
  <a class="heading-anchor" href="#overview">Overview<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>The <a href="https://www.steamdeck.com/en/oled">Steam Deck OLED exists now</a>, but back when I got my Steam Deck, it came in three flavours, and in the interests of my
budget I opted for the cheapest option that came with
only 64 GB of storage (eMMC based).</p>









<figure class="center">
  <a href="/posts/2024/06/02/steam-deck/media/deck-packaging.jpg">
    <img src="/posts/2024/06/02/steam-deck/media/deck-packaging_hu_61f9f98d0950e0bc.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="Steam Deck, the packaging, and cat.">

  </a>
  <figcaption class="center">Steam Deck, the packaging, and cat.</figcaption>
</figure>

<p>I also got a 512 GB microSD card to hold all the games.
All in all, this setup cost about 470 EUR. Certainly cheaper than the 512 GB NVMe SSD model that sold for 679 EUR at
the time of writing. The shipping estimate to Estonia was about 1-2 weeks, and mine arrived in almost exactly 1 week,
which was nice. And in one piece as well!</p>









<figure class="center">
  <a href="/posts/2024/06/02/steam-deck/media/deck-storage.jpg">
    <img src="/posts/2024/06/02/steam-deck/media/deck-storage_hu_64cca68031d3f7fe.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="Half a terabyte of games, all in that small microSD card.">

  </a>
  <figcaption class="center">Half a terabyte of games, all in that small microSD card.</figcaption>
</figure>

<p>I don&rsquo;t have the official <a href="https://www.steamdeck.com/en/dock">Steam Deck Dock</a> (try saying that 10 times in a row), but what I do have is a vertical laptop
stand and a Dell WD19TB dock. As long as you leave a gap for airflow, then this combination works quite well if you
want to use the Steam Deck in a docked mode. The combination of this dock and the Steam Deck also works nicely, the
3440x1440p ultrawide monitor gets picked up fine and even the gigabit Ethernet port works at the rated speed.</p>
<p>However, it seems like the Steam Deck USB-C compatibility can be dependent on your monitor and dock choice. While the Dell
WD19TB dock worked great with an ultrawide monitor, a Lenovo Thinkpad USB-C dock would fail to output anything to
the same monitor quite often. Turning on the setting to enable safe resolutions for the external display
and setting the resolution manually usually fixes it, but it&rsquo;s still quite annoying.</p>









<figure class="center">
  <a href="/posts/2024/06/02/steam-deck/media/deck-dock.jpg">
    <img src="/posts/2024/06/02/steam-deck/media/deck-dock_hu_39dbc18f3acf6a04.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="Steam Deck docked. ">

  </a>
  <figcaption class="center">Steam Deck docked. </figcaption>
</figure>

<h2 id="its-booting-linux">
  <a class="heading-anchor" href="#its-booting-linux">It&rsquo;s booting Linux!<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Not long after I set the Steam Deck up, I switched to desktop mode and opened a terminal window to confirm that yes,
this thing is running Linux. Arch Linux, in fact, or at least a modified version of it.</p>









<figure class="center">
  <a href="/posts/2024/06/02/steam-deck/media/deck-terminal.jpg">
    <img src="/posts/2024/06/02/steam-deck/media/deck-terminal_hu_a5e83bb27b56f91c.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="btw I run Arch">

  </a>
  <figcaption class="center">btw I run Arch</figcaption>
</figure>

<p>But in all other aspects, it&rsquo;s just like a normal computer, with an actual UEFI setup that you can browse.
With the Steam Deck, you get the polished experience of a gaming console and the
freedom to do whatever you want to with the software and hardware.</p>
<p>You can also boot any x86-based Linux distro, like Fedora Linux.</p>









<figure class="center">
  <a href="/posts/2024/06/02/steam-deck/media/deck-fedora.jpg">
    <img src="/posts/2024/06/02/steam-deck/media/deck-fedora_hu_2ee4a7319253bc45.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="If all my other computers stopped working, then I could totally work out of a Steam Deck.">

  </a>
  <figcaption class="center">If all my other computers stopped working, then I could totally work out of a Steam Deck.</figcaption>
</figure>

<p>Or if SteamOS 3 is too limiting for you, then check out projects like <a href="https://bazzite.gg/">Bazzite.</a>
The experience will be very similar, but it&rsquo;s easier to tweak the setup to your
liking. Bazzite also allows you to format storage as <code>btrfs</code> with compression
enabled, meaning that you can fit more games on your device with a very slight
increase in CPU usage. I&rsquo;m sticking with the official Steam Deck experience for
now, but I&rsquo;m tempted to try Bazzite for the <code>btrfs</code> aspect alone.</p>
<p>The desktop experience on the Steam Deck is quite nice. You can easily boot into it
from the graphical interface, and it runs on KDE Plasma. The design language of KDE is an eyesore, but it makes up for it with the responsive UI.</p>
<p>The touchpads are not that big, but they&rsquo;re plenty good for
clicking around. Manually popping up the on-screen keyboard by pressing <code>STEAM + X</code> is a bit annoying at first,
but it gets the job done.</p>
<p>Installing software can be done in the graphical environment via the &ldquo;Discover&rdquo; app that ships with the desktop
environment.
One thing you&rsquo;ll probably notice is that the selection of software is a bit limited, and that&rsquo;s mainly down to how
the Steam Deck is set up by default. All the apps you install are installed via <a href="https://flatpak.org/">Flatpak</a> and while the selection of apps
that are available as a Flatpak grows with time, not everything is yet present there.</p>
<p>I was surprised to see that the <a href="https://help.steampowered.com/en/faqs/view/671A-4453-E8D2-323C">Steam Deck Desktop FAQ</a>
actually has useful information for an enthusiast like myself, even mentioning what a flatpak is.</p>
<h2 id="peeking-under-the-hood">
  <a class="heading-anchor" href="#peeking-under-the-hood">Peeking under the hood<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>During the first couple of months I went the tinkerers&rsquo; path, enabled the SSH server, unlocked the root partition for
modifications and automated the setup of my Steam Deck. While this thing is running a flavor of Arch Linux, it&rsquo;s not
really designed for these types of manual modifications. I had to mess around to get the Arch default package manager
<code>pacman</code> to work, but at one point messing with <code>pacman</code> and running commands that I didn&rsquo;t know much about, I blew up
the OS by force-installing some packages and throwing out a crucial dependency. Whoops.</p>
<p>Well, at least the Steam Deck OS recovery setup is quite straightforward. Download the OS recovery image, put it on an
USB stick, boot it on the Steam Deck and re-image the OS. There are also options to attempt repairs or open a terminal
window in case you know how to fix the mess you&rsquo;ve created.</p>
<p>One downside of the SteamOS recovery setup became apparent when Valve released a buggy software update around
summer/fall of 2023. The update was buggy for many users, including myself, with games crashing or running poorly. On my
Deck the SD card was also automatically reformatted for some reason so I had to redownload all the games I had on that. When I went to
download the recovery image, I discovered that you could only go back to the current, buggy version of Steam Deck OS.</p>
<p>By fiddling with the download link I could navigate to a web directory where older recovery images were present. Those
weren&rsquo;t much help though. Although you could boot into an older version during the initial Steam Deck setup, it would
auto-update to the newest version automatically, with no obvious way to bypass it.</p>
<p>The real workaround would have been
to manually boot into the older version of the OS that sits on the other partition and not update for a while. I unfortunately
discovered that <em>after</em> I had re-imaged the Steam Deck, which formats the whole drive.</p>
<p>I&rsquo;ve now stopped with the tinkering. I still have an SSH server running on it, but it&rsquo;s
there so that I can install my favourite applications as flatpaks and deploy the
backup script, via Ansible. That&rsquo;s it.</p>
<h2 id="its-booting-windows">
  <a class="heading-anchor" href="#its-booting-windows">It&rsquo;s booting&hellip; Windows?<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>









<figure class="center">
  <a href="/posts/2024/06/02/steam-deck/media/deck-windows.jpg">
    <img src="/posts/2024/06/02/steam-deck/media/deck-windows_hu_bae718fc31869609.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="Cursed Steam Deck.">

  </a>
  <figcaption class="center">Cursed Steam Deck.</figcaption>
</figure>

<p>Don&rsquo;t worry, Valve doesn&rsquo;t even officially support running Windows on this thing,
and <a href="https://store.steampowered.com/news/app/1675200/view/3131696199122435099">while you can do it</a>, I don&rsquo;t
really recommend it. You&rsquo;ll be giving up all the nice things about SteamOS while
also taking on the hassle of running Windows, including unexpected Windows updates.</p>
<h2 id="games-are-too-damn-big">
  <a class="heading-anchor" href="#games-are-too-damn-big">Games are too damn big<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>512 GB of storage on something as small as a fingernail was something I would have never expected to see 10 years ago,
but here we are. There are even bigger microSD cards out there, but those also cost a lot more.</p>
<p>And even with this marvel of technology I ran into issues when installing games. Install GTA V, Forza Horizon 4, and
God of War, and just like that about half of all that storage is gone.</p>
<p>The 64 GB internal drive was also quite limiting, especially due to shader cache and compatibility layer (Proton) related
files taking up a majority of it. The situation has improved now, but I still went ahead and replaced it with a 1 TB
M.2 2230 NVMe SSD that I ordered online for 74 EUR in May 2023, which still makes it a cheaper option than the 512 GB model sold at the time.</p>
<p>The new SSD works well, it&rsquo;s fast and doesn&rsquo;t seem to affect battery life negatively.
Changing it was quite simple, all you need is an appropriate screwdriver, good fingernails or a plastic spudger to get
the case off, and some delicate care when working inside the Steam Deck.</p>
<p>Before I replaced my SSD, I tried all sorts of wild-ass ideas to fit more games on my Steam Deck.</p>
<p>First, I tried <a href="https://nextcloud.com/">Nextcloud</a>.
The idea is simple: I&rsquo;m not going to be playing all my games all the time, so it makes sense to offload some of those
to my home server and retrieve them over the fast local network whenever I want to play them. This idea makes even more
sense
if your internet speeds are not that great.</p>
<p>The results were mixed. The syncing part was working surprisingly well with the transfer speeds capping out at 1 Gbit/s
over Ethernet
and actually being faster than the microSD card itself at times. However, the usability of this setup is not that great.
You can select which folders to sync in the Nextcloud Client application, but Steam will still believe that a game is
installed even if the game files are missing as long as the app manifest file is present. This can lead to annoying
situations where you try to play a game and discover that the games files are not present on your Steam Deck.</p>
<p>The second solution I tried out was <code>iSCSI</code>. I
followed <a href="https://www.reddit.com/r/SteamDeck/comments/z7sh8v/how_to_connect_to_an_iscsi_disk/">this guide on Reddit</a>.
Getting iSCSI to work was tricky even for someone like myself who should be able to do this technical stuff properly,
but I ended up getting it working. I formatted the iSCSI device as ext4, mounted it and made it a Steam library folder
in Steam desktop mode.</p>
<p>The benefit of this solution is that as long as you have access to the server, the iSCSI storage device will show up
on your Steam Deck as any other drive and games will just work. If your network is good enough, you can play games that
are stored on your server, which might make a lot of sense for games that you generally play in docked mode.
Transferring games to your internal storage is also simple, performant and can be done entirely within the Steam UI.
The iSCSI setup is not that great mainly due to the technical complexity of the setup, making it a no-go for the more
casual audience. The performance over Wi-Fi was also lousy, and it&rsquo;s also difficult to justify having a good chunk of
your
home server storage being permanently held up by Steam games.</p>
<p>After all that hassle, I went with the solution that most people would have gone with already: store games on an
external SSD. Duh. It has the same benefits as the iSCSI setup, but it&rsquo;s faster and you can bypass
a lot of the technical complexity. The external SSD is also automatically mounted
when you connect it to the Steam Deck if it&rsquo;s formatted as <code>ext4</code>, making it a very convenient option for docked play.</p>









<figure class="center">
  <a href="/posts/2024/06/02/steam-deck/media/deck-extra-ssd.jpg">
    <img src="/posts/2024/06/02/steam-deck/media/deck-extra-ssd_hu_5ce32880716602dc.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="Not as janky as you&#39;d think.">

  </a>
  <figcaption class="center">Not as janky as you&#39;d think.</figcaption>
</figure>

<p>If you happen to have a fast desktop PC with plenty of storage, or a home server,
then consider using the <a href="/posts/2023/09/11/steam-cache/">Steam local network game transfers.</a>
You won&rsquo;t fit more games onto the Steam Deck, but redownloading them will be
much faster.</p>
<p>We really need to start decoupling high resolution textures and other high quality assets from the base game at some
point because the current approach is just silly. For a device like Steam Deck you&rsquo;re rarely going to run those games with
the highest quality settings, meaning that those assets will just sit there on the disk taking up space.</p>
<p>A free optional DLC could work well in theory. In practice I&rsquo;m sure that game
publishers would quickly turn
a high quality texture pack into a paid DLC.</p>
<h2 id="the-part-where-i-play-games">
  <a class="heading-anchor" href="#the-part-where-i-play-games">The part where I play games<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Enough about the part where I tinker with the system. Let&rsquo;s talk about the games.</p>









<figure class="center">
  <a href="/posts/2024/06/02/steam-deck/media/deck-art-of-rally.jpg">
    <img src="/posts/2024/06/02/steam-deck/media/deck-art-of-rally_hu_e98a579c7f21a9c2.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="&#34;art of rally&#34; is a great game to play on the Steam Deck.">

  </a>
  <figcaption class="center">&#34;art of rally&#34; is a great game to play on the Steam Deck.</figcaption>
</figure>

<p>I had some idea about the game compatibility when I tried out <a href="https://github.com/HoloISO/holoiso">HoloISO</a>.
I&rsquo;m happy to report that the game compatibility is even better on the Steam Deck.
This fact alone is a minor miracle. Some years ago I was convinced that the only way to properly play games on Linux
was to <a href="/posts/2021/08/29/testing-gpu-passthrough-on-amd-ryzen-5700g/">set up a VM with Windows installed in it.</a></p>
<p>With the Steam Deck, you download the game and run it. Simple as.<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup></p>
<p>The Steam Deck is not the most powerful machine in the world, but it has a decent CPU in it. The GPU
is more akin to integrated GPU-s that ship in modern AMD Ryzen based laptops, it&rsquo;s still plenty of power
to run games at the native 1280x800 resolution.</p>
<p><a href="https://store.steampowered.com/app/1593500/God_of_War/">God of War (2018)</a> did stutter a bit, but in most situations you can expect around 40-60 FPS.</p>
<p><a href="https://store.steampowered.com/app/271590/Grand_Theft_Auto_V/">GTA V</a> was running fine as well, although the game is CPU limited at times and can drop to around 40 FPS in certain
sections of the map, especially in GTA Online.</p>
<p><a href="https://store.steampowered.com/app/1167630/Teardown/">Teardown</a> runs alright
after you lower the settings, and it&rsquo;s best
played in docked mode due to some fun mods being designed around keyboard
controls. It&rsquo;s really fun, but it will bring
the Steam Deck to its knees when you do some heavy destruction. Totally playable
though, and I&rsquo;ve had a lot of fun with this game.</p>
<p><a href="https://store.steampowered.com/app/228380/Wreckfest/">Wreckfest</a> runs well with medium or high settings. I feel the framerate dropping
a bit when heading into the first corner
and being part of a 24-car pile-up, but in all other situations it&rsquo;s smooth
enough.</p>
<p><a href="https://store.steampowered.com/app/47870/Need_For_Speed_Hot_Pursuit/">Need for Speed Hot Pursuit (2010)</a> runs very well and is an absolute blast on the
Steam Deck. Crank the settings to maximum and enjoy the thrilling police chases.</p>
<p><a href="https://store.steampowered.com/app/1262560/Need_for_Speed_Most_Wanted/">Need for Speed Most Wanted (2012)</a> is also great on the Steam Deck.</p>
<p><a href="https://store.steampowered.com/app/1262600/Need_for_Speed_Rivals/">Need for Speed Rivals (2013)</a> runs well after you apply the tweak that forces the game to run at
60 FPS. The game is a bit buggy even on Windows, so expect some bugs and crashes.</p>
<p>More modern Need for Speed titles, such as
<a href="https://store.steampowered.com/app/1262540/Need_for_Speed/">Need for Speed (2015)</a>,
<a href="https://store.steampowered.com/app/1262580/Need_for_Speed_Payback/">Need for Speed Payback (2017)</a>
and
<a href="https://store.steampowered.com/app/1222680/Need_for_Speed_Heat/">Need for Speed Heat (2019)</a>
are playable, but will typically run anywhere between 40-60 FPS. The handy
framerate capping
feature of the Steam Deck will help a lot in those cases since a stable 40-45
FPS is a much better experience than
a wildly fluctuating and unstable framerate.</p>
<p>More lightweight games run like a charm while using very little power. This includes titles
like <a href="https://store.steampowered.com/app/1794680/Vampire_Survivors/">Vampire Survivors</a><sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup>
and <a href="https://store.steampowered.com/app/702670/Donut_County/">Donut County</a>.</p>
<p>What I really like about the Steam Deck is that performance tuning is very accessible. You can toggle <code>mangohud</code> with
various levels of detail to narrow down any performance troubles, and you have great control over the CPU and GPU
speeds. All of this can be done while the game is running.</p>









<figure class="center">
  <a href="/posts/2024/06/02/steam-deck/media/deck-mangohud.jpg">
    <img src="/posts/2024/06/02/steam-deck/media/deck-mangohud_hu_22de1e96d972e4d2.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="It&#39;s like MSI Afterburner overlay, but built-in and all set up for you.">

  </a>
  <figcaption class="center">It&#39;s like MSI Afterburner overlay, but built-in and all set up for you.</figcaption>
</figure>

<p>The APU in the Steam Deck tries its best to share the limited power that the system can pull between the CPU and GPU,
and in most cases it works well, but there are games where the CPU or the GPU demands can fluctuate a lot. In those
scenarios it helps if you lock the GPU clock speed to an amount that keeps the GPU usage to around 80% or less. Being
able to play with settings like this is one of the reasons why I got Forza Horizon 4 to be playable within minutes of
tinkering.</p>









<figure class="center">
  <a href="/posts/2024/06/02/steam-deck/media/deck-fh4.jpg">
    <img src="/posts/2024/06/02/steam-deck/media/deck-fh4_hu_a181eba620c52096.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="Forza Horizon 4 on the Deck runs surprisingly well after you tweak a few settings.">

  </a>
  <figcaption class="center">Forza Horizon 4 on the Deck runs surprisingly well after you tweak a few settings.</figcaption>
</figure>

<p>There are a few games that I like to play but aren&rsquo;t working well on the Steam Deck, such as GTA III or Vice City, but
that is pretty much it. Over the one year that I&rsquo;ve had the Steam Deck, a lot of games have gained support, either
by Valve improving the Proton compatibility layer, or game publishers releasing updates that make the game work on the
Steam Deck.</p>
<p>One such example
is <a href="https://store.steampowered.com/app/12360/FlatOut_Ultimate_Carnage_Collectors_Edition/">FlatOut Ultimate Carnage</a>,
which seems to have been bought by a new publisher that removed the &ldquo;Games for
Windows Live&rdquo; mess and got the game &ldquo;Steam Deck Verified&rdquo; in the process.</p>
<p>The performance of the Steam Deck was actually quite surprising in a lot of
games. For example, I&rsquo;ve never
seen <a href="https://store.steampowered.com/app/12210/Grand_Theft_Auto_IV_The_Complete_Edition/">GTA IV</a>
run so well on any machine that I&rsquo;ve owned before.</p>









<figure class="center">
  <a href="/posts/2024/06/02/steam-deck/media/deck-gta4.jpg">
    <img src="/posts/2024/06/02/steam-deck/media/deck-gta4_hu_c09b521cf2150496.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="The best GTA IV experience I&#39;ve ever had. ">

  </a>
  <figcaption class="center">The best GTA IV experience I&#39;ve ever had. </figcaption>
</figure>

<p>If you want to see if your favourite games are compatible with the Steam Deck I recommend you check
out <a href="https://www.protondb.com/">ProtonDB</a> for a detailed overview.
YouTube is your friend if you want to see some specific games being tested on the Steam Deck.</p>
<p>When it comes to emulating PS1, PS2 and PSP games, the Steam Deck is fantastic. There&rsquo;s plenty of performance to emulate
those consoles well, and for whatever reason playing the childhood classics on the Steam Deck feels so right. With PSP
the comparison is even more apt as it&rsquo;s basically a bigger PSP but with a much better battery life.</p>









<figure class="center">
  <a href="/posts/2024/06/02/steam-deck/media/deck-psp.jpg">
    <img src="/posts/2024/06/02/steam-deck/media/deck-psp_hu_cf25b34000d41f15.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="Steam Deck and the whole PSP game library is a great match.">

  </a>
  <figcaption class="center">Steam Deck and the whole PSP game library is a great match.</figcaption>
</figure>

<p>More intensive games can discharge the battery in about 2-3 hours, but when
playing emulated games for older consoles you can expect up
to 7-8 hours of gameplay.</p>
<h2 id="non-steam-pc-gaming">
  <a class="heading-anchor" href="#non-steam-pc-gaming">Non-Steam PC gaming<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>It&rsquo;s clear from the name that this console is set up around Steam. As long as all
your games are purchased on Steam, you&rsquo;ll have a great time.</p>
<p>I do have some games from other sources, such as <a href="https://www.gog.com">GOG.</a></p>
<p>There exist community-supported launchers, such as <a href="https://heroicgameslauncher.com/">HeroicGamesLauncher</a>.
They work, but might require a bit of setup and fiddling to get things like cloud
synced game saves to work properly. In the case of <code>art of rally</code> on GOG, you&rsquo;ll
also lose out on multiplayer daily/weekly challenges.</p>
<p>If you have some older games on CD-s, or legally acquired archived copies of
PC games, then the situation gets tricky. There exist solutions like <a href="https://lutris.net/">Lutris</a>
or <a href="https://usebottles.com/">Bottles</a>, however I never quite had a good experience
with those, especially once you deviate from the happy path.</p>
<p>In my experience, if you want to have the best chance at playing your old
PC games, then you&rsquo;ll need to obtain a version of the game that has a no-CD patch
applied to it already, add it to Steam and set a version of the Proton compatibility layer.
Some legally dubious sources for these games label these packages as &ldquo;direct play&rdquo; as well.</p>
<p>There can also be a difference when running games via gaming or desktop mode.
Need for Speed Most Wanted (2005) did not work when started via gaming mode, but
it started up just fine in desktop mode.</p>
<p>Proton, the compatibility layer, is great for what it allows us to do, but I feel
like the concept and technical implementation is something that novice users
will never quite understand. This also becomes apparent when you look up discussions
online where novice users try to apply mods to their favourite games. It works out of the box on Windows, but
you need to grok the way Proton handles things for it to work on the Steam Deck.</p>
<p>I consider myself competent with computers and stuff,
but even I need to sit down and think about what&rsquo;s going on when working in this area.</p>
<h2 id="backups">
  <a class="heading-anchor" href="#backups">Backups<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I rely on <a href="https://github.com/mtkennerly/ludusavi">Ludusavi</a> to collect all my
game saves,
and I use <code>rsync</code> to back them up to my home server.</p>
<p>I made a desktop entry for the backup script. By right-clicking it in desktop
mode and
selecting <code>Add to Steam</code>, it will appear in your Steam library like any other
game or application.
This means that I don&rsquo;t have to quit gaming mode to back up the Steam Deck.</p>
<p>The backup script also updates all the applications that I&rsquo;ve installed as a
flatpak, and shuts the device down after it&rsquo;s done.</p>
<h2 id="its-big">
  <a class="heading-anchor" href="#its-big">It&rsquo;s big.<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>The Steam Deck is big.</p>
<p>This does mean that Valve can pack a lot of compute power and cooling into it,
but it comes with the trade-off
of it not fitting that well into a backpack. The hardcase that it ships with is
great for preventing damage
to the Steam Deck, but it takes up a lot of space.</p>
<p>I don&rsquo;t find the size uncomfortable, quite the opposite actually, but for others
it might be a problem.</p>
<p>I&rsquo;ve had the opportunity to briefly play on a Nintendo Switch Lite. There&rsquo;s
something
that feels special about that form factor. The performance is not great compared
to the Steam Deck, but I feel like the Nintendo Switch is in its own class of
portable gaming consoles.</p>
<p>I wonder how a Nintendo Switch sized Steam Deck would perform.</p>
<h2 id="the-controls">
  <a class="heading-anchor" href="#the-controls">The controls<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>The controls on the Steam Deck are good. It takes the best aspects of the
<a href="https://en.wikipedia.org/wiki/Wii_U_GamePad">Nintendo Wii U</a>
and <a href="https://en.wikipedia.org/wiki/Xbox_360_controller">Xbox 360</a>
controllers and smashes them into one polished experience.</p>
<p>The Steam Deck has some extra mappable buttons on the back. They sound great in
theory, but I rarely use them. When I do, I find that the L4 and R4 buttons
are more easily reachable compared to L5 and R5 (the lower ones).</p>
<p>When I <em>do</em> use those extra buttons, they are invaluable.
In <a href="https://store.steampowered.com/app/1262600/Need_for_Speed_Rivals/">Need for Speed Rivals (2013)</a>,
I mapped L4 and R4 to the two power-up slots, which left my thumbs free to focus
on driving and looking around.</p>
<p>Using those extra buttons does require some readjustment. It was difficult to
reprogram my muscle memory and remember that I have those extra buttons there.</p>
<p>Steam also provides lots of controller templates, both Valve-approved and community ones.
If the game you want to play doesn&rsquo;t have official controller support, then it&rsquo;s
highly likely that someone else has created a controller configuration that
emulates keypresses and allows you to play your favourite game on the Steam Deck.</p>
<p>Sometimes that doesn&rsquo;t quite work, in which case you can create your own layout, or
improve an existing one.</p>
<p>There&rsquo;s also the gyro functionality, but I&rsquo;ve only used it
in <a href="https://store.steampowered.com/app/1902490/Aperture_Desk_Job/">Aperture Desk Job</a>,
which itself is like a fancy demo of the controller capabilities of the Steam
Deck. Never quite found a suitable use case for this input method in other
games.</p>
<h2 id="the-fun-factor">
  <a class="heading-anchor" href="#the-fun-factor">The fun factor<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Based on what you read, you might think that I got the Steam Deck for the tinkering aspect. While that&rsquo;s certainly
part of the rationale behind getting one, it wasn&rsquo;t the main one.</p>
<p>I got one as an excuse to finally spend more time resting. I have had a bad habit of trying to be productive at all
times, which can lead to exhaustion and eventually burning out.</p>
<p>With the Steam Deck I&rsquo;ve been able to actually spend some time playing games and turning my brain off.</p>
<p>I love it.</p>
<p>And it gives my cats a great opportunity to snuggle up while I do some illegal street racing. Win-win.</p>
<p>There&rsquo;s something different about playing games on the Steam Deck. Perhaps it&rsquo;s related to the memories I had as a
teenager playing on my PlayStation Portable a lot, or knowing that I can replay all my favourite console games
without having to set up the physical consoles themselves.</p>
<h2 id="the-sad-reality-of-adulthood">
  <a class="heading-anchor" href="#the-sad-reality-of-adulthood">The sad reality of adulthood<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I love using the Steam Deck. However, I still can&rsquo;t seem to make much time for it when life gets busy.</p>
<p>That&rsquo;s my only big gripe with it.</p>
<h2 id="conclusion">
  <a class="heading-anchor" href="#conclusion">Conclusion<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>If you&rsquo;ve been on the edge about getting a Steam Deck, then I hope that this post has helped you make a decision.
It has some rough edges, but when it works, it feels magical.</p>
<p>If you already have a gaming PC with a modern AMD GPU in it, then consider trying out
projects like <a href="https://bazzite.gg/">Bazzite</a>, <a href="https://github.com/HoloISO/releases">HoloISO</a> or <a href="https://chimeraos.org/">ChimeraOS</a> to get a taste of the Steam Deck experience.</p>
<p>Even if I can&rsquo;t put in as many hours as I&rsquo;d like to, I still love my Steam Deck
and don&rsquo;t regret getting it at all.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>this makes Valve&rsquo;s silence on releasing SteamOS 3 to a wider
audience puzzling. Do they not want to sell more Steam Decks?&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>assuming that it&rsquo;s a Steam Deck Verified title.&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:3">
<p>it&rsquo;s really addicting, be careful.&#160;<a href="#fnref:3" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>ThinkPad T40: it can still run modern Linux, for now</title><link>https://ounapuu.ee/posts/2024/05/24/thinkpad-t40/</link><pubDate>Fri, 24 May 2024 06:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2024/05/24/thinkpad-t40/</guid><description>Not bad for a laptop originally released in 2003.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2024/05/24/thinkpad-t40/media/cover_hu_8db5f66bd4f9d1cd.jpg" width="1200" height="630" alt="ThinkPad T40: it can still run modern Linux, for now" /><p>I recently busted out my old ThinkPad T40, the last of the OG IBM ThinkPads.</p>
<p>I picked it up some time around my university days because I liked collecting
ThinkPads at the time, and it was a nice complement to my existing ThinkPad T60
and T430.</p>









<figure class="center">
  <a href="/posts/2024/05/24/thinkpad-t40/media/old-vs-new.jpg">
    <img src="/posts/2024/05/24/thinkpad-t40/media/old-vs-new_hu_ba2f2078cac7a2c3.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="20 years difference, but they still look similar. ">

  </a>
  <figcaption class="center">20 years difference, but they still look similar. </figcaption>
</figure>

<p>The battery is dead, but everything else still works. Checking a few online
listings,
I&rsquo;m surprised that I can still find batteries sold for this model. Probably old stock
that&rsquo;s been sitting around in a warehouse slowly discharging to death, but hey,
you might get lucky!</p>
<p>I also learned that I had
replaced the internal IDE hard drive with a 16 GB mSATA SSD via an adapter at
one point. I don&rsquo;t think they even sell SSD-s that small nowadays, but the size
feels age-appropriate.</p>
<p>I had already installed a flavor of Linux on this, but had completely forgotten
the password.<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> This was a good excuse to wipe it and see if I can install a
modern mainstream Linux distro on it.</p>
<p>I went with Debian 12 (Bookworm). It&rsquo;s the newest Debian release, and unlike
many other distros, <a href="https://www.debian.org/distrib/netinst">they still offer 32-bit installers.</a></p>









<figure class="center">
  <a href="/posts/2024/05/24/thinkpad-t40/media/debian-install.jpg">
    <img src="/posts/2024/05/24/thinkpad-t40/media/debian-install_hu_713e76cda7f87c0c.webp"
     width="600"
     height="800"
     loading="lazy"
     decoding="async"
     alt="Modern Linux on an ancient laptop.">

  </a>
  <figcaption class="center">Modern Linux on an ancient laptop.</figcaption>
</figure>

<p>It had been a while since I had last installed Debian via the terminal user
interface.
The experience felt surprisingly snappy.</p>









<figure class="center">
  <a href="/posts/2024/05/24/thinkpad-t40/media/debian-wip.jpg">
    <img src="/posts/2024/05/24/thinkpad-t40/media/debian-wip_hu_257e194361a44b84.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="It&#39;s probably been 5&#43; years since I last installed Debian on a machine. What a throwback!">

  </a>
  <figcaption class="center">It&#39;s probably been 5&#43; years since I last installed Debian on a machine. What a throwback!</figcaption>
</figure>

<p>I went with the good old XFCE desktop environment. It strikes a good balance of
being lightweight, simple and usable.</p>
<p>Things were great until I started up Firefox. It works, but man, is it slow. All
the years of browser complexity have caught up with this laptop and made the web
barely usable.</p>
<p>It does pass the <em>techtipsy</em> test.</p>









<figure class="center">
  <a href="/posts/2024/05/24/thinkpad-t40/media/techtipsy.jpg">
    <img src="/posts/2024/05/24/thinkpad-t40/media/techtipsy_hu_6d8c1bd6ce6d177f.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="Insert joke about recursion.">

  </a>
  <figcaption class="center">Insert joke about recursion.</figcaption>
</figure>

<p>This will likely be the last time this laptop runs a modern OS. 32-bit CPU-s
are losing support both in x86 and ARM ecosystems,
and <a href="https://en.wikipedia.org/wiki/Year_2038_problem">the year 2038</a> is not that
far away any more.</p>
<p>So long, and thanks for all the fish!</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>note to future self: the username is <code>thinkpad</code>, and the password
is <code>thinkpad</code>.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>Lenovo ThinkPad P14s gen 4 (AMD): it doesn't suck under Linux</title><link>https://ounapuu.ee/posts/2024/04/12/lenovo-p14s-gen4/</link><pubDate>Fri, 12 Apr 2024 06:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2024/04/12/lenovo-p14s-gen4/</guid><description>I'm just as surprised as you are.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2024/04/12/lenovo-p14s-gen4/media/cover_hu_26b1ddd0d2beb2d6.jpg" width="1200" height="630" alt="Lenovo ThinkPad P14s gen 4 (AMD): it doesn't suck under Linux" /><p>I&rsquo;ve had the opportunity to try out another new laptop at work. I&rsquo;ve used a brand new laptop recently, <a href="/posts/2022/11/21/hp-elitebook-845-g9/">and it was horrible.</a></p>
<p>But this time I&rsquo;m pleasantly surprised.</p>
<p>The <a href="https://www.lenovo.com/us/en/p/laptops/thinkpad/thinkpadp/thinkpad-p14s-gen-4-%2814-inch-amd%29-mobile-workstation/len101t0070">Lenovo ThinkPad P14s gen 4</a> has great specs:</p>
<ul>
<li>CPU: <a href="https://www.amd.com/en/products/apu/amd-ryzen-7-7840u">AMD Ryzen 7 PRO 7840U (8 cores, 16 threads, up to 5.1 GHz)</a></li>
<li>GPU: AMD Radeon 780M (integrated)</li>
<li>RAM: 32GB DDR5, soldered</li>
<li>SSD: 1 TB NVMe</li>
<li>Display: 1920x1200 resolution</li>
<li>Two USB-C ports</li>
<li>Two USB-A ports</li>
<li>HDMI out</li>
<li><strong>A full-sized Ethernet port!</strong></li>
</ul>
<p>I have used it for about a month at work, and so far I have not noticed anything outright broken about it.
The Fedora Linux 39 installation that I copied over from the previous laptop (Dell Latitude 5411) simply works, no modifications required.
The CPU is blazing fast. The GPU driver does not crash. No issues with Wi-Fi or Bluetooth so far. USB-C docks and
monitors that I have just work. The webcam is also functional and has an acceptable image quality for meetings. CPU and GPU temperature data is present with <code>lm-sensors</code>.</p>
<p>The build quality is what you&rsquo;d expect from a modern ThinkPad: better than consumer-grade crap, but not as solid as a ThinkPad T430.
The case has a soft-feeling light gray finish to it, which will likely look horrible after a few years of use.</p>
<p>The battery life is not great: don&rsquo;t expect to last a full 8-hour work day on battery with this thing. It&rsquo;s been years
since Apple has released Apple Silicon laptops with great battery life and somehow the rest of the industry still
hasn&rsquo;t caught up.</p>
<p>The fan has a really annoying high-pitched whine to it. You only hear it when pushing the CPU hard, like you&rsquo;d do
when compiling a legacy Java monolith, but in a quiet room it&rsquo;s really annoying. I&rsquo;m not even sure that the fan has to
be run that hard, the AMD Ryzen CPU inside is very efficient and can regulate its power consumption based on the current
temperature. You <em>can</em> tweak the fan curve on this laptop <a href="/posts/2022/09/26/minimum-viable-fan-control-script/">with a basic script.</a></p>
<p>I haven&rsquo;t tried functionality that I don&rsquo;t use myself, such as the fingerprint reader, so I cannot comment on that.</p>
<p>This laptop can also play games. I took an external SSD, installed <a href="https://bazzite.gg/">Bazzite on it (GNOME + gamemode version)</a>, set
everything up, and installed Forza Horizon 4 on it. It runs, and for an integrated GPU surprisingly well. I could push the
game to run with medium-high settings on the internal 1920x1200 display at a solid 60 FPS, with very rare dips below it.
That&rsquo;s even better than what I got with the Steam Deck, and the CPU running near the 5 GHz mark certainly contributed
to it. This makes the laptop a great candidate for a LAN party after work, unless you favor more demanding games, in
which case you might want to temper your expectations a little bit.</p>
<p>It&rsquo;s the first time that I&rsquo;ve had a brand new laptop that just works on Linux.
Hats off to the FOSS community for making this happen, AMD for getting their act
together, and Lenovo for not completely fucking it up this time.</p>
]]></content:encoded></item><item><title>Dell Latitude 5411: the Linux compatibility sweet spot</title><link>https://ounapuu.ee/posts/2023/04/28/dell-latitude-5411/</link><pubDate>Fri, 28 Apr 2023 06:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2023/04/28/dell-latitude-5411/</guid><description>It's a jet engine with an integrated furnace, but at the same time it fits into the Linux compatibility sweet spot. Not great, not terrible.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2023/04/28/dell-latitude-5411/media/cover_hu_597bd29d05cc41fb.jpg" width="1200" height="630" alt="Dell Latitude 5411: the Linux compatibility sweet spot" /><p><em>Oh boy, here I go testing a new laptop again!</em></p>
<p>Well, it <em>was</em> new back in 2020.</p>
<p>You might remember <a href="/posts/2022/01/09/why-i-went-back-to-using-a-thinkpad-from-2012/">my article on why I went back to a ThinkPad T430 in 2022</a>.
Or that other time when I got a new HP laptop for testing and got so frustrated that <a href="/posts/2022/11/21/hp-elitebook-845-g9/">I wrote about it</a>.</p>
<p>Well, today I&rsquo;m writing about the <a href="https://www.dell.com/en-nz/shop/business-laptop-notebook-computers/latitude-5411-business-laptop/spd/latitude-14-5411-laptop">Dell Latitude 5411</a>.</p>
<p>It&rsquo;s not the newest laptop in the world, but I decided to give it a go because of a few reasons:</p>
<ul>
<li>nobody wanted one at work due to the reputation of this laptop (sounds like a jet engine)</li>
<li>it&rsquo;s almost 3 years old at this point, which is the Linux compatibility sweet spot (in theory)</li>
<li>there were some changes coming to the office, which meant more flexible seating arrangements and everything
being designed around USB-C, and I wanted to continue my employment at the same company which might have been tricky
with a ThinkPad T430</li>
</ul>
<p>And that&rsquo;s how I ended up with one.</p>
<h2 id="the-linux-compatibility-sweet-spot">
  <a class="heading-anchor" href="#the-linux-compatibility-sweet-spot">The Linux compatibility sweet spot<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>If you have spent any time using new hardware on Linux, then you probably know how painful it can be.
You might get lucky and receive hardware that has support right from the get-go, but in most cases
there are issues around that may or may not get fixed with time.</p>
<p>If you take the same device a couple of years later, it&rsquo;s highly likely that the Linux support on it
will be much better. The price of the device will also be much lower than before, especially if you get
it on the second hand market.</p>
<p>Any machine that falls into this time window is what I like to call &ldquo;the Linux compatibility sweet spot&rdquo;.
This Dell happens to be one such machine.</p>
<p>Here&rsquo;s a quick rundown of some specifications:</p>
<ul>
<li>CPU: Intel Core i7-10850H 6C/12T, 2.7 GHz/ 5.1 GHz</li>
<li>RAM: 32GB DDR4</li>
<li>SSD: 512 GB NVMe</li>
<li>OS: Fedora Linux 38</li>
<li>Thunderbolt support</li>
<li>Wi-Fi, Ethernet based on Intel chips</li>
</ul>
<p>The Dell Latitude 5411 is powerful, and the components in it seem to be working just fine under Linux.
The USB-C port has not had major issues in a work environment, and it also works tolerably with a Dell WD19TB Thunderbolt 3
dock. My ultrawide monitor works, the Ethernet port on the dock can push gigabit speeds, and USB 3 ports work as expected.</p>
<p>Honestly, that&rsquo;s pretty much it regarding compatibility. It just works <em>most of the time</em>, and that&rsquo;s why I like this machine.</p>
<h2 id="oh-god-the-noise">
  <a class="heading-anchor" href="#oh-god-the-noise">Oh god, the noise<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Not everything about this machine is ideal, though.</p>
<p>One of the first things I noticed with this machine is some kind of electrical noise. Some call it &ldquo;coil whine&rdquo;,
but all I know is that it&rsquo;s this high-pitched squealing that&rsquo;s coming from the laptop. Based on some searching
and personal testing I can confirm that the noise is related to the CPU switching between idle and really high turbo boost speeds very quickly. If you remember
the spec sheet, you&rsquo;ll know that this CPU can reach <strong>5.1 GHz</strong>. The noise is apparent whenever there&rsquo;s a load
on the CPU, and it&rsquo;s probably the sound of the power delivery components screaming in pain to deliver all this power
that this furnace of a CPU requires.</p>
<p>There is a workaround to the electrical noise: try running the CPU at a lower speed. You can do that by disabling
Intel Turbo Boost, for example. There&rsquo;s an UEFI setting for that, but on Fedora Linux 38 there&rsquo;s an even easier
option in the form of the &ldquo;Power Profiles&rdquo; setting. When running the CPU slower, the noise is much less severe.</p>









<figure class="center">
  <a href="/posts/2023/04/28/dell-latitude-5411/media/image-1.png">
    <img src="/posts/2023/04/28/dell-latitude-5411/media/image-1_hu_28dd5e6897c6cb89.webp"
     width="494"
     height="492"
     loading="lazy"
     decoding="async"
     alt="Power Profiles in GNOME 44.">

  </a>
  <figcaption class="center">Power Profiles in GNOME 44.</figcaption>
</figure>

<p>This machine got the reputation of being a jet engine at work, and I agree with those people as this thing can
be damn loud even when it&rsquo;s seemingly not doing much. This is a result of the CPU demanding a lot of power and the
cooling solution not being able to catch up. I feel that the stock fan curve is quite aggressive to prevent
any reliability issues after long-term use.</p>
<p>If you have the same laptop and are looking for a fix to that issue, then you&rsquo;re in luck!
There are plenty of solutions out there and I am personally a fan of <a href="https://wiki.archlinux.org/title/fan_speed_control#Dell_laptops">this Arch Wiki section</a>.
I use <a href="https://github.com/TomFreudenberg/dell-bios-fan-control">dell-bios-fan-control</a> to be able to control
the fan speed myself, and a simple script to fine-tune the behaviour of the system. The script looks something like
this:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span><span style="color:#75715e">#!/bin/bash
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>set -e
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>echo <span style="color:#e6db74">&#34;Finding device path.&#34;</span>
</span></span><span style="display:flex;"><span>device_path<span style="color:#f92672">=</span><span style="color:#66d9ef">$(</span>echo /sys/devices/platform/dell_smm_hwmon/hwmon/hwmon*<span style="color:#66d9ef">)</span>
</span></span><span style="display:flex;"><span>echo <span style="color:#e6db74">&#34;Device path: </span>$device_path<span style="color:#e6db74">&#34;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>echo <span style="color:#e6db74">&#34;Testing existence of paths.&#34;</span>
</span></span><span style="display:flex;"><span>cat <span style="color:#e6db74">&#34;</span>$device_path<span style="color:#e6db74">&#34;</span>/temp1_input
</span></span><span style="display:flex;"><span>cat <span style="color:#e6db74">&#34;</span>$device_path<span style="color:#e6db74">&#34;</span>/pwm1
</span></span><span style="display:flex;"><span>echo <span style="color:#e6db74">&#34;Testing existence of paths done.&#34;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>echo <span style="color:#e6db74">&#34;Disabling Dell stock BIOS fan control.&#34;</span>
</span></span><span style="display:flex;"><span>/root/.local/bin/dell-bios-fan-control <span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>echo <span style="color:#e6db74">&#34;Done!&#34;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">while</span> true; <span style="color:#66d9ef">do</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  temp<span style="color:#f92672">=</span><span style="color:#66d9ef">$(</span>cat <span style="color:#e6db74">&#34;</span>$device_path<span style="color:#e6db74">&#34;</span>/temp1_input<span style="color:#66d9ef">)</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  <span style="color:#75715e"># Only two fan speed levels seem to exist, anything above 200 is basically</span>
</span></span><span style="display:flex;"><span>  <span style="color:#75715e"># equivalent to full speed.</span>
</span></span><span style="display:flex;"><span>  <span style="color:#66d9ef">if</span> <span style="color:#f92672">((</span>temp &gt; 50000<span style="color:#f92672">))</span>; <span style="color:#66d9ef">then</span>
</span></span><span style="display:flex;"><span>    echo <span style="color:#ae81ff">64</span> &gt;<span style="color:#e6db74">&#34;</span>$device_path<span style="color:#e6db74">&#34;</span>/pwm1
</span></span><span style="display:flex;"><span>  <span style="color:#66d9ef">else</span>
</span></span><span style="display:flex;"><span>    echo <span style="color:#ae81ff">0</span> &gt;<span style="color:#e6db74">&#34;</span>$device_path<span style="color:#e6db74">&#34;</span>/pwm1
</span></span><span style="display:flex;"><span>  <span style="color:#66d9ef">fi</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  sleep <span style="color:#ae81ff">15</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">done</span>
</span></span></code></pre></div><p>The CPU is already temperature limited even in the stock configuration and will throttle under load, which should
mean that running the machine at a lower fan speed is just fine. Let&rsquo;s hope that I&rsquo;m right.</p>
<h2 id="the-damn-usb-c-port">
  <a class="heading-anchor" href="#the-damn-usb-c-port">The damn USB-C port<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>While the USB-C port generally works well, I do still get annoyed with it. When connecting it to my
Dell WD19TB Thunderbolt 3 dock, there&rsquo;s a good chance that it will do nothing but charge. Restarting the machine
with the dock connected will usually work, but it does take away from the portability of the setup.</p>
<p>I&rsquo;m convinced at this point that USB-C is a cursed standard and will never &ldquo;just work&rdquo;. If you disagree, then
please look up any article that tries to explain how USB-C works and all the things you have to keep in
mind if you want to buy a damn cable for your device that does what you want. And then add Thunderbolt to the mix.</p>
<p>If this aspect starts becoming very annoying, then it might become a dealbreaker for me, but right now it happens
infrequently enough that I can ignore it.</p>
<p>Oh, wait, it happened again while writing this article. Damn it all.</p>
<h2 id="other-notes">
  <a class="heading-anchor" href="#other-notes">Other notes<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Here&rsquo;s a rundown of some observations that I&rsquo;ve made while using this machine:</p>
<ul>
<li>you can actually boot from the microSD card, which is nice</li>
<li>if you dual boot Fedora (two completely separate installations), then you&rsquo;ll get two Fedora entries
in the boot options list, and although the names are identical, you can set a preferred boot order just fine</li>
<li>keyboard and touchpad are not the best things out there, but they are at the very least tolerable</li>
<li>cannot say the same about the <a href="https://xkcd.com/243/">clit mouse</a>, it&rsquo;s not that good</li>
<li>battery life is what I expected from a laptop that&rsquo;s not an Apple M1/M2 based laptop: 2-4 hours of use when doing
any real work, and up to 8 hours if your work involves staring at the screen with the brightness set to low and Wi-Fi/Bluetooth
turned off</li>
<li>lowest power draw I observed with <code>upower</code> was around 6 watts</li>
<li>this machine has enough power to be a solid desktop replacement for software development</li>
<li>the above is true even when you switch turbo boost off, you still have 6 cores running at 2.7 GHz!</li>
<li>never managed to overheat the machine, even if I accidentally forgot to turn the laptop fan back on
while running heavy loads (CPU throttled to around 2.2-2.4 GHz, which is impressive!), or when I accidentally
put it in my backpack while it was still running</li>
<li>&ldquo;power on with USB-C connected&rdquo; or any other UEFI setting with a similar purpose should be avoided, you
<strong>will</strong> end up putting it into your backpack while it&rsquo;s running</li>
<li>this laptop has a full sized Ethernet port, which is incredibly handy for many IT professionals</li>
<li>it even has the old Dell barrel plug charging port, which is great for situations where you&rsquo;ve damaged the only
USB-C port on the laptop</li>
<li>I don&rsquo;t have too much faith in the construction of the machine, some parts feel very plasticky and might not hold up
well 5-10 years from now</li>
<li>I was the one who actually made the recommendation to purchase this particular laptop model at my current job
back in 2020 due to the fleet of ThinkPads being compatibility nightmares with the monitors and docks available, and
in that regard it was an improvement. Shame about the fan and electrical noise.</li>
</ul>
<h2 id="conclusion">
  <a class="heading-anchor" href="#conclusion">Conclusion<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Will I end up switching to a modern laptop now? Maybe. I&rsquo;ve done so for my day job already, but the jury is still
out on whether I might end up with this particular model for my personal use (especially because of the damn Thunderbolt
dock issue). There are alternative laptops out there with similar pricing that are also in this Linux compatibility sweet spot.</p>
<p>Should you get one? If the price is right and you don&rsquo;t mind applying the workarounds for the issues I mentioned, then
go for it!</p>
<p>I have restored some faith in modern laptops now. They all suck in different ways, but this one is
not the worst one, and that&rsquo;s good enough for me. Probably. I&rsquo;ll keep my ThinkPad T430 in an easy to reach spot, just in
case.</p>
]]></content:encoded></item><item><title>HoloISO: the unofficial Steam Deck experience on your PC</title><link>https://ounapuu.ee/posts/2022/12/01/holoiso-steam-deck-experience/</link><pubDate>Thu, 01 Dec 2022 07:00:00 +0200</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2022/12/01/holoiso-steam-deck-experience/</guid><description>I tried out HoloISO, the project that brings the Steam Deck experience to PC-s, on my ASRock DeskMini X300. Perhaps gaming on Linux isn't dead after all?</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2022/12/01/holoiso-steam-deck-experience/media/cover_hu_450361990dee578b.jpg" width="1200" height="630" alt="HoloISO: the unofficial Steam Deck experience on your PC" /><p>If you have spent any time in gaming hardware circles, then you&rsquo;ve probably
heard about the <a href="https://store.steampowered.com/steamdeck">Steam Deck</a>, the
Linux-based handheld gaming PC built by Valve. Yes, you heard that right: not
Windows, but Linux.</p>
<p>I&rsquo;ve had my fair share of attempts at gaming on Linux. When it works, it&rsquo;s
amazing. When it doesn&rsquo;t, it&rsquo;s incredibly frustrating. The last thing I want
to do when playing a game is to become a developer and start troubleshooting
issues with all the layers between the hardware and the game.</p>
<p>What makes the Steam Deck different is that the compatibility layer (Proton) and
all the bits and pieces associated with it are integrated in a way that <em>should</em>
make it unnoticeable to the user. Just start up your Steam Deck, pick your game,
play, and you&rsquo;re good to go.</p>
<p>Although I&rsquo;ve thought about buying a Steam Deck myself for tinkering and testing
purposes, I could not justify that purchase. But thanks to <a href="https://www.youtube.com/watch?v=x4gZO7TZT9g">videos from
the ETAPRIME YouTube channel</a> I
learned about the existence of <a href="https://github.com/theVakhovskeIsTaken/holoiso">HoloISO</a>,
an unofficial SteamOS 3 installer.</p>
<h2 id="holoiso">
  <a class="heading-anchor" href="#holoiso">HoloISO<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>HoloISO aims to be as close to the native SteamOS 3 experience as possible.
The only reason it exists right now is because Valve does not yet officially
support SteamOS 3 as a distro that you can go and install. That might change
in the future, but for those that are impatient like myself, HoloISO is a nice
option.</p>
<p>To test out HoloISO and give it a good chance at succeeding, I chose my <a href="/posts/2022/01/17/asrock-x300-future-of-desktops/">ASRock
DeskMini X300</a>.
It sports an <a href="https://www.amd.com/en/products/apu/amd-ryzen-7-5700g">AMD Ryzen 7 5700G</a>,
which is a high-end APU and
should result in performance that&rsquo;s roughly comparable to the Steam Deck in most
scenarios. The GPU cores are not on the newest GPU architecture released by AMD,
but the higher power budget should make up for any architectural deficiencies.</p>
<p>The installation of HoloISO is very easy, just download the installer and write
it to an USB stick. Once you&rsquo;re booted up, follow the installation instructions
and reboot. You should now be at the SteamOS 3 setup screen.</p>
<h2 id="first-impressions">
  <a class="heading-anchor" href="#first-impressions">First impressions<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I&rsquo;ll be the first one to admit that my Steam library is a bit out of date, which
is why my experience is limited to older titles. I can confirm that BeamNG drive
and Dirt Rally 2 work fantastically though.</p>
<p>The only way to play GTA V on Linux without issues used to involve <a href="https://youtu.be/16dbAUrtMX4">creating a
Windows VM and passing a GPU to it.</a> This is why
I was very impressed to see that installing and starting up GTA V worked out
of the box. I could even go to GTA Online and play around without being kicked
out or banned!</p>
<p>To make choosing and playing games a better experience for casual gamers, Steam
has also come up with the <a href="https://www.steamdeck.com/en/verified">Deck verified</a>
program. You shouldn&rsquo;t be discouraged if your favourite game is shown as
unsupported or not tested, though. Try to start it up and see if it works.
Burnout Paradise and Absolute Drift were not officially supported, but worked like a charm.</p>
<p>The unfortunate reality of SteamOS is that not every game will work out of the
box. Some older games, such as GTA III and GTA Vice City, would not work at all.
You might be able to check out places like <a href="https://www.protondb.com/">ProtonDB</a>
and see if a game has a tweak that you can apply. Tweaks can involve passing
additional launch options to a game or using another version of the compatibility
layer (Proton).</p>
<p>What turned me off of this platform was Forza Horizon 4. On this setup, it did
not launch properly, the sound was there but the screen was black. Based on
results in YouTube, it seems like Forza Horizon 4 and Forza Horizon 5 do work
on Steam Deck, so this issue might be down to a compatibility issue on
my hardware or HoloISO distribution of SteamOS 3. I wanted to play that game
though, so I had to eventually end the experiment and install Windows 10 again.</p>
<p>As someone who wants to get a good overview of resources usage during gameplay
to detect and resolve any performance issues, I tend to use tools like <a href="https://www.msi.com/Landing/afterburner/graphics-cards">MSI Afterburner</a>.
With SteamOS 3, you can easily achieve similar results by enabling the
performance overlay. I was very happy to see that addition because that means
installing and configuring one less tool on my gaming box.</p>
<h2 id="quality-of-life-issues">
  <a class="heading-anchor" href="#quality-of-life-issues">Quality of life issues<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Even when things generally work, I did notice some annoyances when playing games.
Sometimes I ran into issues with controls. Steam allows you to pick gamepad
templates and layouts, which can involve community-provided setups. Sometimes
it would default to a layout that simply did not work. Turning off Steam input
altogether would sometimes improve the situation. If that did not work, then
picking an alternative template would do the trick most of the time.</p>
<p>One major issue that I ran into was related to my XBOX controllers. Because
the XBOX wireless adapter does not work out of the box on Linux, I connected
them via Bluetooth. However, the latency was horrible and borderline unplayable.
There do exist drivers that you can install, mainly <a href="https://github.com/medusalix/xone">xone</a>
and <a href="https://github.com/atar-axis/xpadneo">xpadneo</a>, and those do improve the
situation.</p>
<h2 id="desktop-mode">
  <a class="heading-anchor" href="#desktop-mode">Desktop mode<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>One aspect of SteamOS 3 that made me actually consider buying a Steam Deck is
the desktop mode. Not only can you play games, but you can also boot into a
normal KDE desktop environment. Install a web browser, emulators,
tweak the system or do actual productive work on it, it just works!</p>
<p>Hell, you can even install an SSH server and manage your gaming box with Ansible!</p>
<p>Whenever I&rsquo;ve had a gaming PC, I&rsquo;ve usually hooked it up to a big screen,
installed Windows and Steam on it, and called it a day. If you want to watch
some media, open up the browser and you&rsquo;re good to go. I&rsquo;m happy to report that
something similar can be achieved on SteamOS as well.</p>
<p>At the time of testing, there were some issues that I didn&rsquo;t expect to have with
desktop mode. Firefox is included as a Flatpak and it did not support any form
of hardware acceleration for video playback, which made it a no-go for a home
theater setup.</p>
<p>After browsing <a href="https://www.reddit.com/r/steamdeck/">/r/SteamDeck</a> for a while,
you&rsquo;ll notice that a lot of people are into modifying their consoles, and all
of that is possible because Valve did not lock anything down. Pop the hood and
work with the Linux internals as much as you want to! With other gaming consoles
you&rsquo;re going to have to wait until someone discovers an exploit that allows you
to have proper control over hardware that you physically own.</p>
<h2 id="gaming-outside-of-steam">
  <a class="heading-anchor" href="#gaming-outside-of-steam">Gaming outside of Steam<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>With the presence of desktop mode, you&rsquo;re not only limited to games purchased
from Steam.</p>
<p>To see how well I could emulate games that I have purchased on older consoles,
such as PS1, PS2 and PSP, I tried setting up some emulators. I&rsquo;m happy to say
that setting them up is just as fiddly as it is on Windows, but they do seem
to work quite well, at least for these consoles.</p>
<p>I gave Minecraft a go as well by installing it as a Flatpak from KDE Discovery
software manager, but for some reason it didn&rsquo;t run and crashed on startup.
I didn&rsquo;t look into it further, but it seemed like something that an update can
fix.</p>
<p><a href="https://www.gog.com/">GOG</a> is a platform similar to Steam, with one notable
exception: their games are DRM-free. I don&rsquo;t use that often, but with a game
like <a href="https://artofrally.com/">art of rally</a> I had to get it from there just
for that reason alone (and the developers publishing native Linux ports).
Although there isn&rsquo;t an official client for GOG on Linux, there do exist open
source implementations. I gave <a href="https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher">HeroicGamesLauncher</a>
a go and although it is a bit rough around the edges, it got the job done and
I could play <em>art of rally</em> just fine.</p>
<h2 id="caveats">
  <a class="heading-anchor" href="#caveats">Caveats<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>The HoloISO experience tries to be as close to the one provided by SteamOS 3,
but it is not 100% there yet. It seems that there are differences present
under the hood, such as Steam Deck shipping with the root filesystem being
read-only by default. I might not be aware of other differences between the
HoloISO and official Steam Deck installation, so keep this in mind when making
any decisions based on info from this post.</p>
<p>The choice of hardware will also affect your experience. The requirements
regarding GPU-s is relatively strict and you&rsquo;ll likely have the best experience
with a modern AMD GPU since that&rsquo;s what SteamOS 3 is built around. Intel
and NVIDIA GPU-s <em>may</em> work, but are not guaranteed to.</p>
<h2 id="conclusion">
  <a class="heading-anchor" href="#conclusion">Conclusion<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>SteamOS 3, even in its HoloISO implementation, is very impressive. So impressive,
in fact, that I almost bought a Steam Deck. The uncertainty about support for my
favourite games and less than ideal performance on the big screen were what
held me back. For now.</p>
<p>In its current form, SteamOS 3 (and by extension the Steam Deck itself) are a
tinkerers&rsquo; dream. There are some rough corners and caveats that you should be
aware of as well. Not everyone is into tinkering and experimentation, and that&rsquo;s
OK.</p>
<p>I sincerely hope that Valve can use the momentum that Steam Deck has achieved
to push gaming on Linux even further. After having to reinstall Windows more than
I&rsquo;d like to admit, having my gaming PC run plain Linux and be fully manageable
with Ansible just feels so <em>right</em>.</p>
]]></content:encoded></item><item><title>I have a 'Dall UD19PB ThundeRbglt Dock': my experience with the HP Elitebook 845 G9</title><link>https://ounapuu.ee/posts/2022/11/21/hp-elitebook-845-g9/</link><pubDate>Mon, 21 Nov 2022 07:00:00 +0200</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2022/11/21/hp-elitebook-845-g9/</guid><description>I've tried out newer laptops before and it was nothing short of a disaster. Is this HP any different, or do I need to go back to my ThinkPad T430 again?</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/posts/2022/11/21/hp-elitebook-845-g9/media/cover_hu_f904b2426d99b085.jpg" width="1200" height="630" alt="I have a 'Dall UD19PB ThundeRbglt Dock': my experience with the HP Elitebook 845 G9" /><p>I&rsquo;ve decided to give a new laptop a test drive, mainly because I had the
opportunity at work, and also out of <a href="/posts/2022/01/09/why-i-went-back-to-using-a-thinkpad-from-2012/">morbid curiosity.</a></p>
<p>It&rsquo;s the HP Elitebook 845 G9, and it has pretty good specifications:</p>
<ul>
<li>CPU: <a href="https://www.amd.com/en/products/apu/amd-ryzen-7-6800u">AMD Ryzen 7 6800U</a></li>
<li>RAM: 2x16GB DDR5</li>
<li>Storage: 512GB KIOXIA NVMe SSD (KBG50ZNV512G)</li>
<li>OS: Fedora 37, kernel version 6.0.8</li>
</ul>
<p>This laptop was also <a href="https://youtu.be/m8lsUvil_S8">shown in a recent LinusTechTips video</a>
and praised for its ease of repair and maintenance.</p>
<p>However, I can&rsquo;t seem to enjoy nice things. This attempt at using a newer
laptop has had some frustrating challenges. Perhaps the common denominator is
Linux. Or me. Can&rsquo;t rule anything out.</p>
<p>This is simply my experience with this laptop, including my attempts to overcome
certain issues with workarounds. If you find something that&rsquo;s factually
wrong about any part of this post, then please reach out!</p>
<h2 id="wi-fi">
  <a class="heading-anchor" href="#wi-fi">Wi-Fi<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>It all began with the Wi-Fi card not working. The card <em>can</em> be replaced, but
the results can be mixed.</p>
<p>An Intel Wi-Fi card that I had lying around would not be recognized
by the system at all. The situation was fixed by the reseller who replaced the
Realtek RTL8852BE chip with another Realtek one, this time with the Realtek
RTL8822CE.</p>
<p><a href="https://github.com/lwfinger/rtw8852be">Yes, there exist drivers that you can install,</a>
but it&rsquo;s far from an ideal solution. You will have to reinstall the Wi-Fi driver
after every kernel update, and the kernel updates frequently on Fedora Linux.</p>
<p>The HP website allows you to pick between a Realtek and Qualcomm Wi-Fi chip. My
recommendation is to go with the Qualcomm option because the Realtek RTL8852BE
does not work out of the box.</p>
<h2 id="airplane-mode">
  <a class="heading-anchor" href="#airplane-mode">Airplane mode<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>This is an issue I didn&rsquo;t think I would ever have to worry about.</p>
<p>The laptop would switch itself to airplane mode at random on boot. Not on every
boot, but about 50% of the time. When you try to disable Airplane mode from
GNOME settings, it would flip back on again, no matter how often you tried.</p>
<p>To turn Airplane mode off properly, you have to use the Airplane mode keyboard
shortcut, and even then it might take an attempt or two.</p>
<p><a href="https://h30434.www3.hp.com/t5/Notebook-Operating-System-and-Recovery/EliteBook-845-G9-BIOS-Update-Causing-Problems/td-p/8490697">Some HP users suspect that the issue might be related to a botched firmware
update.</a>
There&rsquo;s a kernel patch in the pipeline, and some users say that blacklisting
the <code>hp_wmi</code> kernel module could also fix the issue.</p>
<p><a href="https://askubuntu.com/a/965596">Others say that this behaviour might be related to certain events being triggered
on the laptop, such as lid closing or the screen rotating.</a>
The proposed fix did not work to resolve this issue on my laptop.</p>
<p>Blacklisting the <code>hp_wmi</code> kernel module was what improved the situation for me.</p>
<h2 id="usb4-and-thunderbolt">
  <a class="heading-anchor" href="#usb4-and-thunderbolt">USB4 and Thunderbolt<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>This laptop is noteworthy due to its support for USB4, which brings with it
support for Thunderbolt, making it one of the first AMD-based laptops to
properly support that feature.</p>
<p>At my current employer the general trend has been towards standardization:
every meeting room and desk has a single USB-C port that you plug into, and
you should be good to go.</p>
<p>I can confirm that USB-C docks seem to work quite well under Linux, especially
the one integrated into my Dell monitor at work.</p>
<p>I can also confirm that the Dell WD19TB Thunderbolt 3 dock does work.</p>
<p>On Windows 10.</p>
<p>Not on Linux though.</p>
<p>At some point the errors I saw in kernel logs got quite ridiculous.</p>









<figure class="center">
  <a href="/posts/2022/11/21/hp-elitebook-845-g9/media/dall.png">
    <img src="/posts/2022/11/21/hp-elitebook-845-g9/media/dall_hu_d728ef9e680cce65.webp"
     width="967"
     height="236"
     loading="lazy"
     decoding="async"
     alt="The device name reads like a counterfeit merchandise listing at Amazon.">

  </a>
  <figcaption class="center">The device name reads like a counterfeit merchandise listing at Amazon.</figcaption>
</figure>

<p>When reconnecting the port, the results were slightly different almost every time.</p>









<figure class="center">
  <a href="/posts/2022/11/21/hp-elitebook-845-g9/media/garbage-time.png">
    <img src="/posts/2022/11/21/hp-elitebook-845-g9/media/garbage-time_hu_da7d0962ae3ddfed.webp"
     width="976"
     height="132"
     loading="lazy"
     decoding="async"
     alt="I think the dock has suffered a stroke.">

  </a>
  <figcaption class="center">I think the dock has suffered a stroke.</figcaption>
</figure>

<p>The UEFI settings allow some control over the behaviour of the USB-C ports.
You can even disable Thunderbolt support and use them as plain USB-C ports with
DisplayPort support.</p>
<p>The behaviour of the dock would also be different depending on how you connect
it. If the dock is connected during boot, your USB devices and Ethernet port
will all be functional, but there&rsquo;s no display output. If you boot while the
dock is disconnected and connect it once you have reached the GUI, your display
will work, but you have no USB or Ethernet support.</p>
<p>Even if one of the two critical functions of the dock work, reconnecting the
cable will eventually result in nothing working. You also have a 50% chance of
the machine locking up completely.</p>
<p>The reasons for these issues can be any one of these:</p>
<ul>
<li>the proper kernel support is not there yet</li>
<li>HP messed something up with the latest UEFI update for Linux users</li>
<li>I was using it wrong</li>
</ul>
<h2 id="dell-wd19tb-thunderbolt-dock-workaround">
  <a class="heading-anchor" href="#dell-wd19tb-thunderbolt-dock-workaround">Dell WD19TB Thunderbolt dock workaround<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>After multiple sessions of troubleshooting, I seem to have come up with a
solution that seems to work for my use case, which involves connecting a
couple of USB devices, an Ethernet cable, and one 1440p monitor. You&rsquo;re giving
up Thunderbolt capabilities and forcing the dock to fall back to USB+DP altmode
setting, but in return you&rsquo;ll get a setup that actually works.</p>
<p>To get the Dell WD19TB Thunderbolt dock working, do the following:</p>
<ul>
<li>go to UEFI settings and turn off Thunderbolt mode</li>
<li>save settings and reboot</li>
<li>connect your monitor over HDMI</li>
</ul>
<p>Yup, that was it. I could not get DisplayPort working. Only HDMI.</p>
<p>The UEFI settings do contain a setting that allows you to sacrifice
USB and Ethernet bandwidth to allow for higher resolution DP signals to be passed
through, but that&rsquo;s simply not acceptable to me. Based on the description, I
think that the setting forces all USB devices to run at USB 2.0 speeds.
This setting may fix the issue if you want to use DisplayPort, but I haven&rsquo;t
tried it yet.</p>
<h2 id="suspend">
  <a class="heading-anchor" href="#suspend">Suspend<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Doesn&rsquo;t work. The screen will go black and the power button indicator will keep
blinking. Only way to break that cycle is to force the laptop to reset by
holding the power button down for an extended amount of time.</p>
<p>On Lenovo laptops I&rsquo;ve seen an option that allows you to change the S3 state
behaviour for Linux compatibility. I haven&rsquo;t found a way to do something
similar on the HP yet.</p>
<h2 id="stability">
  <a class="heading-anchor" href="#stability">Stability<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>This is the straw that broke the camel&rsquo;s back. When playing back video, I
noticed issues with glitching and stuttering. The video would play fine, until
a frame froze for a few seconds, and then everything continued as normal.</p>
<p>What ruined everything for me were the random crashes that only occurred when
playing back video.</p>
<p>When I checked system logs from a previous boot (<code>journalctl -b -1</code>), I found
that something was up with the GPU driver.</p>









<figure class="center">
  <a href="/posts/2022/11/21/hp-elitebook-845-g9/media/amdgpubrr.png" aria-label="View full-size image">
    <img src="/posts/2022/11/21/hp-elitebook-845-g9/media/amdgpubrr_hu_2466209bebcde57b.webp"
     width="1280"
     height="289"
     loading="lazy"
     decoding="async"
     alt="">

  </a>
  
</figure>

<p>This was not a one-off event and once it had happened for the fourth time, I
gave up on this machine and switched back to my trusty ThinkPad T430.</p>
<h2 id="conclusion">
  <a class="heading-anchor" href="#conclusion">Conclusion<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Given enough time, I&rsquo;m sure that at least some of the issues will get fixed,
either with a kernel update or HP rolling out a UEFI update that fixes things
for Linux users.</p>
<p>It&rsquo;s also possible that a specific set of UEFI settings will contribute to
fixing any of the issues listed here. The number of combinations you can have
is too high for me to bother testing all of those, so I won&rsquo;t be doing that.</p>
<p>In its current state, I cannot recommend this laptop to Linux users. You <em>can</em>
get most things working, but you will still be incredibly frustrated with the
issues that remain.</p>
<p>Something has to change, and it&rsquo;s going to be how I choose hardware in the
future. Linux will stay, which means that the newest and &ldquo;greatest&rdquo; hardware
is off the table for me. Honestly, lagging behind the newest hardware 3-5 years
(or 10 in my case) doesn&rsquo;t sound too bad, you&rsquo;ll still get the performance
improvements at a fraction of the original price.</p>
<p>If that&rsquo;s what&rsquo;s necessary for a good Linux experience, then so be it.</p>
]]></content:encoded></item><item><title>The minimum viable fan control script</title><link>https://ounapuu.ee/posts/2022/09/26/minimum-viable-fan-control-script/</link><pubDate>Mon, 26 Sep 2022 08:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2022/09/26/minimum-viable-fan-control-script/</guid><description>Some assembly required. No, not _that_ one.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/media/cover_hu_4fe4cf2661554252.jpg" width="1200" height="630" alt="The minimum viable fan control script" /><p>I&rsquo;ve always been a fan of tinkering with cooling setups on my computers.
I&rsquo;ve even went as far as writing <a href="https://github.com/Hermanio/linux-cpu-manager">crappy</a>
<a href="https://github.com/Hermanio/linux-gpu-manager">solutions</a> to make up for
deficiencies on the hardware level. After years of dumb experiments I&rsquo;ve seen
how little you can get away with in cooling and how to run your machines as
quietly as possible without giving up too much performance.</p>
<p>I also appreciate simplicity, which is why I&rsquo;m currently running the simplest
damn solution you can imagine to control how my ThinkPad T430 and ASRock
DeskMini X300 run: a shell script.</p>
<p>It also comes with some added benefits:</p>
<ul>
<li>self-documenting</li>
<li>highly customizable</li>
<li>low resource usage</li>
</ul>
<p>These scripts are not &ldquo;battle-hardened&rdquo; and using them incorrectly may or
may not result in hardware failure. Use at your own risk. The only guarantee
I can give is that <em>it works on my machine™</em>.</p>
<p>If you&rsquo;re someone who doesn&rsquo;t like tinkering with their computers and wants
their machines to &ldquo;just work&rdquo;, then this article likely isn&rsquo;t for you.</p>









<figure class="center">
  <a href="/posts/2022/09/26/minimum-viable-fan-control-script/media/image.png" aria-label="View full-size image">
    <img src="/posts/2022/09/26/minimum-viable-fan-control-script/media/image_hu_cf274236fe7bd4f.webp"
     width="473"
     height="209"
     loading="lazy"
     decoding="async"
     alt="">

  </a>
  
</figure>

<h2 id="thinkpad-t430">
  <a class="heading-anchor" href="#thinkpad-t430">ThinkPad T430<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>With the ThinkPad T430, the script does two things:</p>
<ul>
<li>control the fan speed</li>
<li>preemptively throttle the CPU and GPU</li>
</ul>
<p>This type of behaviour is optimized for mostly quiet operation. The fan is
running at its lowest speed when under a small load, and the CPU/GPU throttling
has an added benefit of reducing the overall power usage, too. The difference
between non-turbo and turbo speeds on the Intel i7-3820QM can be as much as
13-15 watts.</p>
<p><a href="https://wiki.archlinux.org/title/fan_speed_control#ThinkPad_laptops">To enable fan control on ThinkPads</a>,
you need to have a file at <code>/usr/lib/modprobe.d/thinkpad_acpi.conf</code> with the
following contents:</p>
<pre tabindex="0"><code>options thinkpad_acpi fan_control=1
</code></pre><p>Reboot, and you can now have full control over the fan speed in your ThinkPad!</p>
<p>The script itself looks like this:</p>
<pre tabindex="0"><code>#!/bin/bash

set -e

while true; do

  temp=$(cat /sys/class/thermal/thermal_zone1/temp)

  if ((temp &gt; 90000)); then
    echo level 7 &gt;/proc/acpi/ibm/fan
  elif ((temp &gt; 75000)); then
    echo level 5 &gt;/proc/acpi/ibm/fan
  elif ((temp &gt; 60000)); then
    echo level 3 &gt;/proc/acpi/ibm/fan
  elif ((temp &gt; 30000)); then
    echo level 1 &gt;/proc/acpi/ibm/fan
  else
    echo level 0 &gt;/proc/acpi/ibm/fan
  fi

  if ((temp &gt; 97000)); then
    echo 350 &gt;/sys/class/drm/card*/gt_max_freq_mhz
    echo 350 &gt;/sys/class/drm/card*/gt_boost_freq_mhz
  elif ((temp &gt; 90000)); then
    echo 650 &gt;/sys/class/drm/card*/gt_max_freq_mhz
    echo 650 &gt;/sys/class/drm/card*/gt_boost_freq_mhz
  else
    echo 1250 &gt;/sys/class/drm/card*/gt_max_freq_mhz
    echo 1250 &gt;/sys/class/drm/card*/gt_boost_freq_mhz
  fi

  if ((temp &gt; 70000)); then
    echo 1 &gt;/sys/devices/system/cpu/intel_pstate/no_turbo
  else
    echo 0 &gt;/sys/devices/system/cpu/intel_pstate/no_turbo
  fi

  sleep 0.5
done
</code></pre><p>What we&rsquo;re doing is reading the temperature of the CPU package and then setting
the fan speed and throttling based on that. Note that the temperatures are
represented without any decimal places. A reading of 78000 means that the chip
is running at 78 °C.</p>
<p>On my ThinkPad T430, the fan speed levels can be roughly described as such:</p>
<ul>
<li>level 1: lowest speed, barely audible</li>
<li>level 3: audible, but tolerable</li>
<li>level 5 and above: it&rsquo;s probably loud enough to bother you</li>
</ul>
<p>The second section controls the integrated GPU. What I&rsquo;ve found in my testing
is that a weak integrated GPU can still chug up to 20 watts, which is a
considerable amount, especially on a laptop. The <code>card*</code> wildcard is there
because the integrated GPU may change between <code>card0</code> and <code>card1</code>, and I&rsquo;m too
lazy to make the script any smarter.</p>
<p>The values written there correspond to the maximum GPU clock speed. <code>1250</code> happens
to be the max clock speed (in MHz) and at that speed the GPU is using a lot of
power. <code>650</code> is the speed at which the integrated GPU is running most
efficiently. <code>350</code> is the lowest speed, and you will notice it due to the
performance being extra crappy.</p>
<p>With the CPU, I chose to just turn the turbo boost on or off. With turbo boost
off, the CPU will top out at 2.7 GHz and around 22 watts of power usage. With
turbo boost, the CPU can run anywhere between 3.4-3.7 GHz, depending on the number
of cores under load. You&rsquo;ll likely notice much higher CPU temperatures and power
usage climbing to around 35 watts. Fast at short and bursty workloads, and yet
efficient and relatively cool at sustained loads.</p>
<p>And at the very end, you have a simple <code>sleep</code> statement. I&rsquo;ve set it to half a
second, but feel free to set it as you see fit. Higher intervals might not be
that good of an idea because the script may not be able to respond quickly enough
to changing thermals, just keep that in mind.</p>
<h2 id="asrock-deskmini-x300">
  <a class="heading-anchor" href="#asrock-deskmini-x300">ASRock DeskMini X300<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Although I&rsquo;ve opted for a more experimental setup with my home server and the
ASRock DeskMini X300 is no longer running as one, I think it&rsquo;s still worthwhile
to share how I configured the fan control logic on this machine.</p>
<p>With the ASRock DeskMini X300, my goal was simple: let it run as quietly as
reasonably possible without losing too much performance.</p>
<p>This machine was running 24/7 as a server and has a powerful 8-core AMD Ryzen 7
5700G CPU in it. One thing this script is heavily relying on is the fact that Ryzen
CPU-s have well-engineered boosting logic in them, meaning that they&rsquo;re already
designed to run at the highest speed possible and only limit their speed if they
hit power or thermal limits.</p>
<p>One thing you may need to do first is installing <code>lm-sensors</code> and running
<code>sudo sensors-detect</code>. By default the CPU fan speed controls were not properly
exposed, but after running <code>sensors-detect</code> and saying yes at every prompt,
they were picked up.</p>
<p>The script looks like this:</p>
<pre tabindex="0"><code>#!/bin/bash

set -e

# /sys/devices/platform/nct6775.656/hwmon/hwmon3

echo 1 &gt;/sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm2_enable

while true; do

  temp=$(cat /sys/class/hwmon/hwmon4/temp1_input)

  if ((temp &gt; 94000)); then
    echo 170 &gt;/sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm2
  elif ((temp &gt; 90000)); then
    echo 140 &gt;/sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm2
  elif ((temp &gt; 70000)); then
    echo 120 &gt;/sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm2
  elif ((temp &gt; 40000)); then
    echo 30 &gt;/sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm2
  else
    echo 0 &gt;/sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm2
  fi

  sleep 5
done
</code></pre><p>The <code>hwmon</code> values and which fan you&rsquo;re controlling is likely different on your
own PC. Take a look at the paths found in the script and poke around while also
physically looking at your PC. Try enabling PWM control by writing to <code>pwm*_enable</code>
handles and then setting the fan speed. As a result of your poking, you should
see the CPU fan change its speed. If it doesn&rsquo;t, try another value.</p>
<p>The values you can write are in the range 0-255, where the higher value corresponds
to a higher speed.</p>
<p>I&rsquo;ve limited the TDP of my CPU to 35 watts using a setting found in UEFI
settings. This results in the CPU running cool and quiet even under a full load.</p>
<h2 id="systemd-service">
  <a class="heading-anchor" href="#systemd-service">systemd service<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>To run your fan control script as a systemd service, drop the script to your
preferred location (I placed it in <code>/root/.local/bin/fancontrol</code>), then create
a file <code>/etc/systemd/system/fancontrol.service</code> with the following contents:</p>
<pre tabindex="0"><code>[Unit]
Description=Quick fan control software

[Service]
ExecStart=/root/.local/bin/fancontrol

[Install]
WantedBy=multi-user.target
</code></pre><p>And once that is done, enable and start your fan control service with
<code>sudo systemctl enable --now fancontrol.service</code>.</p>
<p>If you encounter issues or something isn&rsquo;t working right, check the status of
the service with <code>systemctl status fancontrol.service</code> or full logs with
<code>journalctl -u fancontrol.service</code>.</p>
<h2 id="conclusion">
  <a class="heading-anchor" href="#conclusion">Conclusion<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>If you want something that works out of the box and does the smart stuff for you,
then <a href="https://wiki.archlinux.org/title/fan_speed_control">give this Arch Linux wiki page a look</a>.
If you&rsquo;re not into that and want to easily tune the behaviour of your machine,
then feel free to use these scripts as a baseline for your own experimentation.</p>
]]></content:encoded></item><item><title>Accidentally turning the ASRock DeskMini X300 into a semi-passively cooled PC</title><link>https://ounapuu.ee/posts/2022/09/17/asrock-deskmini-x300-semipassive/</link><pubDate>Sat, 17 Sep 2022 08:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2022/09/17/asrock-deskmini-x300-semipassive/</guid><description>Experimenting with my fan control scripts ended up with an interesting discovery.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/media/cover_hu_4fe4cf2661554252.jpg" width="1200" height="630" alt="Accidentally turning the ASRock DeskMini X300 into a semi-passively cooled PC" /><p>After playing around with fan curves on my <a href="https://www.asrock.com/nettop/AMD/DeskMini%20X300%20Series/index.asp">ASRock DeskMini X300</a>
based home server, I noticed one interesting thing. At least it was
interesting to me.</p>









<figure class="center">
  <a href="/posts/2022/09/17/asrock-deskmini-x300-semipassive/media/poster.jpg" aria-label="View full-size image">
    <img src="/posts/2022/09/17/asrock-deskmini-x300-semipassive/media/poster_hu_987cfa9e5320d8a2.webp"
     width="600"
     height="800"
     loading="lazy"
     decoding="async"
     alt="">

  </a>
  
</figure>

<h2 id="background">
  <a class="heading-anchor" href="#background">Background<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I had one goal: to try to see if I could turn it into a semi-passive PC by only
turning the fan on when the PC was under load while keeping it off for as long
as possible. Running the fan only when necessary means less noise
and less dust accumulating on the heat sink. No dust, no maintenance required.</p>
<p>The cooling solution used is the <a href="https://noctua.at/en/nh-l9a-am4">Noctua NH-L9a</a>,
a low-profile CPU cooler. The two main selling points for me were that it was
small enough to fit into the DeskMini, and it is much quieter than the stock
AMD Ryzen Stealth cooler.</p>
<p>I started with something reasonable: only kick the fan on when the CPU is over
55°C. This did end up with the fan occasionally turning off, but after around
10-15 seconds it would kick on again. With time, I bumped this limit up by 5-10
degrees each time and ended up with the current configuration. The fan now
turns on after 80°C and starts spinning at a modest level at over 90°C.</p>
<p>By turning this limit up, I noticed that the PC could be run in a fanless mode
for much longer. This meant that the PC was also much hotter itself and was
warm to touch, but nothing extreme or concerning.</p>
<h2 id="results">
  <a class="heading-anchor" href="#results">Results<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I added a couple of lines to my fan control script to track the CPU
temperatures and the fan speeds, here are the results:</p>









<figure class="center">
  <a href="/posts/2022/09/17/asrock-deskmini-x300-semipassive/media/deskmini-graph.png">
    <img src="/posts/2022/09/17/asrock-deskmini-x300-semipassive/media/deskmini-graph_hu_c327b68db9924b41.webp"
     width="1016"
     height="492"
     loading="lazy"
     decoding="async"
     alt="CPU temperatures over a 19 hour period.">

  </a>
  <figcaption class="center">CPU temperatures over a 19 hour period.</figcaption>
</figure>

<p>Based on the data I gathered, the CPU fan was off for 90.7% of the time during
this test period. The temperature in the apartment was around 26-30°C, which
is pretty much the worst case scenario in my region.</p>
<p>My running theory is that a hotter heat sink is able to dissipate more heat
passively. The motherboard and the metal case may also be small contributors to
cooling the PC this way. The PC is also acting as a 24/7 home server, which means
a lot of idle time that&rsquo;s interrupted by occasional short-term load. Heat from
those bursty loads can be stored in the heat sink relatively easily without it
heating up enough to trigger the fan.</p>
<p>This approach will likely not work that well if your workloads are more demanding
and result in a higher continuous loads on the system.</p>
<p>Yes, I&rsquo;m aware that running a PC like this may have negative consequences. I ran
the server like this for about a week and while I liked it being a
semi-passively cooled server, but decided to go back to the old behaviour.</p>
<p>While there are plenty of fanless designs out there that run hot by design, I
decided that I don&rsquo;t want to take this risk with the DeskMini. It would be a
cool experiment, but my main server is probably not the best candidate for it.
The CPU could handle it without breaking a sweat, but I&rsquo;m more concerned about
the rest of the components, especially the motherboard. The stickers on the
DRAM modules were already warped due to the heat, I prefer not to damage
anything else.</p>
<p>For those who want to try something similar (and at your own risk, of course),
here&rsquo;s my fan control script. Just make sure to install <code>lm-sensors</code> first and
run <code>sudo sensors-detect</code> so that the controls are exposed by your system.
The exact paths and values may be something you need to change to match your
system.</p>
<pre tabindex="0"><code>#!/bin/bash

set -e

# /sys/devices/platform/nct6775.656/hwmon/hwmon3

echo 1 &gt;/sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm2_enable

while true; do

  temp=$(cat /sys/class/hwmon/hwmon4/temp1_input)

  if ((temp &gt; 94000)); then
    echo 120 &gt;/sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm2
  elif ((temp &gt; 80000)); then
    echo 70 &gt;/sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm2
  else
    echo 0 &gt;/sys/devices/platform/nct6775.656/hwmon/hwmon3/pwm2
  fi

  sleep 5
done
</code></pre><h2 id="honorable-mentions">
  <a class="heading-anchor" href="#honorable-mentions">Honorable mentions<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I&rsquo;m not the only one who likes to experiment with the ASRock DeskMini X300.
This all started with an idea of fitting a <a href="https://www.arctic.de/en/Alpine-AM4-Passive/ACALP00022A">passive cooler</a>
into the DeskMini and me discovering that it was already done.</p>
<p>More fun ideas:</p>
<ul>
<li><a href="https://www.reddit.com/r/sffpc/comments/envgds/asrock_a3003400gml120_mod/">the hotrod of PC cooling</a></li>
<li><a href="https://www.fanlesstech.com/2018/11/fixing-mini-stx.html">a reader of FanlessTech actually slapped the passive cooler onto the DeskMini</a></li>
</ul>
]]></content:encoded></item><item><title>Overcoming hardware limitations: the time-to-sleep script</title><link>https://ounapuu.ee/posts/2022/08/26/the-time-to-sleep-script/</link><pubDate>Fri, 26 Aug 2022 08:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2022/08/26/the-time-to-sleep-script/</guid><description>Sometimes the least technical solutions end up being the ones that I'm the most proud of. This is probably one of them.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/media/cover_hu_4fe4cf2661554252.jpg" width="1200" height="630" alt="Overcoming hardware limitations: the time-to-sleep script" /><p>As some of you might own, <a href="/posts/2022/01/09/why-i-went-back-to-using-a-thinkpad-from-2012/">I&rsquo;m still rocking a ThinkPad T430, a laptop model
originally released in 2012.</a>
It&rsquo;s not the fastest laptop out there, but it is plenty fast for a number of
tasks, even most software development work.</p>
<p>I also try to keep my machines up to date and properly backed up. On my laptop,
this means having around a couple of scheduled tasks, such as <code>restic</code> backups.
They don&rsquo;t really take up a lot of time, but if an intensive scheduled task
starts while you&rsquo;re having a video call over Google Meet while also sharing
the screen, things can get a bit slow, ruining the experience.</p>
<p>After a couple of these instances, I started thinking about finding a solution.</p>
<h2 id="scheduled-tasks">
  <a class="heading-anchor" href="#scheduled-tasks">Scheduled tasks<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Here&rsquo;s a quick rundown of regular tasks that I like to run on my laptop.</p>
<p><strong>Backups using <code>restic</code></strong>: hourly backups to my home server. The file scanning
process of the backup is quite intense, eating up a lot of my CPU time.</p>
<p><strong>System updates using <code>dnf</code> and <code>flatpak</code></strong>: usually run daily, because I&rsquo;m too
lazy to install the updates using a GUI, and at the same time I cannot afford
to run out of date software.</p>
<p><strong>Backups of critical files from my server to my laptop</strong>: there are some files
I just cannot afford to lose. For this reason, I make a daily backup of the
files to my laptop.</p>
<p><strong>Filesystem maintenance</strong>: I don&rsquo;t trust my storage devices (and neither should
you), which is why I run a weekly scrub on my SSD that&rsquo;s running the <code>btrfs</code>
filesystem. If there are errors detected, I will know as soon as possible.</p>
<p>These tasks can be quite intensive, especially on hardware that&rsquo;s a bit older.</p>
<p>With some tasks, such as system updates, you may also run into random
issues. Updating Mozilla Firefox while it&rsquo;s actively running results in the
browser requiring a restart immediately after opening a new tab. This is very
annoying and inconvenient when you&rsquo;re in the middle of your work.</p>
<h2 id="the-time-to-sleep-script">
  <a class="heading-anchor" href="#the-time-to-sleep-script">The &ldquo;time-to-sleep&rdquo; script<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>To avoid intensive scheduled tasks running while I&rsquo;m doing actual work, I tried
rescheduling these tasks to a more quiet time. All I needed to do was to edit
the <code>systemd</code> timers so that the jobs start after midnight and leave the laptop
running.</p>
<p>This solution has quite an obvious downside: my laptop will be powered on
pretty much 24/7, and since electricity is super expensive and laptop
maintenance a bit of a pain, I&rsquo;d be wasting resources, time and eventually
money.</p>
<p>I <em>could</em> make the last scheduled task make the machine shut down, but what if I
have a long-running file copy operation running? It would be interrupted, unless
I specifically disabled the scheduled task.</p>
<p>Then it clicked for me.</p>
<p>I know when I&rsquo;m planning on going to sleep. Sleeping also has a regular cycle
as it happens daily. Why not just put all the scheduled daily tasks into one
script that I can run whenever I intend to shut down my laptop?</p>
<p>And thus, the <code>time-to-sleep</code> script was born. It&rsquo;s a simple Bash script that
lives in <code>/root/.local/bin/time-to-sleep</code>. To make sure I can also reasonably
observe the behaviour of the script, I&rsquo;ve implemented it as a simple <code>systemd</code>
service that lives in <code>/etc/systemd/system/time-to-sleep.service</code>. It&rsquo;s
disabled by default, but can be started manually.</p>
<pre tabindex="0"><code>[Unit]
Description=Run maintenance tasks

[Service]
ExecStart=/root/.local/bin/time-to-sleep
</code></pre><p>I have an alias in <code>~/.bashrc</code> that I use to start the service.</p>
<pre tabindex="0"><code>alias time-to-sleep=&#34;sudo systemctl start time-to-sleep.service&#34;
</code></pre><p>Whenever the time comes to go to sleep, or when I&rsquo;m just going to do something
else and can leave the laptop running at my desk, I just open a terminal window,
type <code>time-to-sleep</code> and I&rsquo;m good to go. If I&rsquo;m somewhere with a very poor
internet connection or need to conserve battery power, I can opt to not run that
script.</p>
<p>Going with this approach also saves me a lot of trouble on the technical side
as well. I don&rsquo;t need to think of a magical way to automatically detect if I&rsquo;m
working at the moment, or if I&rsquo;m running on battery, or if I&rsquo;m behind a limited
internet connection. Sometimes your job becomes so much easier if you make some
assumptions about when and where the script runs. You&rsquo;re in control of choosing
when to run it, after all.</p>
<p>In case something goes wrong, I can rely on the <code>set -e</code> line in my script to
fail hard. When I come back to my machine, it will be quite noticeable that
something has gone wrong, as the laptop will still be running. Who needs a
fancy monitoring setup when you have visual evidence of failure?</p>
<p>As for the hourly backups, I solved that problem by only making backups of
more important files. It takes much fewer resources compared to the full <code>/home</code>
folder backup that runs as part of the <code>time-to-sleep</code> script.</p>
<h2 id="conclusion">
  <a class="heading-anchor" href="#conclusion">Conclusion<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>After all this work, I don&rsquo;t have to worry about any scheduled tasks hogging
up all the resources while working. At the same time, I still get all the
benefits that the scheduled tasks bring.</p>
<h2 id="example">
  <a class="heading-anchor" href="#example">Example<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>In case you need it: here&rsquo;s an example of the script that I&rsquo;m running, with all
the personal details scrubbed out. Feel free to use it as inspiration for your
own <code>time-to-sleep</code> script!</p>
<pre tabindex="0"><code>#!/bin/bash

set -e

echo &#34;Restic full home folder backup.&#34;
export RESTIC_REPOSITORY=&#39;sftp:backupuser@backupserver.lan:/path/to/repo/&#39;
export RESTIC_PASSWORD=&#39;someverysecurepasswordgoeshere&#39;

restic unlock

restic backup --verbose --exclude-caches --cleanup-cache \
  --iexclude=/home/*/downloads \
  --exclude=/home/*/.cache \
  --exclude=/home/*/.gradle \
  --exclude=/home/*/.local/share/Trash \
  /home

restic forget --prune \
  --keep-hourly 0 \
  --keep-daily 7 \
  --keep-monthly 0

echo &#34;Restic full home folder backup done.&#34;

echo &#34;Backing up important data from the server.&#34;

rsync -az --delete-before \
  user@myserver.lan:/path/to/nextcloud/ \
  /storage/backups/nextcloud/

chown -R localuser:localuser /storage/backups/nextcloud/

echo &#34;Backing up important data from the server done.&#34;

echo &#34;Updating system.&#34;

dnf update -y

flatpak update -y &amp;&amp; flatpak uninstall --unused -y

echo &#34;Updating system done.&#34;

echo &#34;Scrubbing disk.&#34;
btrfs scrub start -B /
echo &#34;Scrubbing disk done.&#34;

echo &#34;All done! Going to sleep.&#34;

shutdown now
</code></pre>]]></content:encoded></item><item><title>btrbk is awesome</title><link>https://ounapuu.ee/posts/2022/07/09/btrbk-is-awesome/</link><pubDate>Sat, 09 Jul 2022 16:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2022/07/09/btrbk-is-awesome/</guid><description>I ramble about a tool that is great for taking regular snapshots on the btrfs filesystem.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/media/cover_hu_4fe4cf2661554252.jpg" width="1200" height="630" alt="btrbk is awesome" /><p>I like having a safety net whenever I&rsquo;m doing something potentially destructive,
which is why I use the <code>btrfs</code> file system for my operating system and my data.
Snapshots are one half of my &ldquo;whoops, there goes all my work&rdquo; strategy (backups
are the other half).</p>
<p><a href="/posts/2022/04/05/btrfs-snapshots/">I&rsquo;ve written about how I use snapshots on btrfs using snapper,</a>
but lately I&rsquo;ve become annoyed with it.</p>









<figure class="center">
  <a href="/posts/2022/07/09/btrbk-is-awesome/media/image.jpg">
    <img src="/posts/2022/07/09/btrbk-is-awesome/media/image_hu_b045336d02b39269.webp"
     width="1280"
     height="669"
     loading="lazy"
     decoding="async"
     alt="Snapshots: probably invented by a developer who owns a cat.">

  </a>
  <figcaption class="center">Snapshots: probably invented by a developer who owns a cat.</figcaption>
</figure>

<h2 id="shortcomings-of-snapper">
  <a class="heading-anchor" href="#shortcomings-of-snapper">Shortcomings of <code>snapper</code><svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p><code>snapper</code> is great while you&rsquo;re on the happy path, but when you wander off of
it, it gets a bit frustrating. This is 100% my own personal experience and I
cannot rule out any PEBCAK scenarios, but it&rsquo;s how I felt using the tool.</p>
<p>The snapshots are on the same subvolume, such as <code>/home/.snapshots</code>, which means
that I have to specifically exclude the <code>.snapshots</code> folder in every tool and
script that I use for making backups. Without that change, the tools ended up
scanning the folder and eating up a lot of resources, mainly the CPU and storage.</p>
<p>Backing up snapshots to something like an external backup SSD wasn&rsquo;t something
that <code>snapper</code> supported out of the box as well, meaning that for offline
backups I still had to resort to a good old <code>rsync</code> copy. It&rsquo;s inconvenient and
I won&rsquo;t have a backup that also contained recent snapshots, but it was
manageable.</p>
<p>I also reinstalled Fedora Linux on my ThinkPad recently to see how well my
Ansible playbooks hold up (quite decently!) and found that setting up <code>snapper</code>
is a bit of a pain. I tried to set up <code>snapper</code> again, but it wasn&rsquo;t as
straightforward as I was hoping for, with it not properly picking up the
configuration file changes. At the end, it just ran into weird errors
when I tried it to prune some snapshots according to the policy I set up. Since
I was running out of disk space, I just gave up, uninstalled <code>snapper</code> and
destroyed the snapshots manually.</p>
<p>After all that (and a recommendation by a friend) I decided to bite the bullet
and try out <a href="https://github.com/digint/btrbk">btrbk</a>.</p>
<h2 id="btrbk">
  <a class="heading-anchor" href="#btrbk">btrbk<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Setting up <code>btrbk</code> on Fedora Linux 36 was a breeze. Install it via <code>dnf install  btrbk</code>, copy your configuration to <code>/etc/btrbk/</code>, make sure that the directory
used for snapshots exists with <code>mkdir /btrbk_snapshots</code> and you&rsquo;re good to go!
<code>btrbk</code> is just a huge Perl script, so no fancy dependencies are needed.</p>
<p>My <code>btrfs</code> filesystem has three subvolumes: <code>/</code>, <code>/home</code> and <code>/storage</code>. Data
stored on these subvolumes has different levels of importance, which is also
reflected in the snapshot retention policies.</p>
<p>The configuration on my setup is the following:</p>
<pre tabindex="0"><code>timestamp_format        long

volume /
  snapshot_dir /btrbk_snapshots
  subvolume /
    snapshot_preserve_min   12h
    snapshot_preserve       24h
  subvolume /home
    snapshot_preserve_min   48h
    snapshot_preserve       7d
  subvolume /storage
    snapshot_preserve_min   6h
    snapshot_preserve       7d
</code></pre><p>To take the snapshots, I&rsquo;ve set up a systemd timer that runs every 5 minutes and
runs the following command:</p>
<pre tabindex="0"><code>btrbk -c /etc/btrbk/btrbk.conf run --progress
</code></pre><p>A successful run will have output like this:</p>
<pre tabindex="0"><code>--------------------------------------------------------------------------------
Backup Summary (btrbk command line client, version 0.32.1)
    Date:   Sat Jul  9 14:00:00 2022
    Config: /etc/btrbk/btrbk.conf
Legend:
    ===  up-to-date subvolume (source snapshot)
    +++  created subvolume (source snapshot)
    ---  deleted subvolume
    ***  received subvolume (non-incremental)
    &gt;&gt;&gt;  received subvolume (incremental)
--------------------------------------------------------------------------------
/
+++ /btrbk_snapshots/ROOT.20220709T1400
--- /btrbk_snapshots/ROOT.20220708T1300
/home
+++ /btrbk_snapshots/home.20220709T1400
/storage
+++ /btrbk_snapshots/storage.20220709T1400
--- /btrbk_snapshots/storage.20220709T0745
--- /btrbk_snapshots/storage.20220709T0750
--- /btrbk_snapshots/storage.20220709T0755
</code></pre><p>I love how the output is very concise about what it just did.</p>
<p>To make a backup of my drive to an external SSD that&rsquo;s also a <code>btrfs</code> filesystem,
I created a separate config at <code>/etc/btrbk/backup-to-ext-drive.conf</code>:</p>
<pre tabindex="0"><code>timestamp_format        long

target_preserve_min    no
target_preserve        7d

volume /
  snapshot_dir /btrbk_snapshots
  target /mnt/backup/T430
  subvolume /
  subvolume /home
  subvolume /storage
</code></pre><p>In this example, <code>/mnt/backup/T430</code> is a <code>btrfs</code> subvolume itself.</p>
<p>Instead of running <code>rsync</code>, my backup script contains the line:</p>
<pre tabindex="0"><code>btrbk -c /etc/btrbk/backup-to-ext-drive.conf run --progress
</code></pre><p>I love how the default behaviour in <code>btrbk</code> is to keep snapshots separate from
the subvolumes themselves. Making a full copy of <code>/home</code> or any other filesystem
doesn&rsquo;t require me to always exclude the <code>.snapshots</code> directory, which is nice.</p>
<p>The snapshot names themselves are also human readable. If I accidentally messed
up and my changes from an hour ago were lost, I&rsquo;d just have to go to
<code>/btrbk_snapshots</code>, look up a snapshot from an hour ago, and copy whatever I
need from the snapshot. This has already saved my butt at least once.</p>
<h2 id="conclusion">
  <a class="heading-anchor" href="#conclusion">Conclusion<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>It&rsquo;s not often that a piece of software gets me that excited, but <code>btrbk</code> has
somehow managed to do it. It&rsquo;s a single script that has all the example use
cases documented in its README and the functionality does exactly what I want.</p>
<p>That&rsquo;s all I really need from software.</p>
<p>Huge thanks to <a href="https://digint.ch/">Digital Integrity GmbH</a> for building,
maintaining and sharing this tool with the world!</p>
]]></content:encoded></item><item><title>Disabling the crappy Broadcom Bluetooth adapter in your ThinkPad T430 running Linux</title><link>https://ounapuu.ee/posts/2022/06/01/thinkpad-t430-bluetooth-shenanigans/</link><pubDate>Wed, 01 Jun 2022 12:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2022/06/01/thinkpad-t430-bluetooth-shenanigans/</guid><description>If you have ever felt frustated with the Bluetooth experience that your ThinkPad T430 offers you, especially after upgrading the WiFi adapter to one that also has Bluetooth capabilities, then this article might help you out.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/media/cover_hu_4fe4cf2661554252.jpg" width="1200" height="630" alt="Disabling the crappy Broadcom Bluetooth adapter in your ThinkPad T430 running Linux" /><p>You&rsquo;ve disabled the boneheaded Lenovo WiFi adapter whitelist using a tool like
<a href="https://github.com/n4ru/1vyrain">1vyrain</a>, installed a better adapter like the
<a href="https://ark.intel.com/content/www/us/en/ark/products/75439/intel-dual-band-wirelessac-7260.html">Intel Dual Band Wireless-AC 7260</a>,
and found that Bluetooth is not working as intended on your ThinkPad T430
running Linux?</p>
<p>Here&rsquo;s a guide on what you can try to resolve some issues you may encounter.</p>
<h2 id="the-integrated-bluetooth-adapter">
  <a class="heading-anchor" href="#the-integrated-bluetooth-adapter">The integrated Bluetooth adapter<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>The ThinkPad T430 comes with Bluetooth out of the box. Mine is this one:</p>
<pre tabindex="0"><code>Bus 001 Device 004: ID 0a5c:21e6 Broadcom Corp. BCM20702 Bluetooth 4.0 [ThinkPad]
</code></pre>








<figure class="center">
  <a href="/posts/2022/06/01/thinkpad-t430-bluetooth-shenanigans/media/image.jpg">
    <img src="/posts/2022/06/01/thinkpad-t430-bluetooth-shenanigans/media/image_hu_7f58e7068cea5d7a.webp"
     width="1280"
     height="775"
     loading="lazy"
     decoding="async"
     alt="And it looks something like this.">

  </a>
  <figcaption class="center">And it looks something like this.</figcaption>
</figure>

<p>I run Fedora Linux and frankly the experience with the stock adapter is horrible.
Getting stuck while pairing a device or the GNOME Bluetooth settings GUI hanging
isn&rsquo;t a rare sight. Sometimes I&rsquo;ve had to run a script to reset all USB devices
to get things sorted out, or restart the machine altogether. This is not fun
when a work call started 3 minutes ago and your Bluetooth headset is just not
working.</p>
<p>After installing the new Intel WiFi adapter, I thought that I&rsquo;d just disable the
integrated Bluetooth controller via the UEFI settings. That should do the trick,
right?</p>
<p>Nope. Apparently this disabled ALL bluetooth devices, including the one provided
by the Intel adapter.</p>
<p>Well, no problem, I&rsquo;ll just physically remove the Broadcom device and that
should force the ThinkPad to use the Intel adapter, right?</p>
<p>Nope. Now the machine just shows no Bluetooth devices.</p>
<h2 id="udev-to-the-rescue">
  <a class="heading-anchor" href="#udev-to-the-rescue">udev to the rescue<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>If you install the Intel adapter and don&rsquo;t touch any of the settings, you&rsquo;ll have
two Bluetooth adapters. On my laptop, the OS used the Broadcom adapter by default,
which was evident by all GUI interactions interfacing with the Broadcom one and
throwing out errors in <code>dmesg -w</code> as a result.</p>
<p>Since disabling the Broadcom bluetooth adapter via other means did not work, I
had to look for some solutions. One that I stumbled upon relied on <code>udev</code> rules.</p>
<p>Essentially, what you want to do is drop a file in <code>/etc/udev/rules.d/</code>, name it
something like <code>81-bluetooth-hci.rules</code> and make the contents something like
this:</p>
<pre tabindex="0"><code>SUBSYSTEM==&#34;usb&#34;, ATTRS{idVendor}==&#34;0a5c&#34;, ATTRS{idProduct}==&#34;21e6&#34;, ATTR{authorized}=&#34;0&#34;
</code></pre><p>Make sure to replace the <code>idVendor</code> and <code>idProduct</code> with the correct values for
your Bluetooth adapter. Output of <code>lsusb</code> will likely contain those values.</p>
<p>In my case, the output of <code>lsusb</code> is</p>
<p><code>Bus 001 Device 004: ID 0a5c:21e6 Broadcom Corp. BCM20702 Bluetooth 4.0 [ThinkPad]</code></p>
<p>The <code>idVendor</code> and <code>idProduct</code> info is in this string: <code>ID 0a5c:21e6</code>.</p>
<p>After making this change and restarting, you should see that<code>bluetoothctl list</code>
outputs only one Bluetooth device.</p>
<pre tabindex="0"><code>[host@T430 ~]$ bluetoothctl list
Controller AC:FD:CE:30:EB:BA T430 [default]
</code></pre><p>Because Bluetooth is still a hot mess in 2022, I still have to occasionally beat
it with a hammer. However, the experience with the Intel adapter is much better
and a simple &ldquo;turn the adapter off and on again in the GUI&rdquo; solved 99% of the
issues I&rsquo;ve encountered since then.</p>
<h3 id="have-you-tried-turning-it-off-and-on-again">
  <a class="heading-anchor" href="#have-you-tried-turning-it-off-and-on-again">&ldquo;Have you tried turning it off and on again?&rdquo;<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h3>
<p>If for whatever reason this solution does not apply to you, and you feel like
you want to hit your machine with a big hammer without having to restart it, then
<a href="https://askubuntu.com/a/290519">here&rsquo;s a script</a> that resets all the USB
devices on your machine. I&rsquo;ve observed that most Bluetooth adapters run over USB,
which is why this script works with those as well.</p>
<p>It has helped me countless times when desperate for a quick Bluetooth fix on
various desktops and laptops that I&rsquo;ve used.</p>
<p>Run it at your own risk.</p>
<pre tabindex="0"><code>#!/bin/bash

for i in /sys/bus/pci/drivers/[uoex]hci_hcd/*:*; do
  [ -e &#34;$i&#34; ] || continue
  echo &#34;${i##*/}&#34; &gt; &#34;${i%/*}/unbind&#34;
  echo &#34;${i##*/}&#34; &gt; &#34;${i%/*}/bind&#34;
done
</code></pre>]]></content:encoded></item><item><title>Oversimplified guide into snapshots on the btrfs filesystem</title><link>https://ounapuu.ee/posts/2022/04/05/btrfs-snapshots/</link><pubDate>Tue, 05 Apr 2022 06:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2022/04/05/btrfs-snapshots/</guid><description>Oh, snap(per)!</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/media/cover_hu_4fe4cf2661554252.jpg" width="1200" height="630" alt="Oversimplified guide into snapshots on the btrfs filesystem" /><p><em><strong>Update:</strong></em> I&rsquo;ve switched to <a href="/posts/2022/07/09/btrbk-is-awesome/">btrbk</a> for managing btrfs snapshots due to certain
deficiencies that I had with <code>snapper</code>. Those may have been fixed since then, but <code>btrbk</code> has served me very well, and
I&rsquo;m sticking with it in the foreseeable future.</p>
<p>Friday afternoon. You&rsquo;re trying out a script that you wrote to mass-rename and
move some files around. You finish the script and test it out.</p>
<p>Oops.</p>
<p>All the files now have all the wrong names, and some have been randomly moved
10 folders deep. It&rsquo;s a mess.</p>
<p>And you didn&rsquo;t make a backup of your files right before this step because
you thought that you wouldn&rsquo;t need it. <em>It&rsquo;s just a simple script, after all&hellip;</em></p>
<p>If you&rsquo;ve found yourself in a similar situation and want to know how to avoid
problems in the future, then this article is for you</p>
<h2 id="btrfs-overview">
  <a class="heading-anchor" href="#btrfs-overview">btrfs: overview<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>









<figure class="center">
  <a href="/posts/2022/04/05/btrfs-snapshots/media/btrfs.png" aria-label="View full-size image">
    <img src="/posts/2022/04/05/btrfs-snapshots/media/btrfs_hu_6d2804214375925e.webp"
     width="593"
     height="328"
     loading="lazy"
     decoding="async"
     alt="">

  </a>
  
</figure>

<p><a href="https://btrfs.wiki.kernel.org/index.php/Main_Page">btrfs</a>
(<em>butter-fs, bee-tee-arr-eff-ess</em>) is a modern filesystem present in the Linux
kernel that has a lot of great features:</p>
<ul>
<li>different RAID levels: RAID0, RAID1, RAID10&hellip;</li>
<li>data integrity guarantees</li>
<li>snapshots</li>
<li>and many more!</li>
</ul>
<p><code>btrfs</code> does have some downsides and has had its fair share of issues and
controversy in the past, but at least during the last couple of years it&rsquo;s been
fine in my simple RAID1 + snapshots use cases.</p>
<p>In this post, we&rsquo;ll focus on the snapshots feature that <code>btrfs</code> offers.</p>
<p>If you&rsquo;re not sure what snapshots are, then you can think of them as a still
image of the state of your filesystem at a certain point in time. You can create
a snapshot of the filesystem, delete all your files, and still be able to get
your files back just like you left them.</p>
<p>If you&rsquo;re a developer who has used <code>git</code> and doesn&rsquo;t mind oversimplified (and
probably incorrect) explanations: you can think of snapshots like <code>git</code> commits.
You can take snapshots (commit), roll back to a previous snapshot (reset/revert)
or view the contents of a previous snapshot (checkout commit).</p>
<p>One thing to keep in mind with snapshots is that they will take up space,
especially if you make a lot of them and move files around a lot.</p>
<p>There are many tools available to manage <code>btrfs</code> snapshots. The one I&rsquo;ve opted
for is <a href="http://snapper.io/">snapper</a>.</p>
<h2 id="snapper-quick-start">
  <a class="heading-anchor" href="#snapper-quick-start">Snapper quick-start<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Here&rsquo;s a quick guide on how to get started with snapshotting your <code>btrfs</code>
filesystem. The example is based on a system with a <code>btrfs</code> filesystem mounted
on <code>/home</code></p>
<ul>
<li>Install <code>snapper</code>
<ul>
<li>Ubuntu/Debian: <code>sudo apt install snapper</code></li>
<li>Fedora: <code>sudo dnf install snapper</code></li>
</ul>
</li>
<li>Setup the configuration: <code>sudo snapper -c home create-config /home</code></li>
<li><code>/etc/snapper/configs</code> now has a text file named <code>home</code> that you can configure
to your liking. My personal recommendation is to use the <code>TIMELINE</code> snapshots
configuration to configure the maximum number of hourly and daily snapshots.</li>
<li><code>snapper</code> ships with two systemd timers that automatically take new snapshots
and remove old ones. Make sure that they are enabled:
<ul>
<li><code>sudo systemctl enable --now snapper-timeline.timer snapper-cleanup.timer</code></li>
</ul>
</li>
<li>After a while, you should be able to see snapshots appear in the output of
<code>sudo snapper -c home list</code>.</li>
<li>If you want to browse the files for the old snapshots, go to <code>/home/.snapshots</code>.</li>
</ul>
<p>Example output of <code>sudo snapper -c home  list</code> on my machine:</p>
<pre tabindex="0"><code>&gt; sudo snapper -c home list

    # | Type   | Pre # | Date                     | User | Cleanup  | Description | Userdata
------+--------+-------+--------------------------+------+----------+-------------+---------
   0  | single |       |                          | root |          | current     |         
   1  | single |       | K 16 märts 2022 08:12:01 | root | timeline |             |         
 242  | single |       | K 16 märts 2022 13:00:16 | root | timeline |             |         
 302  | single |       | K 16 märts 2022 14:00:05 | root | timeline |             |         
 362  | single |       | K 16 märts 2022 15:00:10 | root | timeline |             |         
 422  | single |       | K 16 märts 2022 16:00:19 | root | timeline |             |         
 461  | single |       | K 16 märts 2022 17:20:29 | root | timeline |             |         
 501  | single |       | K 16 märts 2022 18:00:02 | root | timeline |             |
...         
</code></pre><p>That&rsquo;s it!</p>
<h2 id="snapper-tech-tips">
  <a class="heading-anchor" href="#snapper-tech-tips">Snapper tech tips<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>If you&rsquo;re new to snapshots, then I recommend keeping an eye on your disk usage
and tuning the <code>snapper</code> timeline related configurations to your liking. For my
<code>/home</code> folder, my configuration looks like this:</p>
<pre tabindex="0"><code># create hourly snapshots
TIMELINE_CREATE=&#34;yes&#34;

# cleanup hourly snapshots after some time
TIMELINE_CLEANUP=&#34;yes&#34;

# limits for timeline cleanup
TIMELINE_MIN_AGE=&#34;300&#34;
TIMELINE_LIMIT_HOURLY=&#34;48&#34;
TIMELINE_LIMIT_DAILY=&#34;7&#34;
TIMELINE_LIMIT_WEEKLY=&#34;0&#34;
TIMELINE_LIMIT_MONTHLY=&#34;0&#34;
TIMELINE_LIMIT_YEARLY=&#34;0&#34;
</code></pre><p>With this configuration, I can undo my screw-ups for up to 7 days, with more
granular control for changes done within the last 48 hours.</p>
<p>If you have data that changes more often than other data on the same filesystem,
then I recommend utilizing <code>btrfs</code> subvolumes and creating separate <code>snapper</code>
configurations for each.</p>
<p>For example: a folder containing gigabytes of cat pictures is unlikely to change
all that often, so a longer snapshot retention policy of 24 hourly/30 daily
snapshots is a sensible one.</p>
<p>However, the contents of my <code>downloads</code> folder changes more frequently and may
contain bigger files that I need temporarily, such as the ISO file for the
latest Fedora/Debian release. In a situation like that, having a 6 hourly/7
daily snapshots policy will make more sense, especially if I don&rsquo;t want to run
out of space due to excessive number of snapshots taken for that filesystem.</p>
<h2 id="further-reading-zfs-snapshots">
  <a class="heading-anchor" href="#further-reading-zfs-snapshots">Further reading: ZFS snapshots<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p><a href="https://zfsonlinux.org/">ZFS</a> is a fantastic filesystem that offers many of
the features boasted by <code>btrfs</code>, and some that <code>btrfs</code> doesn&rsquo;t have. ZFS also
supports snapshots. To set up automatic snapshot creation and pruning on ZFS,
I can recommend <a href="https://github.com/jimsalterjrs/sanoid">sanoid</a>.</p>
]]></content:encoded></item><item><title>Testing GPU passthrough on AMD Ryzen 7 5700G APU</title><link>https://ounapuu.ee/posts/2021/08/29/testing-gpu-passthrough-on-amd-ryzen-5700g/</link><pubDate>Sat, 28 Aug 2021 10:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2021/08/29/testing-gpu-passthrough-on-amd-ryzen-5700g/</guid><description>A quick overview of my experience with setting it up on a small PC box and things to consider when attempting this yourself.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/media/cover_hu_4fe4cf2661554252.jpg" width="1200" height="630" alt="Testing GPU passthrough on AMD Ryzen 7 5700G APU" /><h2 id="introduction">
  <a class="heading-anchor" href="#introduction">Introduction<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Before we jump into all the nitty-gritty details, I&rsquo;d like to go over what we are dealing with here since these topics
may be unfamiliar to you. VFIO is quite a niche topic and not everyone knows about it.</p>
<p><a href="https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF">GPU passthrough</a>: the process of allowing a VM (virtual
machine) to use a dedicated GPU. This allows you to run GPU-heavy workloads inside the VM, such as gaming or anything
that benefits from GPU compute power.</p>
<p><a href="https://www.kernel.org/doc/Documentation/vfio.txt">VFIO</a>: the framework that allows us to perform this operation.</p>
<p><a href="https://en.wikipedia.org/wiki/Input%E2%80%93output_memory_management_unit">IOMMU</a>: hardware feature that supports all
of this.</p>
<p><a href="https://virt-manager.org/">virt-manager</a>: GUI application that I use to manage VM-s.</p>
<p>Reasons why you may want to go through all the hassle and use this approach:</p>
<ul>
<li>you&rsquo;re on Linux but want to play games occasionally without rebooting into Windows</li>
<li>you want to do all your work, gaming and server workloads on one machine</li>
<li>you simply don&rsquo;t want to build a dedicated PC for playing games and would like to utilize the existing resources on
your main machine</li>
<li>you want more control over the Windows installation because you simply don&rsquo;t trust Microsoft</li>
<li>you want to have more control over the Windows installation and the ability to revert the installation to an earlier
point in time using a filesystem that supports snapshots (BTRFS, ZFS)</li>
<li>you have multiple separate VM-s for different purposes, but you would like to use one single GPU for all of them</li>
</ul>
<p>One thing to keep in mind is that the hardware you use matters a lot here as that provides the foundation for getting
this solution working. Here are some of the requirements you should know about:</p>
<ul>
<li>The GPU you want to pass through has to support UEFI. GPU-s from the past 5 years should be good on that, but if you
have a really old GPU that you want to use for testing, then that might not work out that well.</li>
<li>You need to have a good-enough CPU and plenty of RAM. After all, you&rsquo;re essentially running a full PC within another
PC.</li>
<li>Your motherboard has to support IOMMU and have IOMMU groups that allow you to isolate the GPU and only pass the GPU to
the VM. <a href="https://www.youtube.com/user/teksyndicate">Level1Techs</a> does quite a few motherboard reviews and Wendell goes
over the IOMMU groups and suitability for VFIO in them. It also helps if you look around the internet for enthusiasts
that have already bought the same motherboard, they may have posted information about the groups. Here&rsquo;s
a <a href="https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#Ensuring_that_the_groups_are_valid">handy script that allows you to check your IOMMU groups.</a></li>
<li>Some games may ban you if they detect that you are running the game inside a VM. It&rsquo;s great that they&rsquo;re trying to do
something against cheaters, but unfortunately VFIO users get unfairly treated here. Please do some research beforehand
if you play competitive multiplayer games a lot!</li>
</ul>
<p>I hope that this introduction helped you understand the basics. Now, let&rsquo;s just jump right into it.</p>
<h2 id="setup">
  <a class="heading-anchor" href="#setup">Setup<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>We&rsquo;re going to test this setup
on <a href="/posts/2021/08/07/amd-ryzen-7-5700-first-impressions/">hardware that I have covered previously</a>. What makes this
setup a bit special is that we&rsquo;re using an AMD Ryzen 7 5700G APU on an mITX motherboard and a single dedicated GPU,
allowing us to do big things in a small package. Yes, there are setups where you can do VFIO with a single GPU and pass
it between the host OS and the VM, but that setup might be a bit tricky to use.</p>
<p>The OS is Fedora 34. To get this working, I&rsquo;ve used various resources:</p>
<ul>
<li><a href="https://forum.level1techs.com/t/the-vfio-and-gpu-passthrough-beginners-resource/129897">beginners guide on Level1Techs forums</a></li>
<li><a href="https://forum.level1techs.com/t/fedora-33-ultimiate-vfio-guide-for-2020-2021-wip/163814">Fedora-specific guide by Wendell from Level1Techs</a></li>
<li><a href="https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#Ensuring_that_the_groups_are_valid">this brilliant Arch Wiki guide that covers most of what you need to know about setting this up.</a>
It&rsquo;s not only useful for Arch, a lot of what is written here applies for any distro.</li>
</ul>
<h2 id="testing">
  <a class="heading-anchor" href="#testing">Testing<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I decided to do the initial testing with the Nvidia GT 710. It&rsquo;s slow, buggy on Linux on Nouveau open source drivers,
and I had it available. I also recently heard that Nvidia stopped being hostile towards their customers in one aspect
by <a href="https://www.nvidia.com/en-us/geforce/news/outriders-game-ready-driver/">allowing GeForce GPU-s to be used in a Windows 10 VM without having to resort to workarounds.</a></p>
<p>The testing itself was relatively straightforward. The only issues I had
were <a href="https://en.wiktionary.org/wiki/PEBCAK">PEBCAK</a> issues, possibly related to me performing this testing after work.
The main issues I ran were either small typos in dracut configuration or the wrong device ID-s being added to kernel
boot parameters. Once I discovered and fixed those, it was all smooth sailing.</p>
<p>I&rsquo;m not going to rewrite a full guide here, please refer to the previously linked resources if you need more details
than that. Those resources are also much more likely to receive updates about new finds and features.</p>
<p>The steps I took were roughly these:</p>
<ul>
<li>Make sure that IOMMU was enabled in UEFI settings. It&rsquo;s probably set to <code>auto</code> by default, make sure to set it
to <code>enabled</code>.</li>
<li>Install the GPU that I want to pass through and connect it to a monitor.</li>
<li>Install virtualization packages on Fedora: <code>sudo dnf install @virtualization</code></li>
<li>Enable IOMMU and preload the VFIO kernel module by adding <code>amd_iommu=on rd.driver.pre=vfio-pci</code> to Linux kernel
parameters.
<ul>
<li>I use GRUB2, these parameters live in <code>/etc/sysconfig/grub</code>.</li>
<li>To apply these changes, you have to regenerate the GRUB configuration. Under Fedora, this is done
using <code>grub2-mkconfig -o /etc/grub2-efi.cfg</code></li>
</ul>
</li>
<li>Get the device ID-s for the GPU and the related audio device that you&rsquo;re planning on passing through
<ul>
<li>To see the devices and ID-s, run <code>lspci -nnk</code>. The ID-s look something like <code>1002:aaf0</code>.</li>
</ul>
</li>
<li>Bind the GPU to <code>vfio-pci</code> to avoid the GPU driver from taking control of the GPU, otherwise you cannot pass it to the
VM.
<ul>
<li>I opted to go for the simple approach and added the device ID-s to kernel
parameters: <code>vfio-pci.ids=1002:67df,1002:aaf0</code></li>
<li>Since I went with this approach, then I have to regenerate GRUB configuration again.</li>
</ul>
</li>
<li>Make sure that the initramfs loads the necessary vfio drivers early in the boot.
<ul>
<li>With Fedora 34, this means creating a file <code>/etc/dracut.conf.d/10-vfio.conf</code> with
contents <code>add_drivers+=&quot; vfio_pci vfio vfio_iommu_type1 vfio_virqfd &quot;</code>.</li>
<li>Make sure that you don&rsquo;t have any typos in that.</li>
<li>Regenerate the initramfs: <code>dracut -f</code></li>
</ul>
</li>
<li>Reboot!</li>
<li>Using <code>virt-manager</code>, select the VM you want to pass the GPU through and add two PCIe devices: the GPU and its
associated audio device.
<ul>
<li>If you don&rsquo;t have the VM set up yet, then proceed with the normal installation without the GPU passed through yet.
Make sure to create an UEFI VM, otherwise you might run into issues. This can be configured in <code>virt-manager</code> _
Overview_ section by selecting the Q35 chipset and setting the firmware to <code>OVMF_CODE.df</code>.</li>
<li>If you have passed through the GPU, then make sure to remove the <code>Display Spice</code> device from the VM.</li>
<li>If you want to also control the VM, you need to also pass through your USB devices, such as a Logitech wireless
receiver.</li>
</ul>
</li>
<li>Start the VM and cheer once you notice TianoCore appearing on the monitor that&rsquo;s connected to the passed through GPU!</li>
</ul>









<figure class="center">
  <a href="/posts/2021/08/29/testing-gpu-passthrough-on-amd-ryzen-5700g/media/vfio-success.jpg">
    <img src="/posts/2021/08/29/testing-gpu-passthrough-on-amd-ryzen-5700g/media/vfio-success_hu_199212126e9325b5.webp"
     width="1107"
     height="800"
     loading="lazy"
     decoding="async"
     alt="If you see this, then you&#39;ve just successfully passed the GPU to the VM. Congratulations!">

  </a>
  <figcaption class="center">If you see this, then you&#39;ve just successfully passed the GPU to the VM. Congratulations!</figcaption>
</figure>

<h2 id="results-nvidia-gt-710">
  <a class="heading-anchor" href="#results-nvidia-gt-710">Results: Nvidia GT 710<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Initial testing with Nvidia GT 710 was successful. By successful, I mean that the GPU displayed an image and did not
install GPU drivers automatically.</p>









<figure class="center">
  <a href="/posts/2021/08/29/testing-gpu-passthrough-on-amd-ryzen-5700g/media/nvidia-error-43.jpg">
    <img src="/posts/2021/08/29/testing-gpu-passthrough-on-amd-ryzen-5700g/media/nvidia-error-43_hu_326f276537db01bf.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="The infamous Nvidia error code 43.">

  </a>
  <figcaption class="center">The infamous Nvidia error code 43.</figcaption>
</figure>

<p>To overcome that last issue, I downloaded the latest official Nvidia GPU drivers and was good to go. The news were true,
error code 43 was no longer an issue!</p>









<figure class="center">
  <a href="/posts/2021/08/29/testing-gpu-passthrough-on-amd-ryzen-5700g/media/nvidia-postinstall.jpg">
    <img src="/posts/2021/08/29/testing-gpu-passthrough-on-amd-ryzen-5700g/media/nvidia-postinstall_hu_42e3d99bf6c38aba.webp"
     width="600"
     height="800"
     loading="lazy"
     decoding="async"
     alt="If your GPU shows up like this in Device Manager, then it should work properly.">

  </a>
  <figcaption class="center">If your GPU shows up like this in Device Manager, then it should work properly.</figcaption>
</figure>

<p>Things got a bit less exciting when I got reminded that this GPU is weak. Very weak. Regardless, I decided to
demonstrate its computing prowess by downloading the <a href="https://funselektor.itch.io/art-of-rally">art of rally demo</a>. Side
note: it&rsquo;s a great game, go try it out!</p>
<p>The demo ran! Not well, but it still ran!</p>









<figure class="center">
  <a href="/posts/2021/08/29/testing-gpu-passthrough-on-amd-ryzen-5700g/media/nvidia-artofrally.jpg">
    <img src="/posts/2021/08/29/testing-gpu-passthrough-on-amd-ryzen-5700g/media/nvidia-artofrally_hu_b26dfefd5196674e.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="Not pictured: the horrible framerate.">

  </a>
  <figcaption class="center">Not pictured: the horrible framerate.</figcaption>
</figure>

<p>Satisfied with the results, I decided to go for gold and replace this GPU with the AMD RX 570 that I &ldquo;borrowed&rdquo;
from <a href="/posts/2021/08/21/turning-leftover-parts-into-a-decent-gaming-pc/">this PC I built recently</a>.</p>
<h2 id="results-amd-rx-570">
  <a class="heading-anchor" href="#results-amd-rx-570">Results: AMD RX 570<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>After switching the GPU, I replaced the device ID-s with the new values and continued with the VFIO adventure. This
time, the GPU drivers were automatically installed by Windows and everything just worked. That&rsquo;s not supposed to happen,
at least in my experience <em>something</em> always goes wrong. Always.</p>
<p>I installed the latest drivers from AMD-s website and continued with testing.</p>
<p>Furmark? Runs as expected.</p>









<figure class="center">
  <a href="/posts/2021/08/29/testing-gpu-passthrough-on-amd-ryzen-5700g/media/amd-furmark.jpg">
    <img src="/posts/2021/08/29/testing-gpu-passthrough-on-amd-ryzen-5700g/media/amd-furmark_hu_27a05e2f78a7e673.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="VM on the left, VM performance stats on the right, mess of cables everywhere.">

  </a>
  <figcaption class="center">VM on the left, VM performance stats on the right, mess of cables everywhere.</figcaption>
</figure>

<p>GTA IV? A stuttery mess, so yeah, runs as expected.</p>









<figure class="center">
  <a href="/posts/2021/08/29/testing-gpu-passthrough-on-amd-ryzen-5700g/media/amd-gta-iv.jpg">
    <img src="/posts/2021/08/29/testing-gpu-passthrough-on-amd-ryzen-5700g/media/amd-gta-iv_hu_64a674dc7b9cffa9.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="On the left: GTA IV, straight from the GPU. On the right: GTA IV, streamed via Parsec.">

  </a>
  <figcaption class="center">On the left: GTA IV, straight from the GPU. On the right: GTA IV, streamed via Parsec.</figcaption>
</figure>

<p>At this point the VM was assigned 4 CPU cores and I had performed no CPU pinning or optimizations of any kind, so the
results were pretty good.</p>
<h2 id="storage">
  <a class="heading-anchor" href="#storage">Storage<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Because I built this setup on my current workstation/server machine, the storage situation is a bit tricky. The other VM
that runs all the services has full access to the two 12TB hard drives and I wasn&rsquo;t interested in setting up a networked
storage setup. The only free spots I had were as follows:</p>
<ul>
<li>120GB partition from the NVMe SSD. Good enough for storing the Windows 10 system files.</li>
<li>2x 250GB partitions on the Samsung SATA 1TB SSD-s. Just enough to hold my recently played games, but not much more.
Running in striped configuration under Windows.</li>
</ul>
<p>I later opted to expand the game storage partitions to 375GB, which meant that I had to get rid of the extra
overprovisioning space that I had left aside. This setup is fine, but I&rsquo;m losing out on some of the benefits that come
with a virtualized Windows setup.</p>
<p>With regards to passing this storage to the VM, I had two options:</p>
<ul>
<li>keep using the SATA virtual disk: works out of the box, but might not perform as well.</li>
<li>use <code>virtio</code>: you need to manually load and install the drivers for Windows to recognize these disks, but allegedly
this has better performance than the SATA implementation.</li>
</ul>
<p>I started off with SATA and did a comparison against <code>virtio</code> using CrystalDiskMark.</p>









<figure class="center">
  <a href="/posts/2021/08/29/testing-gpu-passthrough-on-amd-ryzen-5700g/media/crystaldiskmark.png">
    <img src="/posts/2021/08/29/testing-gpu-passthrough-on-amd-ryzen-5700g/media/crystaldiskmark_hu_71252985bd8c9ed3.webp"
     width="1280"
     height="467"
     loading="lazy"
     decoding="async"
     alt="Left: SATA. Right: virtio.">

  </a>
  <figcaption class="center">Left: SATA. Right: virtio.</figcaption>
</figure>

<p><code>virtio</code> did come ahead in these comparisons, but I would probably have been fine with the SATA performance as well.</p>
<h2 id="conclusion">
  <a class="heading-anchor" href="#conclusion">Conclusion<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>One of the main reasons I do these kinds of setups is the technical challenge. It sounds weird, but sometimes I am
happier after having completed something technical and novel compared to actually using the setup.</p>
<p>Previously I&rsquo;ve had mixed results with GPU passthrough,
with <a href="https://www.reddit.com/r/linuxmasterrace/comments/7ry4jr/gta_v_on_arch_linux_how_i_managed_to_get_gpu/">ThinkPad T430 and eGPU somehow managing to run GTA V in a VM</a>
, while in another testing session I ran into issues which turned out to be related to the CPU being faulty (lots of
PCIe errors).</p>
<p>I do have more practical future plans with this. The plan is to use this VM as a gaming VM that I can stream games from
using <a href="https://parsec.app/">Parsec</a>
to any device that I wish. One idea is to use the <a href="https://www.nvidia.com/en-us/shield/shield-tv/">Nvidia Shield TV</a> as
a low-power box that is capable of performing streaming. Alternatively, I could also get a super tiny form factor
Dell/Lenovo/HP PC that has plenty of power to drive a 4K display and uses a reasonable amount of power. More on that in
a future post.</p>
<p>Regarding storage I foresee an upgrade coming soon, either to the drives themselves or the whole setup since ATX
motherboards support more SATA ports and expansion cards. If you also pair that up with a case
like <a href="https://www.coolermaster.com/catalog/cases/mid-tower/masterbox-q500l/">Masterbox Q500L</a> with a good power supply
placement, then you&rsquo;d still have a relatively small setup.</p>
]]></content:encoded></item><item><title>AMD Ryzen 7 5700G: first impressions on Fedora 34</title><link>https://ounapuu.ee/posts/2021/08/07/amd-ryzen-7-5700-first-impressions/</link><pubDate>Sat, 07 Aug 2021 07:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2021/08/07/amd-ryzen-7-5700-first-impressions/</guid><description>Or _'How to downgrade your CPU at great expense!'_</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/media/cover_hu_4fe4cf2661554252.jpg" width="1200" height="630" alt="AMD Ryzen 7 5700G: first impressions on Fedora 34" /><h2 id="introduction">
  <a class="heading-anchor" href="#introduction">Introduction<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I&rsquo;ve covered my self-hosting setup in <a href="/posts/2021/05/23/self-hosting-endgame/">a previous post</a>. It has been a couple of
months and the setup has mostly been fine. Sure, the power usage was pretty big under load, and yes, my internet did cut
out every time I turned the VM on with all the services starting, but other than that, it has been rock-solid.</p>
<p>However, I soon realized that in most situations, the 12 CPU cores is a bit overkill. Performance was fantastic, but due
to the case and the cooling solution that I&rsquo;m using, the fans did have to ramp up to cool the CPU down. Due to the
ongoing GPU drought driven by yet another cryptocurrency bubble, it also felt a bit wasteful to use an AMD RX 560 just
to drive two 1080p monitors.</p>
<p>It just so happened that around this time, AMD released the Ryzen 5000 G-series APU-s to retail. Yes, you could buy the
4000 series &ldquo;OEM-only&rdquo; APU-s from certain online retailers as well, but with this release, it&rsquo;s 100% official. The
release date rolled around, and the reviews were good. A day later, the CPU was also listed at a local reseller and was
actually in stock. After checking the street price for a used Ryzen 9 3900X and the Radeon RX 560, I decided to go for
it, as it would be very close to a free &ldquo;upgrade&rdquo;.</p>









<figure class="center">
  <a href="/posts/2021/08/07/amd-ryzen-7-5700-first-impressions/media/image1.jpg">
    <img src="/posts/2021/08/07/amd-ryzen-7-5700-first-impressions/media/image1_hu_e44d061a3baf7773.webp"
     width="600"
     height="800"
     loading="lazy"
     decoding="async"
     alt="CPU retail packaging. Holds the APU and a small CPU cooler as well.">

  </a>
  <figcaption class="center">CPU retail packaging. Holds the APU and a small CPU cooler as well.</figcaption>
</figure>

<h2 id="prep-work">
  <a class="heading-anchor" href="#prep-work">Prep work<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Before performing the purchase, I confirmed that the motherboard that I
use (<a href="https://www.gigabyte.com/Motherboard/B450-I-AORUS-PRO-WIFI-rev-10#kf">Gigabyte  B450 I AORUS PRO WIFI</a>) supports
this CPU after a BIOS upgrade. B450 chipset lives in a bit of a gray area where the CPU support is determined by the
motherboard manufacturer. No updates? No CPU support for you.</p>
<p>From my previous BIOS updating experiences, I remember that this particular motherboard had some buggy BIOS
implementations. I ran into two issues:</p>
<ul>
<li>PC would get stuck on POST if you reboot. It&rsquo;s annoying when making changes to UEFI settings, but with my use case
this is not that big of a deal.</li>
<li>If you remove a boot option, then it is impossible to get it back. Seriously, even a CMOS reset did not help with this
one.</li>
</ul>
<p>This time around, I decided to update the versions one by one to follow the happy path and not run into other types of
issues. The bug did resurface right after the first version that I tried, so that was a bit disappointing.</p>









<figure class="center">
  <a href="/posts/2021/08/07/amd-ryzen-7-5700-first-impressions/media/image2.jpg">
    <img src="/posts/2021/08/07/amd-ryzen-7-5700-first-impressions/media/image2_hu_e5575283135b3859.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="Now would be the perfect time for a surprise power outage or a cat intervention.">

  </a>
  <figcaption class="center">Now would be the perfect time for a surprise power outage or a cat intervention.</figcaption>
</figure>

<p>Once I was all up-to-date, I carefully removed the old CPU and plugged in the new one.</p>









<figure class="center">
  <a href="/posts/2021/08/07/amd-ryzen-7-5700-first-impressions/media/image3.jpg">
    <img src="/posts/2021/08/07/amd-ryzen-7-5700-first-impressions/media/image3_hu_b1b288149193258a.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="There&#39;s something very satisfying and beautiful about computer hardware. Just look at it!">

  </a>
  <figcaption class="center">There&#39;s something very satisfying and beautiful about computer hardware. Just look at it!</figcaption>
</figure>

<h2 id="hold-on-why-would-you-intentionally-downgrade-your-cpu">
  <a class="heading-anchor" href="#hold-on-why-would-you-intentionally-downgrade-your-cpu">Hold on, why would you intentionally downgrade your CPU?<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>It all came down to <em>&ldquo;use the right tool for the job&rdquo;</em>. The Ryzen 9 3900X is a good CPU, no doubts about that, but
during my work, I kept an eye on my CPU usage quite often and found that even in the worst-case scenarios, such as
IntelliJ IDEA performing indexing, I wasn&rsquo;t using the CPU to the full extent. It&rsquo;s great for those scenarios, but I
wasn&rsquo;t hitting them as often as I would have thought.</p>
<p>It also did not help that the CPU did not have an integrated GPU. When all you have to run is a basic desktop setup with
60Hz 1080p monitors, having a dedicated GPU to run them sounds so wasteful. This increased the power use of the whole
setup and the GPU could be utilized better elsewhere.</p>
<p>The Ryzen 7 5700G is a downgrade in multi-core performance, mainly due to 4 fewer cores and only 25% of the L3 cache,
but according to various reviews and benchmarks, you could actually expect a small single-core performance uplift.
Nothing groundbreaking, but good enough for my use case.</p>
<h2 id="power-usage">
  <a class="heading-anchor" href="#power-usage">Power usage<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Because I don&rsquo;t change my CPU-s too often, I thought I&rsquo;d take the time to run some benchmarks and measure the power
usage of the whole setup. This includes everything: the PC (with two spinning hard drives), standing desk, two 1080p
monitors and peripherals.</p>
<p>Please note that these benchmarks are not very scientific and are simply my observations of the change you can expect
when performing a switch like this on your own setup. I did my best to make sure that the running conditions are as
close as possible by stopping the service VM, waiting until the background CPU usage was normal, running the memory at
the same spec etc.</p>
<h3 id="amd-ryzen-9-3900x--radeon-rx-560">
  <a class="heading-anchor" href="#amd-ryzen-9-3900x--radeon-rx-560">AMD Ryzen 9 3900X + Radeon RX 560<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h3>
<ul>
<li>Idle, sitting on desktop: ~139W</li>
<li>Full synthetic CPU load using <code>stress</code>: ~253W</li>
</ul>
<h3 id="amd-ryzen-7-5700g--integrated-vega-8-gpu">
  <a class="heading-anchor" href="#amd-ryzen-7-5700g--integrated-vega-8-gpu">AMD Ryzen 7 5700G + integrated Vega 8 GPU<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h3>
<ul>
<li>Idle, sitting on desktop: ~99W (generally between 85-100W)</li>
<li>Full synthetic CPU load using <code>stress</code>: ~166W</li>
</ul>
<p>As expected, the change of the CPU and removal of the dedicated GPU results in a big drop when it comes to the power
usage of the whole workstation setup. To go even lower, I&rsquo;d have to switch out the core of the PC to something like
the <a href="https://www.asrock.com/nettop/AMD/DeskMini%20X300%20Series/">ASRock Deskmini X300</a> and replace the hard drives with
two big SSD-s. I&rsquo;d go for that as soon as bulk SSD storage became a viable option. Unfortunately, this is not the case,
yet.</p>
<h2 id="performance">
  <a class="heading-anchor" href="#performance">Performance<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Reputable review sites, such
as <a href="https://www.anandtech.com/show/16824/amd-ryzen-7-5700g-and-ryzen-5-5600g-apu-review">AnandTech</a>, have already done a
lot of benchmarks with better testing methodologies, so I instead went ahead and tested out something that I do quite
often at work: running tests in poorly written Java projects!</p>
<p>For this, I have two Java projects that have their own test suites. Project A has 900 or so tests, which are mainly
parallel in nature. Project B has 2000+ tests, where a good number of them are dependent on a single thread to do all
the work.</p>
<p>To run the tests, I just call the &ldquo;Run all tests&rdquo; function in IntelliJ and let it do the work of running the tests and
measuring the elapsed time. And as mentioned before: this is not scientific, there are probably some errors in here, but
the actions performed here are in my opinion a pretty good reflection of day-to-day work, and that&rsquo;s what matters the
most to me. Tests were run twice with a short break between the test runs to let the CPU cool down a bit.</p>
<h3 id="project-a-amd-ryzen-9-3900x">
  <a class="heading-anchor" href="#project-a-amd-ryzen-9-3900x">Project A: AMD Ryzen 9 3900X<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h3>
<p>Test run 1: 10.396s.</p>
<p>Test run 2: 10.494s.</p>
<h3 id="project-a-amd-ryzen-7-5700g">
  <a class="heading-anchor" href="#project-a-amd-ryzen-7-5700g">Project A: AMD Ryzen 7 5700G<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h3>
<p>Test run 1: 15.561s.</p>
<p>Test run 2: 15.690s.</p>









<figure class="center">
  <a href="/posts/2021/08/07/amd-ryzen-7-5700-first-impressions/media/image4.png">
    <img src="/posts/2021/08/07/amd-ryzen-7-5700-first-impressions/media/image4_hu_df8ef1bdccee37b.webp"
     width="952"
     height="407"
     loading="lazy"
     decoding="async"
     alt="CPU usage on the Ryzen 9 3900X during the test run.">

  </a>
  <figcaption class="center">CPU usage on the Ryzen 9 3900X during the test run.</figcaption>
</figure>

<h3 id="project-b-amd-ryzen-9-3900x">
  <a class="heading-anchor" href="#project-b-amd-ryzen-9-3900x">Project B: AMD Ryzen 9 3900X<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h3>
<p>Test run 1: 364s.</p>
<p>Test run 2: 365s.</p>
<h3 id="project-b-amd-ryzen-7-5700g">
  <a class="heading-anchor" href="#project-b-amd-ryzen-7-5700g">Project B: AMD Ryzen 7 5700G<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h3>
<p>Test run 1: 471s.</p>
<p>Test run 2: 480s.</p>
<p>The performance hit was somewhat expected for project A due to the parallel nature of the tests. However, for project B
I expected better results than that due to the alleged improvements in single-thread CPU performance.</p>
<h2 id="the-linux-experience">
  <a class="heading-anchor" href="#the-linux-experience">The Linux experience<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I expected the APU to work as expected, with perhaps some small issues popping up here and there. I&rsquo;m currently running
Fedora 34 with all the latest updates installed and the kernel version at 5.13.6, which should be the best option when
trying to get new hardware working on Linux.</p>
<p>The CPU portion of the APU is working relatively well for a CPU that was released just a couple of days ago. I have
noticed that for some reason this CPU is constantly clocked at around 4.2GHz on all cores at all times, even if there
isn&rsquo;t too much going on in the system. <code>sensors</code>, the program I use to monitor system temperatures, is also having a
small hiccup, as I cannot see the CPU temperatures at all, only the integrated GPU temperatures show up even after
running <code>sensors-detect</code>.</p>
<pre tabindex="0"><code>nvme-pci-0900
Adapter: PCI adapter
Composite:    +47.9°C  (low  = -40.1°C, high = +89.8°C)
                       (crit = +93.8°C)
Sensor 2:     +47.9°C  (low  = -40.1°C, high = +89.8°C)

iwlwifi_1-virtual-0
Adapter: Virtual device
temp1:        +48.0°C  

amdgpu-pci-0a00
Adapter: PCI adapter
vddgfx:        1.36 V  
vddnb:       999.00 mV 
edge:         +51.0°C  
power1:        6.00 mW 
</code></pre><p>The GPU seems to be a bit rough around the corners. I&rsquo;m using the <a href="https://www.gnome.org/">GNOME desktop environment</a>,
which means that I&rsquo;ve learned to endure laggy user interfaces. I default to using Wayland, but I sometimes also use Xorg
for those situations where the application I&rsquo;m trying to run does not work properly under Wayland (looking at you, Slack
and your screen sharing functionality&hellip;).</p>
<p>The integrated Vega 8 graphics are almost as fast as the dedicated RX 560 GPU under normal light desktop workloads. Once
you run something very heavy, like Furmark, the GPU performance tanks and the desktop becomes almost unusable. This is
not the case when running some
<a href="https://webglsamples.org/">WebGL workloads</a> though, so it could be an isolated case.</p>
<p>The most serious issue I&rsquo;ve managed to find is that Firefox has some issues with this GPU once you put enough load on
the GPU. You may start to notice flickering and UI elements blinking when moving around. A good test case for this is to
run <a href="https://www.netdata.cloud/">Netdata</a> in live mode and have a 1080p Youtube video in another window. I haven&rsquo;t seen
anything like that since running
the <a href="https://www.pny.eu/en/consumer/explore-all-products/graphics-cards/1294-geforce-gt-710-2gb-ddr3-single-fan">Nvidia GT 710</a>
with Nouveau drivers under Fedora 34. At least it does not crash the browser or the Wayland session, so it&rsquo;s not a
complete disaster. Still, pretty annoying, so I hope this gets resolved eventually. If I had to guess: the issue is
probably related to the Webrender implementation that makes use of the GPU to speed up the browsing experience.</p>
<h2 id="closing-thoughts">
  <a class="heading-anchor" href="#closing-thoughts">Closing thoughts<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Overall, I&rsquo;m happy that the APU actually works. I&rsquo;ve had a couple of bad experiences in the past where the Ryzen 3 2200G
had stability issues and had to be replaced, so this experience is already a step up from that. The PC runs cooler and
quieter, the desktop experience is good enough for me and the CPU performance is acceptable.</p>
<p>I&rsquo;m sure that the issues that I&rsquo;ve had with this APU under Linux will be fixed eventually. Each kernel update usually
brings lots of improvements to new hardware and I&rsquo;m sure that this APU is no exception.</p>
<p>As for the BIOS issues, I&rsquo;m happy that AMD and Gigabyte opted to support the B450 chipset well into 2021, but I&rsquo;m sure
that this choice has come at the cost of QA. If I had to choose between buggy support and having to buy a new
motherboard for my new, shiny CPU, then I&rsquo;d still pick the first one.</p>
<h2 id="update-2021-08-18">
  <a class="heading-anchor" href="#update-2021-08-18">Update (2021-08-18)<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I&rsquo;ve had this CPU for a while now, and there have been a couple of kernel updates in the meantime. Here are my notes.</p>
<p>The idle power usage has recently been in between 65-70W for the whole setup. I&rsquo;ve measured the desktop itself to take up 38W of that.</p>
<p>Although my motherboard does not seem to expose the cTDP option or have <code>ECO mode</code> available, I still managed to limit my TDP to 45W
using <a href="https://www.reddit.com/r/Amd/comments/j3ro5j/eco_mode_setting_in_bios_on_gigabyte_b550i_aorus/g7dysoo/">this trick that /u/The-Stilt mentioned over at Reddit</a>:</p>
<pre tabindex="0"><code>The potential lack of the ECO-mode does not prevent you from using it, 
since it is nothing but a preset of PPT/TDC/EDC settings.

Eco-Mode (95W): PPT = 128W, TDC = 80A, EDC = 125A

Eco-Mode (65W): PPT = 88W, TDC = 60A, EDC = 90A

Eco-Mode (45W): PPT = 61W, TDC = 45A, EDC = 65A
</code></pre><p>This had a great effect on the full load of the system: 3.8GHz all-core while the whole setup consumed 113W.</p>









<figure class="center">
  <a href="/posts/2021/08/07/amd-ryzen-7-5700-first-impressions/media/image5.jpg">
    <img src="/posts/2021/08/07/amd-ryzen-7-5700-first-impressions/media/image5_hu_734652f1c723e4d1.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="Precision Boost Overdrive settings that should result in a nice efficiency win. Target = 45W.">

  </a>
  <figcaption class="center">Precision Boost Overdrive settings that should result in a nice efficiency win. Target = 45W.</figcaption>
</figure>

<h2 id="update-2021-08-20">
  <a class="heading-anchor" href="#update-2021-08-20">Update (2021-08-20)<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Quick update on the GPU situation: Firefox seems to be fine now, I could not get the flickering to occur again even under
worst case scenarios.</p>
<h2 id="notes-and-stuff">
  <a class="heading-anchor" href="#notes-and-stuff">Notes and stuff<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Here are the outputs for a couple of commands that I could think of.</p>
<h3 id="iommu-groups">
  <a class="heading-anchor" href="#iommu-groups">IOMMU groups<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h3>
<p>Script taken from <a href="https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#Setting_up_IOMMU">Arch wiki</a>.</p>
<pre tabindex="0"><code>shopt -s nullglob
for g in `find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V`; do
    echo &#34;IOMMU Group ${g##*/}:&#34;
    for d in $g/devices/*; do
        echo -e &#34;\t$(lspci -nns ${d##*/})&#34;
    done;
done;

IOMMU Group 0:
        00:01.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge [1022:1632]
IOMMU Group 1:
        00:02.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge [1022:1632]
IOMMU Group 2:
        00:02.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne PCIe GPP Bridge [1022:1634]
IOMMU Group 3:
        00:02.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne PCIe GPP Bridge [1022:1634]
IOMMU Group 4:
        00:08.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge [1022:1632]
        00:08.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Renoir Internal PCIe GPP Bridge to Bus [1022:1635]
        00:08.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Renoir Internal PCIe GPP Bridge to Bus [1022:1635]
        0a:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [1002:1638] (rev c8)
        0a:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Renoir Radeon High Definition Audio Controller [1002:1637]
        0a:00.2 Encryption controller [1080]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor [1022:15df]
        0a:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne USB 3.1 [1022:1639]
        0a:00.4 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne USB 3.1 [1022:1639]
        0a:00.6 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller [1022:15e3]
        0b:00.0 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 81)
        0b:00.1 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 81)
IOMMU Group 5:
        00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 51)
        00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge [1022:790e] (rev 51)
IOMMU Group 6:
        00:18.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:166a]
        00:18.1 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:166b]
        00:18.2 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:166c]
        00:18.3 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:166d]
        00:18.4 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:166e]
        00:18.5 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:166f]
        00:18.6 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1670]
        00:18.7 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1671]
IOMMU Group 7:
        01:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset USB 3.1 XHCI Controller [1022:43d5] (rev 01)
        01:00.1 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset SATA Controller [1022:43c8] (rev 01)
        01:00.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Bridge [1022:43c6] (rev 01)
        02:00.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Port [1022:43c7] (rev 01)
        02:01.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Port [1022:43c7] (rev 01)
        02:04.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Port [1022:43c7] (rev 01)
        02:05.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Port [1022:43c7] (rev 01)
        02:06.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Port [1022:43c7] (rev 01)
        02:07.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Port [1022:43c7] (rev 01)
        06:00.0 Network controller [0280]: Intel Corporation Wireless-AC 9260 [8086:2526] (rev 29)
        08:00.0 Ethernet controller [0200]: Intel Corporation I211 Gigabit Network Connection [8086:1539] (rev 03)
IOMMU Group 8:
        09:00.0 Non-Volatile memory controller [0108]: Kingston Technology Company, Inc. U-SNS8154P3 NVMe SSD [2646:5008] (rev 01)
</code></pre><pre tabindex="0"><code># lscpu
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   48 bits physical, 48 bits virtual
CPU(s):                          16
On-line CPU(s) list:             0-15
Thread(s) per core:              2
Core(s) per socket:              8
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       AuthenticAMD
CPU family:                      25
Model:                           80
Model name:                      AMD Ryzen 7 5700G with Radeon Graphics
Stepping:                        0
Frequency boost:                 enabled
CPU MHz:                         3800.000
CPU max MHz:                     4672,0698
CPU min MHz:                     1400,0000
BogoMIPS:                        7585.94
Virtualization:                  AMD-V
L1d cache:                       256 KiB
L1i cache:                       256 KiB
L2 cache:                        4 MiB
L3 cache:                        16 MiB
NUMA node0 CPU(s):               0-15
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Full AMD retpoline, IBPB conditional, IBRS_FW, STIBP always-on, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid ap
                                 erfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topo
                                 ext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni 
                                 xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists paus
                                 efilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm
</code></pre><pre tabindex="0"><code># lspci -nnk
00:00.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne Root Complex [1022:1630]
	Subsystem: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne Root Complex [1022:1630]
00:00.2 IOMMU [0806]: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne IOMMU [1022:1631]
	Subsystem: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne IOMMU [1022:1631]
00:01.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge [1022:1632]
00:02.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge [1022:1632]
00:02.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne PCIe GPP Bridge [1022:1634]
	Kernel driver in use: pcieport
00:02.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne PCIe GPP Bridge [1022:1634]
	Kernel driver in use: pcieport
00:08.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge [1022:1632]
00:08.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Renoir Internal PCIe GPP Bridge to Bus [1022:1635]
	Kernel driver in use: pcieport
00:08.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Renoir Internal PCIe GPP Bridge to Bus [1022:1635]
	Kernel driver in use: pcieport
00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 51)
	Subsystem: Gigabyte Technology Co., Ltd Device [1458:5001]
	Kernel modules: i2c_piix4, sp5100_tco
00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge [1022:790e] (rev 51)
	Subsystem: Gigabyte Technology Co., Ltd Device [1458:5001]
00:18.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:166a]
00:18.1 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:166b]
00:18.2 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:166c]
00:18.3 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:166d]
00:18.4 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:166e]
00:18.5 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:166f]
00:18.6 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1670]
00:18.7 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1671]
01:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset USB 3.1 XHCI Controller [1022:43d5] (rev 01)
	Subsystem: ASMedia Technology Inc. Device [1b21:1142]
	Kernel driver in use: xhci_hcd
01:00.1 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset SATA Controller [1022:43c8] (rev 01)
	Subsystem: ASMedia Technology Inc. Device [1b21:1062]
	Kernel driver in use: ahci
01:00.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Bridge [1022:43c6] (rev 01)
	Kernel driver in use: pcieport
02:00.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Port [1022:43c7] (rev 01)
	Kernel driver in use: pcieport
02:01.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Port [1022:43c7] (rev 01)
	Kernel driver in use: pcieport
02:04.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Port [1022:43c7] (rev 01)
	Kernel driver in use: pcieport
02:05.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Port [1022:43c7] (rev 01)
	Kernel driver in use: pcieport
02:06.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Port [1022:43c7] (rev 01)
	Kernel driver in use: pcieport
02:07.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Port [1022:43c7] (rev 01)
	Kernel driver in use: pcieport
06:00.0 Network controller [0280]: Intel Corporation Wireless-AC 9260 [8086:2526] (rev 29)
	Subsystem: Intel Corporation Device [8086:0014]
	Kernel driver in use: iwlwifi
	Kernel modules: iwlwifi
08:00.0 Ethernet controller [0200]: Intel Corporation I211 Gigabit Network Connection [8086:1539] (rev 03)
	Subsystem: Gigabyte Technology Co., Ltd Device [1458:e000]
	Kernel driver in use: igb
	Kernel modules: igb
09:00.0 Non-Volatile memory controller [0108]: Kingston Technology Company, Inc. U-SNS8154P3 NVMe SSD [2646:5008] (rev 01)
	Subsystem: Kingston Technology Company, Inc. U-SNS8154P3 NVMe SSD [2646:5008]
	Kernel driver in use: nvme
	Kernel modules: nvme
0a:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [1002:1638] (rev c8)
	Subsystem: Gigabyte Technology Co., Ltd Device [1458:d000]
	Kernel driver in use: amdgpu
	Kernel modules: amdgpu
0a:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Renoir Radeon High Definition Audio Controller [1002:1637]
	Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Renoir Radeon High Definition Audio Controller [1002:1637]
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel
0a:00.2 Encryption controller [1080]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor [1022:15df]
	Subsystem: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor [1022:15df]
	Kernel driver in use: ccp
	Kernel modules: ccp
0a:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne USB 3.1 [1022:1639]
	Subsystem: Gigabyte Technology Co., Ltd Device [1458:5007]
	Kernel driver in use: xhci_hcd
0a:00.4 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne USB 3.1 [1022:1639]
	Subsystem: Gigabyte Technology Co., Ltd Device [1458:5007]
	Kernel driver in use: xhci_hcd
0a:00.6 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller [1022:15e3]
	Subsystem: Gigabyte Technology Co., Ltd Device [1458:a0c3]
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel
0b:00.0 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 81)
	Subsystem: Gigabyte Technology Co., Ltd Device [1458:b002]
	Kernel driver in use: ahci
0b:00.1 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 81)
	Subsystem: Gigabyte Technology Co., Ltd Device [1458:b002]
	Kernel driver in use: ahci
</code></pre>]]></content:encoded></item><item><title>How to fix ZFS pool not importing at boot</title><link>https://ounapuu.ee/posts/2021/02/01/how-to-fix-zfs-pool-not-importing-at-boot/</link><pubDate>Mon, 01 Feb 2021 08:45:27 +0200</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2021/02/01/how-to-fix-zfs-pool-not-importing-at-boot/</guid><description>You have probably tried Stack Exchange and reddit at this point, so what do you have to lose?</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/media/cover_hu_4fe4cf2661554252.jpg" width="1200" height="630" alt="How to fix ZFS pool not importing at boot" /><h2 id="issue-description">
  <a class="heading-anchor" href="#issue-description">Issue description<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>You are running a Linux-based machine with an install of ZFS on Linux. Everything seems to work correctly, but
after restarting your machine, the ZFS pool is not visible. You can still import your pool manually using
<code>zpool import poolname</code> or <code>zpool import -a</code>.</p>
<p>In my situation, this issue does not occur with Debian 10 on an x86-based machine, but it does occur on a Raspberry Pi 4
running Ubuntu Server 20.04.1 LTS.</p>
<p>Setup:</p>
<ul>
<li>Raspberry Pi 4 (4GB)</li>
<li>Ubuntu Server 20.04.1</li>
<li>32GB microSD card for root filesystem</li>
<li>2x 8TB WD Elements external USB 3.0 drives (ZFS mirror)</li>
</ul>
<h2 id="potential-causes-and-solutions">
  <a class="heading-anchor" href="#potential-causes-and-solutions">Potential causes and solutions<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>When looking this issue up, there were many potential causes and solutions provided:</p>
<ul>
<li><a href="https://unix.stackexchange.com/a/338522">ensure that all ZFS related services are enabled</a></li>
<li><a href="https://serverfault.com/a/915191">add a startup delay in ZFS related configuration files</a></li>
<li><a href="https://serverfault.com/a/915191">just import the pools (duh)</a></li>
<li><a href="https://www.reddit.com/r/zfs/comments/9j714p/ubuntu_1804_zpool_mount_on_boot_does_not_work/e6p6zu0/">recreate the ZFS cache file</a></li>
</ul>
<p>In my specific scenario, none of these seemed to do the trick.</p>
<h2 id="investigation">
  <a class="heading-anchor" href="#investigation">Investigation<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>The ZFS pools should be automatically imported on boot by a service named <code>zfs-import-cache.service</code>. The cache file
should contain information about the imported pools.</p>
<p>Once you have started your system and don&rsquo;t see any ZFS pools available, try running <code>systemctl status zfs-import-cache.service</code>
or <code>journalctl -u zfs-import-cache.service</code>. This should show you if the automatic import succeeded or not.</p>









<figure class="center">
  <a href="/posts/2021/02/01/how-to-fix-zfs-pool-not-importing-at-boot/media/zpool-import-fail.png">
    <img src="/posts/2021/02/01/how-to-fix-zfs-pool-not-importing-at-boot/media/zpool-import-fail_hu_b0e51bb16973b5be.webp"
     width="963"
     height="285"
     loading="lazy"
     decoding="async"
     alt="In my case, the failure shows up like this.">

  </a>
  <figcaption class="center">In my case, the failure shows up like this.</figcaption>
</figure>

<p>The pool <code>tanker</code> is a ZFS mirror that is supported by two 8TB WD Elements external hard drives. They are big, loud and
require some time to spin up the platters before you can actually read data off of them. At this point in the investigation,
a good friend recommended that I check what disks were recognized by the system at the time when this import service was
starting up.</p>
<p>For that, you need to modify the systemd service by running <code>systemctl edit zfs-import-cache.service</code> and put these contents
in there:</p>
<pre tabindex="0"><code>[Service]
ExecStartPre=/usr/bin/lsblk
</code></pre><p>This addition will run the <code>lsblk</code> command before the command specified in the systemd service is actually executed.
The output of this command will be visible in the service logs. After making this addition, reboot your system and run
<code>journalctl -u zfs-import-cache.service</code> again. You should be able to see all the connected drives on the system.</p>
<p>In my case, the system recognized the microSD card and an SSD that was connected over USB, but not the hard drives. This
was a very clear indication that the system was not waiting until the drives had spun up before attempting to import the
ZFS pool.</p>
<h2 id="hacky-solution">
  <a class="heading-anchor" href="#hacky-solution">Hacky solution<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>To resolve this issue quickly and move on with more interesting things, you can use the same trick that we used for
troubleshooting this issue, but instead of listing the connected hard drives, we can make the systemd service delay its
execution by putting a <code>sleep</code> statement in there.</p>
<p>Edit the systemd service again with <code>systemctl edit zfs-import-cache.service</code> and replace the contents with this:</p>
<pre tabindex="0"><code>[Service]
ExecStartPre=/usr/bin/sleep 15
</code></pre><p>This will make the service sleep for 15 seconds before importing the ZFS pool(s). It could be 10, or 30, or whatever value
works for you, 15 seconds was chosen here because it is more than enough time for the disks to spin up.</p>
<h2 id="proper-solution-probably">
  <a class="heading-anchor" href="#proper-solution-probably">Proper solution (probably)<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>There are probably better solutions, such as messing around with udev rules or enforcing the delay somewhere else in the
ZFS pool import chain of operations, but I have not investigated them at this point. Feel free to contact me with a better
solution, and I will update the post accordingly.</p>
]]></content:encoded></item><item><title>How I fixed one hardware issue with another one</title><link>https://ounapuu.ee/posts/2020/08/11/how-i-fixed-one-hardware-issue-with-another-one/</link><pubDate>Tue, 11 Aug 2020 19:08:14 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2020/08/11/how-i-fixed-one-hardware-issue-with-another-one/</guid><description>Two issues make a solution after all.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/media/cover_hu_4fe4cf2661554252.jpg" width="1200" height="630" alt="How I fixed one hardware issue with another one" /><p>I happen to run on an <a href="https://www.asrock.com/mb/AMD/Fatal1ty%20B450%20Gaming-ITXac/">ASRock Fatal1ty B450 Gaming-ITX/ac</a>
motherboard that used to run fine, but ever since I installed one UEFI update, it has had this one annoying issue:
whenever you reboot, it gets stuck at POST. Cold boots work fine and the <em>shutdown-and-push-the-power-button</em> cycle also
does the trick, but it&rsquo;s not something I want to do all the time, especially when the machine is out of reach.</p>
<p>Before you say it: no, warranty service was not an option here, especially since this motherboard has suffered a fall once
and it has this slight curvature in it. No, this separate incident was <em>after</em> this freezing issue started occurring.</p>
<h2 id="initial-troubleshooting">
  <a class="heading-anchor" href="#initial-troubleshooting">Initial troubleshooting<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I went through most of the standard hardware troubleshooting procedures:</p>
<ul>
<li>clear CMOS</li>
<li>re-seat RAM</li>
<li>try a different CPU</li>
<li>disable features in UEFI, reduce PCIe speeds</li>
<li>disconnect storage devices</li>
</ul>
<p>No luck, issue was still there. The POST code was stuck at <code>A0</code>. When taking a look at the <a href="https://www.asrock.com/support/faq.asp?id=334">ASRock Dr. Debug POST codes
list</a>, I saw that <code>A0</code> falls under</p>
<blockquote>
<p>Problem related to IDE or SATA devices. Please re-install IDE and SATA devices.
If the problem still exists, please clear CMOS and try removing all SATA devices.</p>
</blockquote>
<p>Since I had just done that procedure, and the issue was still there, I was stumped.</p>
<h2 id="wake-on-lan">
  <a class="heading-anchor" href="#wake-on-lan">Wake-on-LAN<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>I had tried wake-on-LAN many years ago and was successful with it, so I thought that perhaps this could be an option.
After all, I really did not want to get a new motherboard if I could just work around this issue.</p>
<p>I checked the ASRock UEFI for various wake-on-LAN related settings and found a couple of them. Oddly enough, the <code>Wake on LAN</code>
setting itself only became available after I enabled booting from LAN in a completely unrelated UEFI section. In addition
to the <code>Wake on LAN</code> setting, I also made sure to enable waking up from PS2 and PCIe devices, just in case.</p>
<p>After a quick Google search I found <a href="https://wiki.archlinux.org/index.php/Wake-on-LAN">the Arch Linux Wiki page</a> on this
topic and saw that I needed to make sure that my network adapter was configured properly for wake-on-LAN to work.</p>
<pre tabindex="0"><code>[root@my-machine]# ethtool enp9s0 | grep Wake-on
	Supports Wake-on: pumbg
	Wake-on: g
</code></pre><p>Super, everything should work then!</p>
<p>I set up an always-on machine to send the wake-on-lan magic packets using <code>wol</code> every minute so that the machine
eventually wakes up again. It&rsquo;s configured, I shut down the problematic machine and wait.</p>
<p>Nothing happens.</p>
<p>Huh, perhaps I missed something.</p>
<p>No, everything was configured properly and the magic packet setting <code>g</code> was on by default.</p>
<p>I checked the wiki page again and two things caught my eye:</p>
<blockquote>
<p>Note: Setting one of u, m or b along with g might also be necessary to enable the feature.</p>
</blockquote>
<blockquote>
<p>It is known that some motherboards are affected by a bug that can cause immediate or random wake-up after a shutdown
whenever the BIOS WoL feature is enabled</p>
</blockquote>
<p>Well, that&rsquo;s interesting.</p>
<p>I added <code>* * * * * ethtool -s enp9s0 wol pumbg</code> to my crontab and shut my machine down.</p>
<p>Power supply does a click. Silence. Another click, ethernet port LED-s light up and my machine is powered on again. <strong>Success!</strong></p>
<p>As it turns out, I did not even need to enable sending wake-on-LAN magic packets from another machine, the two motherboard
issues managed to cancel each other out.</p>
]]></content:encoded></item><item><title>The little Wi-Fi AP that could</title><link>https://ounapuu.ee/posts/2020/07/23/the-little-wifi-ap-that-could/</link><pubDate>Thu, 23 Jul 2020 01:17:30 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2020/07/23/the-little-wifi-ap-that-could/</guid><description>Depends on your definition of _could_.</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/media/cover_hu_4fe4cf2661554252.jpg" width="1200" height="630" alt="The little Wi-Fi AP that could" /><p>I have a bad habit of testing things whenever a &ldquo;good&rdquo; idea pops into my head. This is a short overview of one of them.</p>
<p>The <a href="http://linux-sunxi.org/Xunlong_Orange_Pi_Zero">Orange Pi Zero</a> is a SBC (single board computer) that has a slow 32-bit ARM 4 core CPU, 512MB of RAM and no display output.
It&rsquo;s actually quite OK for many tasks, such as reverse proxy (assuming 100Mbit/s is enough for you), low-performance
NAS (assuming you are fine with 10-12MB/s file transfer speeds) or a Syncthing relay. Oh, and you can also turn it into
a Wi-Fi access point.</p>









<figure class="center">
  <a href="/posts/2020/07/23/the-little-wifi-ap-that-could/media/wifi-ap.jpg">
    <img src="/posts/2020/07/23/the-little-wifi-ap-that-could/media/wifi-ap_hu_b66fbeeb649becd7.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="The Wi-Fi access point in its natural habitat.">

  </a>
  <figcaption class="center">The Wi-Fi access point in its natural habitat.</figcaption>
</figure>

<h2 id="why">
  <a class="heading-anchor" href="#why">Why?<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Because <a href="https://www.armbian.com/">Armbian</a> made it really easy to test out and I was interested in seeing what kind of
performance an old USB Wi-Fi dongle could offer. This cheap AP could also come into handy in situations where my main
access point dies for some reason.</p>
<h2 id="how">
  <a class="heading-anchor" href="#how">How?<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Go to the <a href="https://www.armbian.com/orange-pi-zero/">Armbian device page for your SBC</a> and download the latest image, then
write it to your microSD card using the tool of your choice, start your SBC and finish the initial setup.</p>
<p>After all that is done, start <code>armbian-config</code> as root. This tool allows you to do many things over a terminal UI, including
a no-hassle method of setting up an Wi-Fi AP.</p>
<p>The option you are looking for is under <code>Network -&gt; Hotspot</code>.</p>









<figure class="center">
  <a href="/posts/2020/07/23/the-little-wifi-ap-that-could/media/armbian-config-1.png">
    <img src="/posts/2020/07/23/the-little-wifi-ap-that-could/media/armbian-config-1_hu_86a28d26c03eeca9.webp"
     width="710"
     height="403"
     loading="lazy"
     decoding="async"
     alt="This image will likely be way out of date in a couple of years.">

  </a>
  <figcaption class="center">This image will likely be way out of date in a couple of years.</figcaption>
</figure>

<p>Follow the on-screen instructions to set everything up. After the initial setup is done, make sure to navigate to the same
menu again to change the SSID and the Wi-Fi password because the defaults are horribly insecure.</p>
<p>After all this you should be good to go!</p>
<h2 id="issues-and-troubleshooting-tips">
  <a class="heading-anchor" href="#issues-and-troubleshooting-tips">Issues and troubleshooting tips<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>It would not be a proper project if something didn&rsquo;t go wrong in the process.</p>
<p>Before starting this configuration, run <code>ip a</code> to see if your Wi-Fi device is present. In my case the Orange Pi Zero also
has onboard Wi-Fi, but that particular one has poor support, so I use an USB Wi-Fi dongle instead.</p>
<p>If your Wi-Fi device is not showing up, make sure that the correct firmware is present. In my case I had to install
<code>firmware-atheros</code> package so that my <code>ath9k_htc</code> based Wi-Fi adapter would start working. <code>dmesg</code> and <code>lsusb -v</code> can help determine
what chip your Wi-Fi adapter is using and what driver it needs.</p>
<p>The Orange Pi Zero that I have could set everything up, but it would crash hard with the logs not really showing much.
After testing the USB Wi-Fi adapter in all the different USB ports with no success, I opted to use <code>armbian-config</code> menu <code>System -&gt; CPU</code>
to limit the CPU clock speed to 480MHz and set the CPU governor to <code>performance</code> to rule out power delivery issues that might be caused by
variations in CPU power usage. That seems to have done the trick, because after that change the Wi-Fi AP has been rock solid.</p>
<h2 id="testing-and-conclusions">
  <a class="heading-anchor" href="#testing-and-conclusions">Testing and conclusions<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>After setting it up and tweaking it a bit I started testing this thing out. The AP had no major issues
throughout the day and did not crash.</p>
<p>The performance, however, isn&rsquo;t anything to write home about. Speed maxes out at 30Mbit/s and is generally lower than that,
especially when more than one client is connected. You can do things like Steam Remote Play (stream your game over your home network),
but the quality will suffer. It was still quite fun to mess around in GTA V regardless of the image quality and during ~1h
of play time there were only 4-5 stutters that were caused by the network.</p>









<figure class="center">
  <a href="/posts/2020/07/23/the-little-wifi-ap-that-could/media/i-am-speed.png">
    <img src="/posts/2020/07/23/the-little-wifi-ap-that-could/media/i-am-speed_hu_a2e4f1e9419a97f.webp"
     width="223"
     height="185"
     loading="lazy"
     decoding="async"
     alt="I am speed.">

  </a>
  <figcaption class="center">I am speed.</figcaption>
</figure>

<p><strong>Would I use this as my main Wi-Fi access point?</strong></p>
<p>Definitely not. Any half-decent router will out-perform this setup.</p>
<p><strong>Can it still be useful?</strong></p>
<p>Definitely. A crappy Wi-Fi AP is better than no AP.</p>
<h2 id="parts-list">
  <a class="heading-anchor" href="#parts-list">Parts list<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<ul>
<li>Orange Pi Zero SBC (512MB RAM)</li>
<li>Orange Pi Zero expansion board (adds two USB 2.0 ports)</li>
<li>Cheap case for the Orange Pi Zero</li>
<li>32GB Sandisk microSD card</li>
<li>TP-Link WN-722N USB Wi-Fi adapter</li>
<li>Official Raspberry Pi microUSB power adapter</li>
</ul>
<h2 id="update-2020-08-22">
  <a class="heading-anchor" href="#update-2020-08-22">Update (2020-08-22)<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>It&rsquo;s still working and is happily serving as a <em>temporary</em> Wi-Fi access point.</p>
<p>During additional testing I could also hit 40 Mbps speeds when testing in an environment with
far fewer competing Wi-Fi access points nearby.</p>
<h2 id="update-2020-08-30">
  <a class="heading-anchor" href="#update-2020-08-30">Update (2020-08-30)<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>It&rsquo;s still running well and it seems that it won&rsquo;t be a simple temporary
solution after all.</p>
<h2 id="update-2020-11-30-approximately">
  <a class="heading-anchor" href="#update-2020-11-30-approximately">Update (2020-11-30, approximately)<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>This setup has now been retired. It had 0 issues throughout its lifespan as a Wi-Fi access point, but I replaced
it with a more standard Wi-Fi access point so that this board can be used somewhere else.</p>
<p>The setup did surprisingly well and even survived nightly automated updates and restarts, which can be attributed to the good
work that <a href="https://www.armbian.com/">the Armbian project</a> has done.</p>
]]></content:encoded></item></channel></rss>