systemd journal using too much disc space
Tom H
tomh0665 at gmail.com
Thu Jun 22 13:28:47 UTC 2017
On Thu, Jun 22, 2017 at 7:23 AM, Colin Law <clanlaw at gmail.com> wrote:
> On 22 June 2017 at 09:18, Colin Law <clanlaw at gmail.com> wrote:
>>
>> I note that the files in /var/log/journal are consuming 2.9GB and
>> journalctl --disk-usage
>> also shows 2.9GB. Since this is on Ubuntu 17.04 installed in an 80GB
>> partition on an SSD this is a significant chunk of my free disc space.
>> As far as I can see journalctl is using its default values as there
>> are no commented out settings in /etc/systemd/journald.conf and I
>> cannot see any overriding conf files.
>>
>> I see how to adjust the settings for this but am surprised the default
>> is so large. For example if I run
>> journalctl -u systemd-resolved.service
>> I see 70,000 lines going back over 9 months which seems a bit excessive.
>>
>> Is what I am seeing to be expected for the default settings?
>
> Ah, I see now why this is. By default systemd does not log to disc,
> but if the directory /var/log/journal exists then it *does* log to
> disc. Some time ago I created that dir in order to get more detail on
> a booting issue. I should have removed it when I had finished. I have
> now done that.
It's "Storage=auto" (the default) in "/etc/systemd/journald.conf" that
makes the journald logs persistence if "/var/log/journal/" exists.
If rsyslog is installed (and set up to collect logs), there's no need
for the journald logs to be persistent, except that "journalctl" will
only display the current boot's logs.
But if rsyslog is uninstalled or disabled, persistent journald logs
are necessary/desirable.
More information about the ubuntu-users
mailing list