2

I just found that there are two big files in my Ubuntu 16.04:

/run/log/journal/c840a48...(a very long name)...debfed5d/system.journal
/var/log/installer/cdebconf/templates.dat

My goal is to make the filesystem of Ubuntu as small as possible, so I'm thinking if I can remove these two files because they are all big enough (more than 10 MB).

It seems that they are two log files, so can I simply remove them? If they come from some processes, is it possible to disable the log system of these processes to prevent the two files to be generated?

Yves
  • 1,288
  • 6
  • 19
  • 34
  • It might be a bad idea to simply delete journal log files. They can be controlled in size with the vacuum cleaner: https://askubuntu.com/questions/1012912/systemd-logs-journalctl-are-too-large-and-slow/1012913#1012913 – WinEunuuchs2Unix Mar 13 '18 at 01:45
  • /run is a tmpfs by default on Ubuntu. Its contents are lost on reboot and do not exist on disk (with possible exceptions of /run/media, etc.) . – muru Mar 13 '18 at 02:05
  • @muru what do you mean "do not exist on disk"? – Yves Mar 13 '18 at 02:10
  • 1
    It's in memory. https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt – muru Mar 13 '18 at 02:10

1 Answers1

0

Reducing log files to 10 MB seems overly optimistic. On my system /var/log is 194 MB:

$ sudo du -h -d1 /var/log
148K    /var/log/lightdm
8.0K    /var/log/hp
4.0K    /var/log/speech-dispatcher
4.0K    /var/log/dist-upgrade
1.7M    /var/log/installer
4.0K    /var/log/upstart
4.0K    /var/log/gdm3
160K    /var/log/apt
185M    /var/log/journal
12K     /var/log/fsck
68K     /var/log/cups
4.0K    /var/log/unattended-upgrades
194M    /var/log

The journal log file in question is 185 MB on my system and was 312 MB before I used the vacuum cleaner (function's real name) to reduce it's size below 200 MB.

As far as /var/log/installer/cdebconf/ goes there is no such directory on my machine. I did find a reference where 75 GB was consumed there for someone else.