HASSIO Docker Overlay2 folder consuming all disk space

I have managed to do some reading on this as yet again my HA virtual linux machine ran out of disk space.

This is what I did:

  1. installed ncdu sudo apt install ncdu
  2. changed to root cd /
  3. ran ncdu

Yet again, docker and HA had chewed up 20+gb of disk space. There are some interesting posts here: Some way to clean up / identify contents of /var/lib/docker/overlay - #26 by 10111dg - General - Docker Forums which explain why it happens, specifically how some containers are just a bit messier.

The answer in the end was reasonably simple, the command docker system prune --all --volumes --force cleaned up 12GB of space.

1 Like

Do you have to keep doing this command every time the space gets too low? Or does the command fix the problem going forward?

The answer is unfortunately “every time”, but being fair here, it isn’t really a home assistant problem.

It is a combination of rapid product and addon evolution combined with how docker prevents containers (apps) from negatively impacting each other.

How much space did it free for you?

When I ran on a raspberry pi I had this issue and manually deleted the log files. It was 10s of GB. Since then I have moved to a desktop server, and I haven’t had any more of this issue. Not sure if it is related or not.

I had this problem for ages and my temporary solution was to schedule a delete and recreate of the container every night. It was that bad it would fill my disk in less than 2 days.

Anyway I found the source of my problem. It was the logger integration specifically debug logging. I had a number of components configured in it for debug logging. As soon as I disabled those and just had info logging enabled for all, the problem disappeared.

edit
It was definitely the overlay filling up the disk not the actual home-assistant.log file.

That may have been the cause for me as well, when I was using a rpi, I was having a lot of issues with zwave and zigbee and so I had debugging on a lot for those components. Since moving to the desktop server, my zwave and zigbee has been really solid and so I haven’t had any need for the debug logger level much.

17gb freed! Thank you!

I tried all the options provided in this thread, but nothing really cleans up anything, my Overlay2 folder is still big and growing. This has been the case for a very long time and no real solution is available as far as I can see. I have to create a new VM every few months because they keep on growing (>30GB).

Is there really no solution for this issue?

Am I the only one with this issue?

I have the same problem, do you know how to clean this file?

I don’t. I hope to find out if many people are having this issue, and why this issue occurs. Is it my setup or is it an issue in Docker itself (I read somewhere that this could be an issue not related to HA itself, but more the Docker environment).
Anyhow, for me it is a bit annoying that every 2/3 months I have to reinstall HA completely because it is running out of disk space.

Started using HA more than a year ago and haven’t had any issues. However this has just started becoming one.

Hi everyone,
I also found out i have this issue.
I did what @clabnet recommended:

#/bin/bash
#Remove images not used by containers
docker image prune -a
#Remove containers not used on last 24hours
docker container prune --filter "until=24h"
#Remove volumes not used by containers
docker volume prune
#Check space used by logs
journalctl --disk-usage
#Remove journald log files
journalctl --rotate
journalctl --vacuum-time=1m

and removed several Gb from my disk…but overlay is still 3.6Gb.
I noticed I have two overlay mounted disks, eacho of them 4.8Gb. Maybe this is related?

1 Like

I tried all these, but the journal is no issue (only something like 300MB) and the docker commands do not remove anything for me.

The same issue. Overlay2 directory consumed about 14 GB. After issuing “ha su repair” it is reduced to 10.8GB. Docker purge commands do not clear anything.

image

And only the part of overlay2 directory:

There are 170 subdirectories inside that folder! I don’t know if I should mention that I have about 10 addons installed…

Same here. I’m on a Proxmox VM with HassOS. The overlay2 eats up 31.5 GB of storage.
The cleaning routine and ha repair only released a few GB.

same here overlay2 almost 10GB
nothing from this topic help :frowning:

Just to add, I’m in the same boat. Proxmox VM and the Overlay2 folder had swollen to 18GB. Have recovered some space using commands here, but it’s still 15GB and I’m running out of space.

Will keep an eye on this thread.

2 year old system.
Used
ha su repair

83gb cleared :laughing:

overlay2 increasing and killing my HAOS, nothing of the provided commands help: