Compare commits

...

2 commits

Author SHA1 Message Date
KemoNine 757ed6b376 Add log2ram docs 2020-08-10 22:21:52 -04:00
KemoNine b665f88e3d Add docs on how to move swap to zram 2020-08-10 22:20:51 -04:00
3 changed files with 64 additions and 1 deletions

View file

@ -19,9 +19,10 @@ Items marked ```REQUIRED``` are assumed to be setup and working. You've been war
* [Slideshow Setup (REQUIRED)](slideshow.md) * [Slideshow Setup (REQUIRED)](slideshow.md)
* [Email Notifications (REQUIRED)](email_notifications.md) * [Email Notifications (REQUIRED)](email_notifications.md)
* [System Monitoring (REQUIRED)](monit.md) * [System Monitoring (REQUIRED)](monit.md)
* [CPU Governor (VERY SMART)](cpu_governor.md)
* [Logs in RAM (log2ram / VERY SMART)](log2ram.md)
* [Pimoroni Fan Shim](pimoroni_fan_shim.md) * [Pimoroni Fan Shim](pimoroni_fan_shim.md)
* [HDMI Scheduled On/Off](scheduled_display.md) * [HDMI Scheduled On/Off](scheduled_display.md)
* [CPU Governor](cpu_governor.md)
* [Backups via restic](restic.md) * [Backups via restic](restic.md)
* [Web Based Administration](cockpit.md) * [Web Based Administration](cockpit.md)
* [Web Dashboard / Landing Page](landing_page.md) * [Web Dashboard / Landing Page](landing_page.md)

31
docs/log2ram.md Normal file
View file

@ -0,0 +1,31 @@
# log2ram
Move the logs to RAM with a single daily sync. This will help with keeping the micro sd card from being burned out from disk writes quickly.
``` sh
sudo -sHu root
git clone https://github.com/azlux/log2ram.git /opt/log2ram
cd /opt/log2ram
chmod +x install.sh
./install.sh
nano -w /etc/log2ram.conf
MAIL=false
SIZE=64M
LOG_DISK_SIZE=200M
# If you only want sync on shutdown/halt (you probably do...)
systemctl disable log2ram-daily.timer
systemctl reboot
sudo -sHu root
df -h /var/log
# If log2ram isn't working or fails due to out of space problems
# rm -rf /var/log/journal/*
# systemctl restart log2ram
# systemctl restart systemd-journald
```

View file

@ -1,5 +1,36 @@
# swap # swap
## zram swap config
*Please Note: This sets up a zram swap config. It uses RAM for swap. You should be able to use this if you have >=2Gb of RAM, be sure to keep an eye on your RAM use over time just in case this causes problems. See the munin docs for details on how to monitor RAM use over time.*
The below will setup 5% of the system memory as zram backed swap.
``` sh
sudo -sHu root
git clone https://github.com/StuartIanNaylor/zram-swap-config /opt/zram-swap-config
cd /opt/zram-swap-config
chmod +x install.sh
./install.sh
nano -w /etc/zram-swap-config.conf
MEM_FACTOR=5
SWAPPINESS=1
systemctl reboot
sudo -sHu root
zramctl
cat /proc/sys/vm/swappiness
htop / top to see swap is available
```
## Standard swap file
*Please Note: This sets up a standard swap file and can cause your sd card to wear out faster*
The below commands will setup 1Gb of swap space as a file on the root filesystem and activate it for use. The below commands will setup 1Gb of swap space as a file on the root filesystem and activate it for use.
``` sh ``` sh