Skip to content
sgt.hootr.club·

💻Home Server Rebuild Minimizes SD Card Writes

How to extend your microSD card's lifespan by reducing writes

TL;DR

A home server owner rebuilt their setup to reduce microSD write cycles, using zram for swap and a btrfs pool with raid1 replication. Key goals: data redundancy and reduced SD card wear.

The author of this rebuild faced issues installing Linux on NixOS due to an aging microSD card used in a Raspberry Pi 4B. The card had been running almost non-stop for years, leading to unexpected failures during the installation process. To prevent future issues, they set out to minimize writes to the microSD card and ensure data redundancy. Key steps included enabling zram swap but not /tmp, configuring journald logs in memory, disabling atime on the SD card, and using two old HDDs for a btrfs raid1 pool named ポンコツ (piece of junk). This setup ensures important data is backed up while extending microSD lifespan.

Key Points

1

MicroSD card used for booting had been running non-stop for almost 24/7 over years before failing during Linux installation.

2

Two old 2.5" HDDs were repurposed to create a btrfs pool with raid1 replication, named ポンコツ (piece of junk) for redundancy and stability.

3

Journald logs configured to store in memory rather than on disk to reduce unnecessary writes to the microSD card.

4

Atime was disabled on the microSD card to prevent additional writes from file access times.

5

Autosubvol module created for declarative subvolume management, generating systemd units for each disk and subvolume.

Why It Matters

If you're running a home server with a Raspberry Pi using an aging microSD card, this rebuild is crucial. It shows how to extend SD card life by minimizing writes while ensuring data redundancy through btrfs raid1 replication.

raspberry-pibtrfszrammicrosd-wear

Frequently Asked Questions

Why does this matter?

If you're running a home server with a Raspberry Pi using an aging microSD card, this rebuild is crucial. It shows how to extend SD card life by minimizing writes while ensuring data redundancy through btrfs raid1 replication.

What happened?

A home server owner rebuilt their setup to reduce microSD write cycles, using zram for swap and a btrfs pool with raid1 replication. Key goals: data redundancy and reduced SD card wear.

Comments

Subscribe to join the conversation...

Be the first to comment

Enjoyed this article?

Get it daily. 7am. Free. Reads in 5 minutes.

Join 2,117 builders reading daily.