Permanently limit the size of the systemd journal
limit journal size | set systemmaxuse | permanently restrict journald disk usage | stop journal from growing | journald | disk-space | configurationCaution: This command changes the system. Understand what it does before you run it.
mkdir -p /etc/systemd/journald.conf.d && printf '[Journal]\nSystemMaxUse=500M\n' > /etc/systemd/journald.conf.d/size.conf && systemctl restart systemd-journaldWrites the SystemMaxUse setting to a separate file under /etc/systemd/journald.conf.d/, which survives package updates, and restarts journald. From then on, journald deletes the oldest archives on its own once the limit is reached. An existing size.conf is overwritten.
Note: Check the result with journalctl --disk-usage. journald removes archives above the new limit at the latest during the next rotation.
Also searched as
- limit journal size
- set systemmaxuse
- permanently restrict journald disk usage
- stop journal from growing