Why is /var on tmpfs?


#1

Omnia has almost 8 GB flash and mere 1 GiB of RAM (unless you’ve gotten the 2 GiB version which I now regret that I have not :frowning: ) which makes me wonder: why is /var on tmpfs? It makes much more sense to me to keep in on flash where logs can survive reboots and not waste RAM. Anyone knows a reason why I should not delete the /var symbolic link and replace it with regular directory?


#2

The main reason is, that /var directory contains frequently changed files, which is not much kind to the flash memory (it have quite limited number of rewrites per one cell).


#3

Is this still a legitimate concern? In another lifetime I’ve been working on phones and ’ve been flashing them multiple times a day, despite that, storage worked fine years later. I feel like the argument is a bit of a cargo culting.

Sure, there is /var/lock and pid files which make a lot of sense in ram (they are often just a few bytes), but, as I’ve hinted above, /var/log would be better on persistent storage.


#4

Yes, that is still a legitimate concern. My last phone died because of the flash memory wore off. We’ve seen some failures on the flash of the previous Turris. The flash in omnia should be a better quality than the one in most routers (where it can fail after few thousands of rewrites), but we still don’t want to risk it.

If you are willing to put the strain on yours, you can configure to have another copy of the logs somewhere else, we use syslog-ng, so just drop another config file into /etc/syslog-ng.d/.


closed #5