Reducing SD Card Writes With Raspbian

A common concern of those running applications on a Raspberry Pi is SD Card exhaustion.  It seems that after some amount of write activity, some SD cards fail to record further data.  I first noticed this on an APRS system when system updates disappeared upon reboot.

The systemd journal is a useful tool that has largely replaced the syslog in modern Linux systems.  It can also be redirected from the SD card to volatile memory.  Note that by changing this you will reduce the number of SD card writes but your journal will not survive reboots.

The key to changing the storage location of the journal is found in /etc/systemd/journald.conf.  Look for this line:

[Journal]
#Storage=auto

Uncomment the line by removing the #.  Change auto to volatile:

[Journal]
Storage=volatile

Restart the systemd journal and your journal data will be written to /run/log, which is memory resident.

sudo systemctl restart systemd-journald.service

Only use good quality SD cards such, such as the SanDisk Ultra Class 10 memory cards.  I recently had one that failed but was pleased when the SanDisk warranty program replaced the card at no charge.

1 thought on “Reducing SD Card Writes With Raspbian”

Leave a Reply

Your email address will not be published. Required fields are marked *

Comments Protected by WP-SpamShield Anti-Spam