HeadlinesBriefing favicon HeadlinesBriefing.com

Raspberry Pi Home Server Rebuild After SD Card Failure

Hacker News •
×

My Raspberry Pi 4B home server died after a building power outage corrupted the micro SD card. Despite years of 24/7 operation with no write-reduction precautions, the card failed, taking the root filesystem. Only torrent files and service caches were lost; critical data lived on external HDDs and Nix OS configuration was backed up.

For the rebuild, I prioritized SD card longevity: enabled zram for compressed RAM swap, mounted /tmp as tmpfs, set journald to volatile storage, and added noatime to the root ext4 mount. These changes minimize writes to the SD card.

Two old 2.5" HDDs (500GB and 320GB) were combined into a btrfs RAID1 pool named "ponkotsu" for redundancy. An autosubvol Nix OS module declaratively creates per-service subvolumes (e.g., Immich, Jellyfin) with systemd mount units, keeping service configs clean. A /var/cache subvolume was also added.

The new setup separates volatile data from persistent storage, uses redundant external drives, and leverages Nix OS for reproducible configuration. The author notes 2026 hardware prices make creative reuse of old drives practical.