System partition gets filled too much with each update.

I am trying to free up some disk space on the root partition on a small hard drive.

I have:


# fdisk -l
Disk /dev/sda: 37.3 GiB, 40007761920 bytes, 78140160 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x20a0209f


Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1           2048  2105343  2103296    1G 82 Linux swap / Solaris
/dev/sda2  *     2105344 18876415 16771072    8G 83 Linux
/dev/sda3       18876416 78139391 59262976 28.3G 83 Linux
# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        239M     0  239M   0% /dev
tmpfs           244M     0  244M   0% /dev/shm
tmpfs           244M  1.4M  243M   1% /run
tmpfs           244M     0  244M   0% /sys/fs/cgroup
**/dev/sda2       7.8G  5.7G  1.7G  78% /**
/dev/sda3        28G   13G   15G  48% /home
tmpfs            49M     0   49M   0% /run/user/0
tmpfs            49M   12K   49M   1% /run/user/1000
# du -hs /*
5.6M    /bin
59M     /boot
0       /dev
22M     /etc
13G     /home
467M    /lib
16K     /lost+found
4.0K    /mnt
4.0K    /opt
0       /proc
384K    /root
1.2M    /run
8.9M    /sbin
4.0K    /selinux
28K     /srv
0       /sys
20M     /tmp
**3.7G    /usr**
**1.4G    /var**

There used to be nearly 3.5G on / before I recently upgraded from 13.2 to Tumbleweed but somehow now it is much more filled although no new packages were added and it seems Tumblweed updates keep adding more and more with each update.

I notice that /var/log/journal is nearly 900mb. Is it possible this log to be rotated via logrotate? If yes - how? No idea if there is anything to clean in /usr.

What would you suggest in order to prevent disaster of filling the root partition too much? This is an old laptop which works well but I cannot invest in upgrading it, just willing to use it as long as it is alive.

No, it is controlled by journald directly. Look at “man journald.conf” for various settings to control total journal size.

If you updated, you probably also have some syslog daemon running, in which case you effectively have most logs twice. You may consider either to remove syslog or to disable persistent journal completely (Storage=none) to avoid duplication. You may need to manually clean /var/log/journal after setting Storage=none (and rebooting/restarting journald).

Do you by any chance have another small HD that you could add as a 2nd drive and use for the /home partition? 8 Gigs is terribly small for a Tumbleweed partition.

Thank you. I have done that and created a new file:


# cat /etc/systemd/journald.conf.d/00-journal-size.conf 
[Journal]
SystemMaxUse=200M

and then I ran:

# journalctl --vacuum-size=200M

and it removed 600mb after which I have:


# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        239M     0  239M   0% /dev
tmpfs           244M     0  244M   0% /dev/shm
tmpfs           244M  1.3M  242M   1% /run
tmpfs           244M     0  244M   0% /sys/fs/cgroup
**/dev/sda2       7.8G  5.0G  2.5G  68% /**
/dev/sda3        28G   13G   15G  48% /home
tmpfs            49M     0   49M   0% /run/user/486
tmpfs            49M     0   49M   0% /run/user/0

If you updated, you probably also have some syslog daemon running, in which case you effectively have most logs twice. You may consider either to remove syslog or to disable persistent journal completely (Storage=none) to avoid duplication. You may need to manually clean /var/log/journal after setting Storage=none (and rebooting/restarting journald).

I have been trying to figure that out but I couldn’t. How do I check if there is such thing as syslog at all and disable it? Also is there any negative impact in doing that or just staying with journald is enough?

I don’t have another small HD. This laptop is very old and I don’t see any point in upgrading it at all. But it works fine for what it is used for.

Understood. And, oh, I did not notice earlier that it was a laptop, which would probably mean that you could only use an external drive, anyway. No space for a 2nd drive.

That’s right. And no option for replacement either.

Any idea how to cleanup anything more?

Before systemd’s journal took over, older (oS) releases would use a syslog implementation; typically rsyslog. You can find out if you’re still using one by (i) checking to see if you have /var/log/messages (at least, anything recent appended to that) or (ii) seeing if such is even installed (i.e check with yast sm or whatever, whether rsyslog is installed).

There is no harm having multiple logging methods. (just duplication; in which case, if something gets spammy, then twice the amount of log spamming and decrease in available disk space …). No harm in removing. journald is fine on its own.

Check to see it you have any core dumps, rpm cache laying around… both will also be in /var:

  • /var/lib/systemd/coredump
  • /var/cache/zypp/packages/repoalias
    / … if you’re purposely retaining rpms - /var/cache/ZYPPER/RPMS … if you’ve manually installed an rpm (locally or remote)

Thanks. I already checked that /var/log/messages is not available. The total size of my /var/cache/zypp is 48M only. I deleted everything in /var/lib/systemd/coredump but there wasn’t much there too.