<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Toadie</title>
    <description>The latest articles on DEV Community by Toadie (@mrtoadie).</description>
    <link>https://dev.to/mrtoadie</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4259334%2F60fdfe3e-2dd3-46fb-9136-53557c494ed1.jpg</url>
      <title>DEV Community: Toadie</title>
      <link>https://dev.to/mrtoadie</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mrtoadie"/>
    <language>en</language>
    <item>
      <title>I moved etcd off my SD card before it could kill my cluster</title>
      <dc:creator>Toadie</dc:creator>
      <pubDate>Thu, 26 Nov 2026 22:01:57 +0000</pubDate>
      <link>https://dev.to/mrtoadie/i-moved-etcd-off-my-sd-card-before-it-could-kill-my-cluster-fi4</link>
      <guid>https://dev.to/mrtoadie/i-moved-etcd-off-my-sd-card-before-it-could-kill-my-cluster-fi4</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Why my k3s control-plane stopped trusting its boot media — a preventive migration of etcd from SD card to USB SSD on a Raspberry Pi cluster.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There was no outage. No corrupted database, no failed quorum, no 3 a.m. incident. Just a nagging thought while watching my Prometheus dashboards fill up with data I had no idea was being written where: &lt;em&gt;my entire cluster state lives on the same SD card that boots my Raspberry Pi.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;SD cards are built for reading. etcd is built for writing. Prometheus made sure there was plenty of writing going on. That combination doesn't fail maybe — it fails eventually. So before it did, I moved the whole thing onto a USB SSD.&lt;/p&gt;

&lt;p&gt;This is what I found, what I did, and what I'd do differently.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;My homelab is a small k3s cluster built from four Raspberry Pis. One of them, &lt;code&gt;winterfell&lt;/code&gt;, is the control-plane node — which means it runs the Kubernetes API server and, more importantly for this story, &lt;strong&gt;etcd&lt;/strong&gt;: the database that holds the entire cluster state. Every deployment, secret, config map, node registration — everything lives in etcd, on winterfell, on its boot SD card.&lt;/p&gt;

&lt;p&gt;Because that's how the node was originally set up. It worked. Nothing about it &lt;em&gt;felt&lt;/em&gt; wrong. Which, as it turns out, is exactly the problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I acted before anything broke
&lt;/h2&gt;

&lt;p&gt;I want to be honest about this: there were no symptoms. This was a preventive move, motivated by two things I couldn't stop thinking about.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First: the failure mode was a matter of &lt;em&gt;when&lt;/em&gt;, not &lt;em&gt;if&lt;/em&gt;.&lt;/strong&gt; Consumer SD cards are engineered for read-heavy workloads — an OS boots from it, reads a few files, updates occasionally. etcd is the opposite beast: continuous small writes, WAL (write-ahead log) files, fsync calls, compaction traffic around the clock. Sustained write load is precisely what consumer flash degrades under, and a worn-out SD card doesn't corrupt gracefully. It doesn't lose some files. It takes the whole filesystem down — and with it, the only copy of my cluster state. Quorum lived on that one disk.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Second: I couldn't quantify the write load.&lt;/strong&gt; I knew Prometheus was scraping metrics every few seconds. I knew other services were writing state constantly. But I had no idea how many megabytes per hour were hitting that card — and that ignorance was itself the argument. When you can't estimate how hard a component is hammering your storage medium, assuming the worst is the only sane engineering decision.&lt;/p&gt;

&lt;p&gt;So the question shifted from "will this fail?" to "why am I waiting for it?".&lt;/p&gt;

&lt;h2&gt;
  
  
  The migration
&lt;/h2&gt;

&lt;p&gt;The plan had one hard constraint: this is a single control-plane node. When k3s stops on winterfell, the cluster has no API server, no quorum, no scheduling. I accepted that maintenance window consciously — everything would be down for the duration, and that was fine for a homelab.&lt;/p&gt;

&lt;p&gt;Here's what I did:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Stop k3s on winterfell.&lt;/strong&gt; No writers, no half-open files, a consistent copy. rsyncing a running etcd would have produced a corrupt backup of healthy data — the stop is not optional.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. rsync the entire data directory&lt;/strong&gt; (&lt;code&gt;/var/lib/rancher/k3s&lt;/code&gt;) from the SD card to the USB SSD, with archive mode to preserve ownership, permissions and timestamps. One copy, one source of truth.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Mount the XFS-formatted SSD at the original path&lt;/strong&gt; via &lt;code&gt;/etc/fstab&lt;/code&gt; — the same &lt;code&gt;/var/lib/rancher/k3s&lt;/code&gt; location. This is the elegant part: because the mount point matches the original path, k3s needed zero configuration changes. It has no idea its data moved houses.&lt;/p&gt;

&lt;p&gt;Why XFS? It's a journaling filesystem that handles many small writes and large directories well — exactly the workload etcd produces. It's also the filesystem I'd recommend to anyone doing this: ext4 would work, but XFS is the common choice for etcd-heavy nodes for a reason.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Verify before destroying anything.&lt;/strong&gt; Cluster restarted, all nodes rejoined, etcd quorum confirmed, workloads scheduling normally. Only &lt;em&gt;then&lt;/em&gt; did I wipe the old copy from the SD card. The old data is your last parachute until the new location has proven itself through a full boot cycle.&lt;/p&gt;

&lt;p&gt;From that day on, the division of labor is clean: &lt;strong&gt;the SD card boots the OS and does almost nothing else. The SSD carries the data.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Storage decisions for cluster state are not infrastructure trivia — they are a bet on how the storage medium fails.&lt;/strong&gt; etcd is the last place you want a medium that wears out silently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Not knowing the write load was itself the signal to act.&lt;/strong&gt; I didn't need measurements to justify the migration; the absence of measurements was the justification. Decisions under uncertainty are still decisions — and documenting why you made them beats pretending you had data you didn't.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Separating OS and data paid off later, in ways I didn't predict.&lt;/strong&gt; Reimaging a node now means pulling the SD card, flashing it, slotting it back in — without touching the cluster state. What started as a data-integrity move quietly became an operability upgrade. If I had to do it again, I'd separate them from day one, on every node.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Did performance improve? Honestly: not measurably.&lt;/strong&gt; Things feel snappier, but I didn't benchmark before and after, so I won't claim numbers I don't have. The real win was never speed — it was knowing that a Tuesday-night flash wear-out can no longer erase my cluster.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;Now that the cluster state lives on a medium that can keep up with it, the write-heavy services have room to breathe — which is convenient, because Prometheus turned out to be hungry in other ways too (its memory appetite, to be exact). That's a story for another post.&lt;/p&gt;

&lt;p&gt;If you want to see what the cluster looks like when it's healthy: I document my homelab — dashboards, incident log and all — at &lt;a href="https://mrtoadie.github.io" rel="noopener noreferrer"&gt;mrtoadie.github.io&lt;/a&gt;, and the tooling I built to audit it is on &lt;a href="https://github.com/mrtoadie" rel="noopener noreferrer"&gt;my GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks for reading — and if your cluster state currently lives on the same SD card that boots your Pi: you already know what to do.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>raspberrypi</category>
      <category>devops</category>
      <category>homelab</category>
    </item>
  </channel>
</rss>
