Skip to content

Disk Space by Journald

Hello to al the readers!

What is Journald?

Journald is a component of systemd. It is a system service that collects and stores logs of all the processes. It maintains structured and indexed journals out of data received from different sources. Sources include kernel messages, system messages, application logs, etc.

This is the way to check status of systemd-journald.

sudo systemctl status systemd-journald

Logs can be either stored temporarily in a volatile way under /run/log/journal. Or the logs can be stored permanently in a persistent way under /var/log/journal.

By default it stores all the logs persistently if it finds the directory /var/log/journal upon boot. And by default disk space is consumed upto 10% of filesystem upto 4 GB cap.

Too much store consumed by Journald

I have seen that journald service usually consume a lot of disk space in storing logs persistently. Following command tells how much disk space is consumed by journald.

$ journalctl --disk-usage

Archived and active journals take up 1.7G in the file system.

This takes up only 1.7 Gigs but in real it goes up high and system warns about low disk space. If this happens, then there is a way we can truncate the old logs and make the disk usage come down like this:

$ sudo journalctl --vacuum-size=1G
Vacuuming done, freed 0B of archived journals from /var/log/journal.
Deleted archived journal /var/log/journal/4260c487c8bb45c1918d244e014fc810/system@c6a5c2ddad3a4da5b5b60212406a1eb4-0000000000000001-0005f7ad49a1c9ea.journal (8.0M)
--snip--
Vacuuming done, freed 773.3M of archived journals from /var/log/journal/4260c487c8bb45c1918d244e014fc810.
Vacuuming done, freed 0B of archived journals from /run/log/journal.

And now let us again see the disk space used by it.

$ journalctl --disk-usage                                                                                                                                                                                                     

Archived and active journals take up 1004.8M in the file system.