Home assistant VM size bloated (not database or backups)

I’ve been playing a bit with a .qcow2 image in KVM to “eventually” replace my old “core in Docker” setup. But I’ve noticed that it tends to use a lot of storage, and I can’t figure out why.

I have a pretty minimal setup, and only a few add-ons (since I’m just testing, I have everything in the old Docker setup).

I recently resized it from 20 GB → 30 GB, but a few months after, I could no longer upgrade Hass, due to no storage available. So I just added another 10 GB. But I can’t seem to figure out what’s taking up all the storage. I have only a single (~1.1 GB) backup, and the database is about 1.5 MB.

In the HassOS VM, I only have a subset of the things (add-ons, integrations, etc.) that I use in the Docker setup, and while the Docker persistent storage is only 2.3 GB, I can see that for the VM:

$ sudo fdisk -l /mnt/data/vm-images/hassos.qcow2
Disk /mnt/data/vm-images/hassos.qcow2: 30.48 GiB, 32718127104 bytes, 63902592 sectors

(after resizing fro 30 GB to 40 GB, it was at 29.36 GiB immediately prior).

Any ideas where to look for what’s eating storage?

EDIT: And 8h later, it’s up to 37.81 GiB… Something’s running wild!

check your log file?

Indeed, home-assistant.log is 22 GB and home-assistant.log.1 is 142 MB!

Do I need to manually set e.g.:

system_log:
  max_entries: 50

in configuration.yaml? I though this was only something to change if you wanted more/less than the default 50 (as described in the docs)? And I haven’t changed this manually…

You can also manually clear the system log service: system_log.clear

Make sure you are not curing the symptom instead of the disease.
Make sure nothing is spamming the logs and configure the logger to error, not warnings

Good points, I’ve changed from debug to warning. But how do I make sure it doesn’t grow out of hand, regardless of how many “things” log? Do I have to set up a system_log.clear automation?

Also, I thought it only kept the last 50, as described in the documentation. Or did I misunderstand this? Is system_log not related to logger?

Debug? No wonder your logs are out of control. Once you have a stable system, set it to error.

Even if you are saving the last 50 it’s still writing and deleting the lines are n the log, unless you send the log to ram.

Sure, I’ve changed to error.

But still, why did it end up being tens of GB on the without deleting anything? Without solving that, it would probably still end up growing out of hand, just much MUCH slower.

It rotates every day I thought. ( That’s the log.1 fe) Your debug output is just very verbose it seems.

One error can generate dozens of lines in the log and trigger multiple times per minute!

OK, they seem less out of control, I’ll keep an eye on them for a while. But thanks, this would have driven me crazy eventually :slight_smile: