The handy log2ram utility can help prolong an SD card or SSD’s life, which is particularly helpful if you’re using such flash storage for your Proxmox host’s boot drive.
My Proxmox hosts have been running for a while and I haven’t done much in the way of log management so I first needed to do a bit of cleanup before I could start holding my logs in RAM.
Reduce current journal size:
journalctl --vacuum-size=128M
Limit the journal’s size in the future by editing /etc/systemd/journald.conf
:
SystemUseMax=128m
Hokay, install and activate log2ram
:
# add repo
echo "deb [signed-by=/usr/share/keyrings/azlux-archive-keyring.gpg] http://packages.azlux.fr/debian/ bookworm main" | tee /etc/apt/sources.list.d/azlux.list
# import keyring
wget -O /usr/share/keyrings/azlux-archive-keyring.gpg https://azlux.fr/repo.gpg
# install
apt update && apt install log2ram -y
It should take effect on the next boot (so maybe go ahead and reboot when you get a moment). Verify with systemctl status log2ram
.