Disk getting full, can't free space

The issue I am facing:

My system is still working, but the disk is over 90% full (3 GB on a 4GB SD card). I found some support online that suggested running pihole flush and setting MAXDBDAYS=14, which I've done. I also found another thread that said doing that should purge the logs after some time.

But it's been several hours and I’m still over 90% full. The largest files are:

607M	/etc/pihole/pihole-FTL.db
102M	/var/lib/snapd/snaps/docker_801.snap
100M	/var/swap
97M	/var/lib/snapd/cache/ed375954292cc3d5ca1cf58a83fd8b9703b27d02a642c4b472d98e76fdca82a9d00c39112da58530a249e8e63cb43b27
92M	/var/lib/snapd/snaps/docker_1126.snap
85M	/var/lib/snapd/snaps/core_11997.snap
85M	/var/lib/snapd/snaps/core_11802.snap
85M	/var/lib/snapd/cache/14d0b7f157340c555d05b44cdc1310b0b463a550f8b0d26466e7f8a10cc5d76fbf7f655eb3481925e37d840b30ec4ff2
84M	/var/lib/snapd/cache/56228950749624147bfeb4f5e50f91a0e4b0879fe4c57bbe5e6b23e932c0c4bfee2fd86ff41f08f95da07e2e45accc8b
66M	/var/lib/apt/lists/raspbian.raspberrypi.org_raspbian_dists_buster_main_binary-armhf_Packages
62M	/snap/docker/801/bin/dockerd
57M	/snap/docker/1126/bin/dockerd
53M	/snap/docker/801/bin/docker
47M	/snap/docker/1126/bin/docker
46M	/var/lib/snapd/snaps/core18_2288.snap

Details about my system:

$ echo ">stats >quit" | nc localhost 4711
domains_being_blocked 97346
dns_queries_today 13814
ads_blocked_today 0
ads_percentage_today 0.000000
unique_domains 2191
queries_forwarded 12327
queries_cached 1440
clients_ever_seen 22
unique_clients 22
dns_queries_all_types 13814
reply_NODATA 3248
reply_NXDOMAIN 264
reply_CNAME 5298
reply_IP 3969
privacy_level 0
status disabled

What I have changed since installing Pi-hole:

Nothing but occasionally updating.

Is there anything else I can try?

For a system using the standard apt package manager, I'd usually recommend to clean the apt package cache by any unused versions of downloaded packages or completely, which will often free a few hundred megabytes.

In your case, your disk utilisation suggests that Ubuntu's proprietary snap packet manager would claim about 270 MB for caching.
I'm not familiar with snap, but I assume that it would also offer a way clearing its cache.
You should consider Ubuntu's support forums for details.

Note that this option doesn't control file size directly - it rather defines the maximum retention period that Pi-hole will store in its database.

If your Pi-hole would process a million evenly distributed queries in 28 days, the file would grow large enough to hold about 500,000 entries for your 14 days.
And if your Pi-hole would process those million queries in an hour, the database size would still grow proportionally for the full amount.

So while your option will result in the database holding only the data for the last 14 days (and thus may well prevent a fresh database file to not grow over a certain limit), it won't change the size of a database file that has grown to a certain size already.

You could instruct SQLite3 reduce its database file size by using the following commands:

sudo systemctl stop pihole-FTL.service
sudo sqlite3 /etc/pihole/pihole-FTL.db "VACUUM;"
sudo systemctl start pihole-FTL.service
1 Like

Huh, it's just Raspbian, I thought that was just Debian. But thanks for the tips! Alas, vacuuming resulted in Error: database or disk is full. I'll have to find a way to make more room to allow it to finish.

Ubuntu and Raspbian would both be based on Debian.

I wasn't assuming you'd run Ubuntu, though - rather that you are using Ubuntu's or rather Canonical's snap package management tool, which is available for some Linux distributions apart from Ubuntu itself.
Perhaps you've installed snap when follwing some guide to install additional software on your system (maybe Docker, if we go by your above output)? :wink:

You might consider a bigger card. A 32GB is quite inexpensive. It has plenty of room and likely greater lifespan due to increased write locations for wear leveling.

If you don't mind losing the data in the query database, you can delete it and start a new one.

Run these commands.

sudo service pihole-FTL stop

sudo rm /etc/pihole/pihole-FTL.db

sudo service pihole-FTL start

Honestly I don't remember how I built this Pi Hole. I’m pretty sure I followed the directions on the website, but if it told me to install the latest Raspbian and then install Pi-Hole, or if it gave me a whole ready-made image, I don't recall.

Yeah, that's probably fine. I only ever look at the query log to see if a blocked request is breaking a website I'm trying to use. Thanks!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.