Considerations for a long-running Raspberry Pi
Part of the Raspberry Pi Reliability series.
I use Raspberry Pis around my home as everything from low-power FM transmitters to UPS energy monitors.
Keeping a Raspberry Pi online and working with zero intervention for weeks, months, or years is somewhat of an art form. Several classes of things can go wrong, and you need to consider how your Pi will recover from each of them — and weigh the risks of each solution against its benefits.
This new set of posts in my Raspberry Pi Reliability series covers each class of issues I’ve run into, and what I’ve done to solve them. As a bonus, these posts also include some tips on monitoring, mainly using Uptime Kuma.
This aims to be a more comprehensive guide than my previous post on reducing SD card wear, and the posts linked here should be considered an updated replacement for that post.
To keep up updates on this topic without subscribing to my blog's full feed, you may subscribe to the Atom feed for my Raspberry Pi Reliability series.
Without further ado:
What can go wrong, and how do I prevent it?
- The WiFi connection can fail
- Your software service can stop working
- Hardware/firmware/driver instability can cause a crash
- Your SD card can wear out or completely fill up
- Start by choosing the right microSD card
- Don’t use the SD card for swap!
- Choose one of…
- Check the filesystem often if you’re not using a read-only root filesystem
- Disabling unneeded services helps with both software stability and SD card wear
Also, do these:
- Consider risks and benefits before applying any invasive intervention
- Remote logging can help you figure out what went wrong, when something does go wrong
Caution: Advice to avoid
This Stack Exchange post suggests disabling journaling for the Pi’s filesystem. Don’t do this. While this change might reduce SD card wear, it makes your Pi more likely to face filesystem corruption in the event of a crash or power outage. My goal is to make my Pis more reliable, and disabling journaling works against that goal.