问题原文
原帖链接 · Smith_33 · CC BY-SA 3.0
When I do a journalctl --disk-usage it says something about 300MB size of the journal files but when I look at the actual text with journalctl | wc -c it's something about 28MB. Well, journald has compression and even considering the metadata like timestamp, uid, message hash and such things it seems to me like a ridiculous waste of disk space.
Can someone tell me why the journal files are so big compared to the actual text inside?
已采纳解答
原帖链接 · Mark Stosberg · CC BY-SA 3.0
There are two reasons. First, as @Mella mentioned, there is the difference between the current-log vs all-logs.
Second, as documented in man journalctl, there a number of output formats. You were measuring the size of the most-compact/least-detailed. To see maximal data in the systemd journal, use:
journactl --output=verbose
In my case, the compact journal output returns 32 Megs of data, while 128 MB are returned with --output=verbose and 152M are found with journalctl --disk-usage, covering both active and archived journals.
See man journald.conf to learn how to limit how much disk space journald uses if you are concerned.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
