Third corrupted card in a year - is booting from an SSD the fix, or am I doing something else wrong?
Small board running a couple of always-on services. Roughly every four months the card corrupts and I reflash it, restore my config and carry on.
I have tried a better brand of card, which did not obviously help. It happens on two different boards, so it is not one faulty unit.
Everything I read says boot from an SSD instead, which I am willing to do, and I would like to understand whether the card is the cause or the symptom before I spend the money. If something about how I have set this up is destroying storage, an SSD might just die more slowly.
What actually kills these cards, and what is the right setup for something that runs all the time?
@writes_kill_cards · 3w ago
Two separate causes and it is worth knowing which you have, because an SSD fixes one of them properly and only partly helps with the other.
Wear from writes. Flash cells have a limited number of write cycles, and cards use much simpler wear levelling than an SSD. A machine writing continuously - logs, a database, metrics, a cache: chews through that far faster than people expect. Four months of constant logging is entirely plausible.
Corruption from unclean power loss. A card being written to when power disappears can be left inconsistent. This is often the real cause on boards that get unplugged, or that brown out under load with an inadequate supply.
How to tell: if your services write a lot, suspect wear. If your corruptions follow power events or you have ever seen undervoltage warnings, suspect power - and see the next answer.
Things that reduce writes considerably:
Send logs to memory rather than to the card, and cap their size.
Move any database or frequently written directory off the card, to a USB drive or over the network.
Mount things read-only where you can.
Reduce swap, which on a card is a write amplifier.
Do those and cards last a great deal longer.
Reply
Report