One of the Raspberry Pi’s weaknesses is its microSD flash card that serves as its main storage.
The lifetime of Flash cards is limited by the maximum number of writes per memory cell.
A flash card has an on-card memory controller that performs wear leveling management. This tries to spread write actions over all memory cells - through time - evenly, to prevent premature partial wear out.
The wear levelling unfortunately does not completely prevent microSD cards in Raspberry Pi’s (and similar devices) from wearing out.
One way to minimize flash card wear out is to use a ram drive for the storage of log files that are frequently written to. I have seen several solutions for this but most of them lacked a proper explanation.
I am looking for articles that properly explain:
Which ramdrives are available that can be used on a Raspberry Pi?
What are the differences between these ram drives?
I would assume that a standard ram drive would be included with the OS but that may just be wishful thinking.
Which ramdrive(s) is/are preferred and why?
In examples I have seen that only the systemd journal log was written to ram drive.
However, there are more logs written on Linux systems. What about other logs? Is it not necessary to write other logs to ram drive as well (and which and how)?
How to properly dimension the ram drive, how to determine the preferred/best size?
How to properly configure log sizes and rotation?
How and when to make a copy of the log from ram drive to flash card to prevent logs from vaporizing at power down?
On regular intervals, on power down only (probably not because loses logs in case of power failure), when the log reaches a certain size?
Who can help?
It will be useful if we can collect easy to apply recipies, tips and (links to) articles here to help prevent flash card wear out for Raspberry Pi (and similar microSD flash card based) gateways.