Reducing wear on your sd-card

One way to increase the lifespan, and presumably, reliability of the sd-card, currently being hammered, in your Pi is to put some of the temporary files into memory.

Add the following to your /etc/fstab

tmpfs /var/log tmpfs nodev,nosuid,size=50M 0 0

If the size isn’t specified then half of the machine’s memory is used.
nodev and nosuid are security options, the suggestion is that these only need setting for public facing machines.

 

8-Jan-2018: If you’re using the lighttpd web server then be aware that it stores files in /var/log, and it doesn’t like them being removed. This will cause the server to fail to start.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s