Fixing a Broken /etc/hosts When systemd‑resolved Hides It

When systemd‑resolved hides /etc/hosts, how to get it back

You’ve edited /etc/hosts to add a local hostname for a home‑lab service, but after a reboot the entry disappears from the output of getent hosts. The system still resolves the name, but it comes from a different source. That’s because systemd‑resolved, the default DNS stack on most recent Linux distributions, now prefers its own cache and configuration over the traditional /etc/hosts file. The result is a silent break in the workflow many beginners rely on.

[Read More]

Why My Custom Systemd Timer Keeps Firing Twice and How to Fix It

I’ve seen this go wrong when the timer unit is enabled in two places or when Persistent=true is left on a daily job. The result is a backup that starts right after boot and then again at the scheduled hour. It’s annoying, but the fix is usually a few quick edits and a reload. Below is a practical walk‑through that keeps the technical detail but feels like a coffee‑chat with a seasoned sysadmin.

[Read More]

Keeping a Linux Laptop Connected to VPN

Handling router switches between DHCP and static IPs

Keep a VPN alive when the home router flips between DHCP and static

I’ve been on a laptop that plugs into a home router that sometimes hands out a DHCP lease and other times uses a static IP you set in the admin UI. The VPN client (OpenVPN 3‑CLI on Ubuntu 24.04) would drop the tunnel as soon as the interface lost its address, forcing me to reconnect manually. Below is a minimal, reproducible setup that keeps the tunnel up regardless of the router’s mode.

[Read More]

Testing Restic Incremental Backups on an Active MySQL Server Without Downtime

Running a production MySQL instance on a small home‑lab server is a common scenario for many of us. The database is the heart of the service, but it also means that any backup strategy must preserve consistency while keeping the application online. Restic is a popular, fast, deduplicating backup tool that works well with block‑level snapshots and remote backends. In this post I’ll walk through a practical, repeatable method to test incremental Restic backups against a live MySQL server, covering the trade‑offs, commands, and pitfalls you’ll encounter.

[Read More]

Fixing Two-Second DNS Lookups on a Raspberry Pi

Tuning resolvectl and the systemd-resolved cache

The 2‑second DNS lookup lag on a Pi – a hands‑on fix

I was running a Pi‑4‑based home‑lab that hosts a few services: a personal Git server, a small reverse‑proxy stack, and a few IoT sensors that ping the Pi every few seconds. Every time I pinged a domain that wasn’t in the local cache, I noticed a ~2 s pause before the first packet left the network interface. On a desktop that latency was negligible, but on the Pi it was a noticeable hiccup that made the sensor logs look a little jittery.

[Read More]

Diagnosing a 30‑second Nginx start‑up lag on an 8‑core ARM home‑server

The 30‑second Nginx start‑up mystery on an 8‑core ARM box

I had a clean 8‑core ARM server (Cortex‑A72, 4 GB RAM) running Debian 12. Nginx was the only service that took longer than a couple of seconds to come up. The log said “started” after 30 s, but the system was idle otherwise. I wanted to know why a stateless web server was so slow to boot on a modern CPU.

[Read More]

Keeping a Backup Script from Saturating the CPU

Using ps, nice, and ionice to keep the desktop responsive

Backups are the lifeblood of any homelab or small server. I usually run a nightly rsync job that copies hundreds of gigabytes from a production NFS share to a local Btrfs snapshot. On a 4‑core workstation the job is usually a quiet background task, but sometimes the process spikes to 100 % CPU and the terminal I use to monitor the job freezes. The culprit is often the default scheduling class and priority that rsync inherits from the shell.

[Read More]

Running My Home NAS Backups with `nice` and `ionice` So My Desktop Never Freezes

Running a nightly backup from a home NAS to a desktop is a common task, but the copy can still hog the machine’s resources and make the UI feel sluggish.
The trick is to let the backup run with low CPU and I/O priority so the desktop stays responsive. Two simple tools—nice and ionice—are all you need.

Why the problem matters

When a rsync or tar job copies gigabytes of data, the kernel’s scheduler keeps the process in the foreground class. Even if you’re not actively using the machine, the backup can consume CPU cycles and saturate the disk queue. On a laptop or a desktop with a single NVMe drive, this shows up as a frozen terminal, delayed window redraws, or a sluggish browser.

[Read More]

Cleaning a Home Server Cache with systemd

Triggering cleanup when disk usage hits 90 percent

When the disk is almost full

I’ve run a handful of home‑servers for years, and the first thing that usually trips you up is a suddenly full disk.
Caches from apt, Docker, Flatpak, and the like can balloon without you noticing.
A quick, automated cleanup that only kicks in when the root filesystem is >90 % used keeps the system sane without you having to remember to run a script every week.

[Read More]

Fixing the “root=UUID not found” error after cloning an SSD with Clonezilla

When Clonezilla says root=UUID not found

Cloning a bootable SSD with Clonezilla is usually painless, but the new machine can stall at the kernel prompt with:

root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx not found

The kernel can’t locate the root filesystem because the UUIDs in the boot configuration still point to the original disk. The fix is a handful of targeted edits and rebuilds.

1. Verify the new UUIDs

Boot from a live USB, open a terminal and list the block devices:

[Read More]