Linux: reducing disk usage of Systemd journal logs

If you find yourself low on disk space, check the size of the Systemd journal logs as a way to easily free up some space.

$ sudo journalctl --disk-usage
Archived and active journals take up 528.0M in the file system.

# reduce size to 300 Mb
sudo journalctl --vacuum-size=300M

There are automatic jobs that trim these Systemd journal logs, but invoking manually will force the operation.

Change journal disk utilization

If you want to permanently change amount of disk these logs can utilize, modify “/etc/systemd/journald.conf“.  Setting the ‘SystemMaxUse’ key will keep the persistence below the threshold.

SystemMaxUse=300M

Restart the Systemd journal service or reboot for the change to take affect.

sudo systemctl restart systemd-journald

 

REFERENCES

stackexchange, how to clear journalctl

linuxhandbook.com, how to clear systemd journal logs

gist bearlike, clearing systemd journal logs on Ubuntu

NOTES

Another way to check disk utilization of journal logs

sudo du -m /var/log/journal | sort -n