Raspberry Pi

From Leo's Notes
Revision as of 07:21, 23 March 2015 by 10.1.1.3 (talk) (Created page with " == Mounting <code>/var/log</code> as tmpfs == Append to the <code>/etc/fstab</code> with the following line. tmpfs /var/log tmpfs nodev,nosuid,mode=0755,size=50m...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This page was last edited on 23 March 2015, at 07:21.

Mounting /var/log as tmpfs

Append to the /etc/fstab with the following line.

tmpfs           /var/log tmpfs nodev,nosuid,mode=0755,size=50m  0 0

This will mount /var/log as a 50MB ramdisk. If your system is using systemd, this will break systemd-journald. To fix it, you will need to create a startup script after the mount has completed that creates the journald's directory in /var/log/journal/.

Reboot the Pi for the changes to take affect, or run mount -a which will mount the ramdisk to /var/log immediately, though you'll need to restart any services that has handles to any files there.

Why would you want to do this? To limit the amount of writes that is made to the SD card to prevent premature wearing.