Add notes on how to move apt cache to tmpfs (ram)

This commit is contained in:
KemoNine 2020-08-10 22:41:25 -04:00
parent 905f433616
commit 974ee0d62d
2 changed files with 19 additions and 0 deletions

View file

@ -21,6 +21,7 @@ Items marked ```REQUIRED``` are assumed to be setup and working. You've been war
* [System Monitoring (REQUIRED)](monit.md)
* [CPU Governor (VERY SMART)](cpu_governor.md)
* [Logs in RAM (log2ram / VERY SMART)](log2ram.md)
* [Apt use RAM (VERY SMART FOR 4Gb RAM)](apt_cache_tmpfs.md)
* [Pimoroni Fan Shim](pimoroni_fan_shim.md)
* [HDMI Scheduled On/Off](scheduled_display.md)
* [Backups via restic](restic.md)

18
docs/apt_cache_tmpfs.md Normal file
View file

@ -0,0 +1,18 @@
# tmpfs apt cache
**Please Note: this will use 512M RAM for the tmpfs (it'll usually be smaller) and can cause apt automatic updates to fail. You'll need/want to watch your logs and automatic updates if using this setup.**
The below commands will enable tmpfs (in memory filesystem) for ```/var/cache/apt``` which has heavy disk write turnover due to automatic updates.
``` sh
sudo -sHu root
rm -r /var/cache/apt/*
cat >> /etc/fstab <<EOF
tmpfs /var/cache/apt tmpfs size=512M,defaults,noatime,nodiratime 0 1
EOF
mount /var/cache/apt
df -h /var/cache/apt
```