Log files written to SD card
The Ångström release already uses a /tmp filesystem mounted on tmpfs, meaning that this is a RAM based file system which is lost at shutdown or reboot, so temporary files created by all kinds of programs are not written to flash.
I still noticed an increase in flash use after rebooting a few times and the journald deamon writes the system log-files into /var/log, which is on the SD card (or on eMMC).
It is easy to tell the journald deamon to not store the log-files on Flash.
The /etc/systemd/journald.conf file controls where the logs are written. The standard distribution uses all defaults (with all lines commented out), I uncommented the two lines for the Storage and SystemMaxUse and gave them some useful values. With Storage=volatile the system log is now written into /run/log which is also placed in the same RAM based filesystem as /tmp. In order to prevent the tmpfs to overflow on the longer run due to the log-files being too large, SystemMaxUse=2M is used to limit the size of the log-files. But somehow the space used still grows larger than this size.
Below is the content of the /etc/systemd/journald.conf file:
# This file is part of systemd. |