Disk almost full

I found the root cause of the large files (by mounting the SD to my mac and using this article: https://www.jeffgeerling.com/blog/2017/mount-raspberry-pi-sd-card-on-mac-read-only-osxfuse-and-ext4fuse

image

image

It is definitely the Unifi database and tmp repair database files. So now it is about pruning the database from hassio, how can I do that? Can I access the container SSH into the docker container? Unfortunately I cannot remove files directly from the SD via the mac

1 Like

Did you find a solution to this? Really need to prune my unifi library from hassio

Hi there,

I was wondering how did you delete those folders form the Unifi add on, because I am running into the same issue propably. My free disk space is almost 0 :cold_sweat:.

But I can’t find the folder on the SD card for some reason… any help would be apreciated.

I am trying to remember how I solved this issue, but cannot immediately remember now.

Unfortunately I can’t find where the the disk space is used in my system. I have used the “docker system prune” command but that didn’t make any difference unfortunately.

In portainer I see a lot of “unused” images, but can these be deleted without any problems? i.e. homeassistant/raspberrypi3-homeassistant:0.114.4 is this this the install file from HA?
For now I deleted some backups to free some space.Someone who can help me with this?

image

Have you checked disk space via host’s terminal? For example by this command (by defining the path you can get more specific folder/file):
du -h / --max-depth=1

For me, most of the times, the docker logs are the culprit which eats the disk space. If that’s your case as well, then you can wipe them by:
find /var/lib/docker/containers/ -type f -name "*.log" -delete

I don’t think the docker images are supposed to grow indefinitely. In my case the database file has never been a problem, it is tiny and correctly auto pruned every 10 days.

So, is there any way at all to clean up Home Assistant, rather than re-installing everything from scratch?

It is a default setup, I can’t be the only one with this problem.

Created a full snapshot, reinstalled the HASSOS VM (giving access to 4 CPU cores instead of only 1), restored the snapshot. Now the system takes 2GB less (with same full original database, same everything).

Is there any way to “see the files” within a container? To allow debugging if it happens again :slight_smile:

Edit: You can do this by:
1) Opening the main HASSOS terminal
2) Enter as root and no password
3) Run “login” (that’d go from the ha> terminal to the # terminal)
4) cd /

Then use “du -d1 | sort -n” to find the largest folders in each directory. Check /mnt/data/logs and /mnt/data/docker/overlay2

2 Likes

Hello,
I don’t know what is causing this, but I am having a HUUGE disk space problem.
I have actually an 120 GB SSD that I use only for homeassistant running inside Docker and today I saw the notification that no space is available.
I was able to track the problem with
du -sh – * | sort -hr
to docker/containers and there the homeassistant container has 80Gb!!!

I installed portainer but I can’t see anything wrong.
So I guess something is writing like crazy inside homeassistant.
How can I fix it or at least find the cause.
I will try to do a snapshot so in the case it fails I can reinstall homeassistant and reload the snapshot.

Hi!

I was having the disk usage problem. However, in my case, with du command i could only see 5gbs used of my 128gb microSD. One of the previous comments mentioned that the Unifi controller could cause the problem so I uninstalled it and solved the problem! I have now more than 100gb free! I will now install the add-on again and see what happens

Thanks for your comment. This did the trick also for me

Glad it worked for you too!

I have tried to reinstall the Unifi add-on but it does not start :frowning:

Well, this happened again and I don’t want to reinstall, nor increase disk size.

The following post helped me to regain a couple GBs. Good luck! :smiley:

12/feb/2021: Check out this as well, though it may be obsolete.

2 Likes

I have to do it also every few months : remove all unused stuff by Docker.
Maybe that should be done automatically after a sucessfull update. Maybe it is done for some part but not for others (community addons ?, …).
I will try to have a look at what I delete next time I’ll do it. But I agree with you : disk usage keeps going up when you keep a fully updated HassOS system.

1 Like

That’d be great! Which command/s do you use BTW?

docker image prune -a

2 Likes

Another problem is that journald.conf has default parameters that can’t be changed easily:

The consequence of these parameters are very large logs (>10% of the disk with a max of 4GB).

It’d be very nice to be able to set custom options for journald. For now, it seems periodic cleanup is our only choice!

May 2022 update: Most of these issues have been fixed, database is now optimized and HASS cleans things automatically :smiley:

SOLVED: I found my huge disk space usage in the supervisor container in HA!

My Disk space on home-assistant has been increasing over time - and currently GLANCES and “df -h” is showing 65% space are being used when checking in the “SSH-Terminal”-add-on in HA.

image

However, “du -hsx /* | sort -r” only shows MUCH LESS usage in the filesystem:

image

I was not able to find where all this disk-space went , even after reading every article in this forum and others I could find.

Finally I tried to login to to “supervisor-container” in portainer (which I believe is the “base-container” all others dock onto):

I removed “hidden containers”:

Then I logged into the shell of the “supervisor”-container:

A “du -sxh /*” showed a massive amount of disk space (54.4G) to be used in the “/data” folder:

Within the “/data”-folder I would see that “/data/addons” and “/data/tmp” where the most used:

Digging deeper I could find that in “/data/tmp” the main usage went into INFLUXDB:

I could find a similar high usage on INFLUXDB (and MARIADB) in “/data/addons/data/*”:

I hope this will help you to also identify the disk-usage within your HA installation.

Now I have to find why INFLUXDB is taking up so much space, how to clean it up , and how to schedule such a cleanup (or configure the data collected in a more fine-grained manner).

Please let me know if this is / was helpful - or if you found better ways in finding the used space in HA.

3 Likes

Excellent info here!
I did a:
docker exec -it hassio_supervisor bash

I also had my drive almost full, and using these information I did find the culprit: an old install of Music Assistant (from HACS) which I removed some time ago, but left a 60Gb “.gz” file in “/data/tmp”

1 Like

Great info. Thanks!