3 ms·
The most noticeable raspberrypi SD card life lengthener for me has been to write logs to RAM (assuming you have a stable setup and don't count on them to surviv
by ronjouch 3y ago
The most noticeable raspberrypi SD card life lengthener for me has been to write logs to RAM (assuming you have a stable setup and don't count on them to survive a reboot!).
Our $job dashboards used to nuke an SD card every couple weeks/months, but since the move to logs-in-RAM we've been running the same SDs for years.
DIY via {fs,journalctl} config , or using https://github.com/azlux/log2ram https://github.com/azlux/log2ram
Also, mount the SD with the `noatime` flag of course: https://wiki.archlinux.org/title/Ext4#Disabling_access_time_update https://wiki.archlinux.org/title/Ext4#Disabling_access_time_...
- eternityforest 3y agoNoatime, disable swap, logs in RAM, /tmp in RAM, .xsession errors in RAM(With logrotate or it will fill up! So many random problems can make a problem there), chromium profile folder in RAM if you do kiosk work(Browser makers must hate flash!). From what I hear Home Assistant is still not the easiest if you want to run for years on a card, not sure if that's fixed now, but it's one of the big factors blocking me from moving to HA.
- cwillu 3y agoThere was a link a couple weeks ago to industrial sd cards on digikey. They're pricey, but they will work for years without disabling anything on these sorts of boards. https://www.digikey.ca/en/products/filter/memory-cards/501?s=N4IgjCBcoLQBxVAYygMwIYBsDOBTANCAPZQDa4ADAKwBMIAugL7NA https://www.digikey.ca/en/products/filter/memory-cards/501?s... is the brand I used to use, iirc
- 037 3y agoAny script/guide to do all this on a Raspberry Pi in one go? I'm very interested for some Pi Zero 2: every couple of months the microSD content gets corrupted and I have to rebuild the system + restore backups.
- eternityforest 3y agoThe section starting at 827 is what I'm currently using, but it just covers the basics. Somewhere in there is also the kiosk launch script to run Chromium without breaking the card. If you use apache you'll need to add a service to create the logfile though. https://github.com/EternityForest/KaithemAutomation/blob/develop/kaithem-kioskify.sh https://github.com/EternityForest/KaithemAutomation/blob/dev...
- ronjouch 3y agoA guide I wrote for $job that covers what I mention in the parent-parent post, and a couple other things: https://unito.io/blog/better-raspberry-pi-dashboards/ https://unito.io/blog/better-raspberry-pi-dashboards/ Note: only a guide, not scripted yet. See footnote for why :)
- ronjouch 3y agoOoooh, excellent additions, thanks :)