Chris Green <c…@isbd.net> wrote:
> My Pi Zero 2W seems to eat SD cards. Well, maybe a slight exaggeration > but two seem to have failed in the last year or so. It's permanently > powered up running some very lightweight monitoring via I2C. > > It has hardly any customisation, it's bog standard with a couple of > python scripts. I'd like to keep it that way as far as possible as it > eases maintenance (I have quite a few Pi systems around the place). > It writes once an hour to a sqlite3 database. > > I have a similar monitoring system running on an old Pi 2B and that has > just gone on working with the same SD card for several years. That > actually writes to its sqlite3 database once a minute! > > So why does my Zero 2W kill SD cards so quickly and how can one improve > things? The ways I can think of are:- > > * Get a super reliable SD card - but how to find one of those?
Look for "industrial grade SD cards" - those tend not to be cheap, but in my experience they do deliver a much better service life than the Dollar Store Specials.
> * Minimise writing to SD, use RAM disk - lots of customisation
First steps: - mount on-disk filesystems with noatime if that is not already the case, that will kill implicit writes triggered by reads - turn off local syslog and let it write over the network to a loghost - see what else keeps writing logs and dial that back as far as reasonable
> * Use a different sort of drive - how easy is this on a Pi Zero?
AFAIK it wants to boot from the SD card. But what you can do: - only put the OS itself on the SD card - any data that gets written goes onto a USB disk (that should be doable) Kind regards, Alex.
-- "Opportunity is missed by most people because it is dressed in overalls and looks like work." -- Thomas A. Edison