How to Keep a Linux Laptop Connected to a VPN When the 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 the 2‑second DNS lookup lag on my Pi by tweaking resolvectl and 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]

When a backup script keeps my CPU pegged: a quick ps, nice, ionice tweak to keep the terminal 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]

Using a systemd path unit to clean my home server’s cache when disk space hits 90%

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]

Rootless Podman Container Drops Its Persistent Volume After a Reboot: A Quick Fix for My HomeLab 🚀

Running containers without root is a lifesaver, but I hit a snag the other night. I had a small database container that wrote data to a named volume, and the next time I rebooted my machine the data was gone. Turns out the volume directory was being created under a transient mount that didn’t survive shutdown.

Why the Volume Vanishes

In rootless mode Podman keeps everything under ~/.local/share/containers/storage. When you do podman volume create, it records the mount point in a JSON file there. On reboot the user‑session systemd instance that owns the rootless runtime comes back up, but systemd doesn’t automatically remount the user‑created volumes unless you tell it to. The result? The container starts, and the volume looks like a fresh empty directory.

[Read More]

systemd‑resolved’s DNS Cache Stale After a Router Update: My One‑Command Fix

I was staring at a blinking screen of a freshly flashed router when I realized the whole LAN had lost its DNS mojo. I could ping 192.168.1.1 fine, but curl example.com slammed back with “Could not resolve host”. No amount of dig or nslookup helped until I dug into systemd‑resolved.

Why systemd‑resolved Holds on to Old DNS

systemd‑resolved is the default resolver on most recent distros. It keeps a cache of answers to cut down on DNS traffic and speed things up. The cache is keyed by the DNS server that answered and the TTL that server advertised. When a router’s firmware changes, its DHCP server may hand out a new DNS IP or a new list of servers. systemd‑resolved will keep the old server in memory until it gets a fresh lease or the cache expires. If the new server is unreachable, all lookups die.

[Read More]