6 ms·
> If you store your data under /run (or /var/run) your district will probably put it on a RAM disk. You’ll lose it in a crash, but you won’t be writing to the S
by mrsteveman1 8y ago
> If you store your data under /run (or /var/run) your district will probably put it on a RAM disk. You’ll lose it in a crash, but you won’t be writing to the SD card and provoking it to corrupt in that crash.
> If you then adjust your systemd journal to not write very often you have eliminated most of your SD writes.
The trouble is that the OS isn't the only one writing to flash in the card, the MicroSD card controller is erasing and writing to it at random times as well even if the filesystem is read-only, with no coordination between it and the OS.
As a result you can easily end up in situations where the card decided to run some housekeeping to manage the flash just milliseconds before a power cycle or a power loss, and seemingly all consumer MicroSD cards are not up to the task of keeping the data intact at the same time.