Författare:
Per Stenebo
Per Stenebo
Skapad:
2015-01-28 18:36:28
2015-01-28 18:36:28
Ändrad:
2018-12-24 09:21:09
2018-12-24 09:21:09
tmpfs
Extend SDcard lifespan with tmpfs which (mostly) will use RAM memory and not the regular filesystem.
You can use existing dirs in /run for this, or you can mount /tmp on tmpfs filesystem.
Mount directorys with heavy write load that do not contain information that need to survive reboot, add lines in fstab:
sudo nano /etc/fstab
Add the lines:
tmpfs /tmp tmpfs defaults,noatime,nosuid,nodev,noexec,mode=1777,size=50M 0 0 tmpfs /var/log tmpfs defaults,noatime,nosuid,mode=0755,size=50M 0 0
If you get error like this when doing update/upgrade:
Setting up ntp (1:4.2.6.p5+dfsg-2+deb7u1) ... chown: cannot access `/var/log/ntpstats': No such file or directory dpkg: error processing ntp (--configure): subprocess installed post-installation script returned error exit status 1
Since we vipe /var/log each boot there obviously are no directory like /var/log/ntpstats, but we can fix it with a cron command:
sudo crontab -e
Add the line:
@reboot mkdir /var/log/ntpstats > /dev/null 2>&1