You are not logged in.
Pages: 1
Topic closed
It's not a big deal, I'm just curious what's going on. I did what the wiki says https://wiki.archlinux.org/index.php/Sy … size_limit , but I have my doubts whether it works:
$ grep -v "#" /etc/systemd/journald.conf
[Journal]
SystemMaxUse=50M
SystemMaxFileSize=10M
$ du -sh /var/log/journal
55M /var/log/journal
$ journalctl --disk-usage
Journals take up 3.4M on disk.
How did 'journalctl --disk-usage' come up with 3.4 MB?
http://cgit.freedesktop.org/systemd/systemd/plain/TODO says
journald: we currently rotate only after MaxUse+MaxFilesize has been reached.
Does it mean it won't grow bigger than 50+10 MB?
journalctl and systemd-journald ignore all files with names not ending with ".journal" or ".journal~", so only such files, located in the appropriate directories, are taken into account when calculating current disk usage.
journal files is all I got there:
$ find /var/log/journal/0dcc5d71ea3c9513b2b3b6e24aac1fee -type f -not -name "*.journal" -not -name "*.journal~"
$
Last edited by karol (2013-11-15 20:17:58)
Offline
In my case I also use
RuntimeMaxUse=50M
However my file sizes do seem approximately in step with what is expected from du -sh
$ sudo journalctl --disk-usage
Journals take up 768.0K on disk.
$ du -sh /var/log/journal
780K /var/log/journal
Mind you I recently removed the journal directory to clean out coredumps by stopping the systemd-journald service and then doing the following before rebooting
# rm -fr /var/log/journal
# mkdir /var/log/journal
The files look sensible since doing that. I have had the journal files corrupted at various times when there has been a system hang and this is easily seen if the journal is verified with
# journalctl --verify
Unless the above shows pass on all files I remove the journal directory entirely to clean it up as I believe that systemd can't clean up corrupted binary journal files.
Maybe the journal disk usage excludes things like coredumps?
Last edited by mcloaked (2013-11-04 19:50:43)
Mike C
Offline
@mcloaked, your setting in journald.conf has nothing to do with how much space the journal takes on disk. Please read journald.conf(5).
Edit: As far as what you are experiencing karol, I have no idea. I recently reinstalled my system to clean things up a bit. My install was from when I was a new Arch user, and didn't have as good of an understanding about the filesystem. So I figured a cleanup was in order.
But here is what I have:
% grep -v "#" /etc/systemd/journald.conf
[Journal]
Storage=persistent
SystemMaxUse=400M
SystemMaxFileSize=30M
RuntimeMaxUse=250M
RuntimeMaxFileSize=30M
and
% du -sh /var/log/journal
45M /var/log/journal
and
% journalctl --disk-usage
Journals take up 44.4M on disk.
So mine seems right... sorry I can't be of more help.
Last edited by WonderWoofy (2013-11-04 20:01:26)
Offline
Karol, I created systemd unit, that executes on shutdown, which clears out the corrupted binary (?) files in /var/log/journal.
And ever since, journalctl is reporting the correct disk usage.
$ grep -v "#" /etc/systemd/journald.conf
[Journal]
SystemMaxUse=50M
SystemMaxFileSize=10M
$ du -sh /var/log/journal
6.6M /var/log/journal
Last edited by Kilzool (2013-11-04 20:44:52)
Offline
I'll wait to see if the logs will stay at < 60 MB.
I've already did a 'rm -f'-style cleanup a couple months ago.
Offline
Either I'm no longer getting corruption or systemd is now cleaning up after itself as I haven't needed to manually delete corrupt files for a while. Did they fix something? Or have I just been lucky?
My sizes are also similar from du and --disk-usage, both being significantly under the limits set in the config. (So I'm no help either.)
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
So I'm no help either.
You guys suck ;-)
And I'm an idiot:
$ du -sh /var/log/journal
55M /var/log/journal
$ journalctl --disk-usage
Journals take up 3.4M on disk.
$ sudo journalctl --disk-usage
Journals take up 54.3M on disk.
I'll leave the thread open to see if the logs grow to more than 60 MB.
Offline
Thanks for that Karol - it is a useful distinction running the command as user and root. I don't think you are an idiot at all, and easy to not realise that the command running as user will not give the full file set. Of course with hindsight it is obvious!
Mike C
Offline
@karol
Can you really run the du command as a normal user? For me it does not work without sudo:
~ $ du -sh /var/log/journal
du: warning: summarizing conflicts with --max-depth=1
Try 'du --help' for more information.
Offline
Aren't you using some kind of alias for 'du'?
What's the output of 'type -p du'?
Offline
I haven't removed anything manually, but the size went down a bit:
$ du -sh /var/log/journal/
53M /var/log/journal/
$ journalctl --disk-usage
Journals take up 3.0M on disk.
$ sudo journalctl --disk-usage
Journals take up 52.9M on disk.
Seems that the journal size won't exceed MaxUse+MaxFilesize.
Marking the thread as solved.
Offline
$ sudo journalctl --disk-usage
Journals take up 16.0M on disk.
$ cat /etc/systemd/journald.conf
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# See journald.conf(5) for details
[Journal]
Storage=auto
#Compress=yes
#Seal=yes
#SplitMode=login
#RateLimitInterval=10s
#RateLimitBurst=200
SystemMaxUse=10M
SystemMaxFileSize=1M
MaxRetentionSec=100 day
MaxFileSec=1 week
ForwardToSyslog=no
#ForwardToKMsg=no
#ForwardToConsole=no
#TTYPath=/dev/console
#MaxLevelStore=debug
#MaxLevelSyslog=debug
#MaxLevelKMsg=notice
#MaxLevelConsole=info
Last edited by theking2 (2014-03-20 20:31:55)
archlinux on a Gigabyte C1037UN-EU, 16GiB
a Promise PDC40718 based ZFS set
root on a Samsung SSD PB22-J
running LogitechMediaServer(-git), Samba, MiniDLNA, TOR
Offline
theking2 Please don't bump and crosspost: this thread is solved and you have dumped the same post in a similar thread.
Cllosing
Offline
Pages: 1
Topic closed