Using dmsetup to Salvage Disks with Bad Blocks

Introduction I have a disk with bad blocks. The filesystem I’m using (such as ZFS) doesn’t support marking bad blocks like ext did, and completely replacing the disk is costly and unnecessary. Instead, I’ve used dmsetup to create a virtual disk that excludes the bad sectors, allowing the filesystem to work with the remaining good areas. This guide covers the process of scanning the disk, preparing a custom partition, setting up dmsetup, and ensuring everything works across reboots. I’ve additionally included steps to ensure that the dmsetup configuration follows the disk, ensuring you don’t loose that critical piece of information. ...

April 7, 2025 · 9 min · Michael Bisbjerg

Lets Encrypt organized for reverse nginx proxy

This is a short post on using Let’s Encrypt to get TLS certificates for NGINX virtual hosts. The setup assumes: Ubuntu NGINX hosting multiple domains A scheduler (e.g., cron or Rundeck) Let’s Encrypt Let’s Encrypt offers free domain-validated (DV) certificates for HTTPS and other secure services. letsencrypt.org GitHub Initial Setup I run multiple web services on VMs behind a single public IP. My NGINX proxy manages SSL termination and routing using virtual host configs. ...

July 7, 2016 · 2 min · Michael Bisbjerg