@imrehg Something different: I spend some time optimizing SD-Card lifetime and one of the things that could instantaneously lead to an instant SD-Card death was switching of the Raspberry Pi when writing onto the Card. I experienced this once. The bootsector of the card was destroyed - the Pi wasn’t able to boot. The card was just about one or two weeks old.
There is a way how to protect your card from this: Safely switching off the Pi. But in some situations this isn’t possible so something like an UPS for the Pi is needed.
After doing some research on this topic I found a few solution in form of an UPS-Hat for the Pi. One of those products turned out to be the best:
It’s a Raspberry Pi UPS Hat that communicates over SPI with the Pi and features wide range Power Input, Li-Ion Support, Battery Charger with integrated fuel gauge and a safe-way Power On-/Off Button, which when you press it, it initiates a shutdown of the Pi and after this has happened the Pi UPS switches off the Power Supply for the Pi.
In fact this Hat really works like a charm but unfortunately the german manufacturer tried sell this the “classic german way” - closed and with intention to make profit based on the hardware. Their mission failed but the product is still available but you can’t get any informations on the code on the Hat (there’s an ATmega controlling and watching the Power Supply).
But for any commercial product that is using the Raspberry Pi (Compute Module) this UPS is a must to ultimatively safe your SD-Card from death.
By the way - when using eMMC you aren’t safe from getting a corrupt Boot Sector since the eMMC is just a “soldered” SD-Card (with a few boosts in speed and so)