0

You have probably read the Raspberry Pi: Extending the life of the SD card article on zdnet by now. It features this line:

tmpfs    /var/log    tmpfs    defaults,noatime,nosuid,mode=0755,size=100m    0 0

However, I'd like to improve and just:

ln -s /tmp /var/log
user1095108
  • 239
  • 2
  • 10

1 Answers1

3

A problem with this is that /tmp isn't a tmpfs mount by default on the current version of the OS (or on the last one or the one before that). Have a look at mount | grep tmp.

Of course, you could link it to a directory in /run instead. However, you'll have to arrange to have it created first, unless you just want to symlink it to /run, which seems messy, and if all this is about saving the effort it takes to add a line to /etc/fstab, silly as well.1

A more serious problem is that, particularly if the system runs without re-booting for a while and/or does stuff that creates copious logs, that tmpfs space isn't free -- it comes out of your RAM. Tmpsf mounts are intended for temporary storage of small amount of rapidly and frequently accessed runtime data, which logs are not.


  1. I won't repeat the paranoid-delusionally angle mentioned in my comment on your question, but don't forget about that either.
goldilocks
  • 60,325
  • 17
  • 117
  • 234