# Free space on SD card?

**URL:** https://discourse.pi-hole.net/t/free-space-on-sd-card/47156
**Category:** Community Help
**Created:** [May 19, 2021, 2:52pm UTC](https://discourse.pi-hole.net/t/free-space-on-sd-card/47156 "2021-05-19T14:52:09Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Schnappa](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/schnappa/32/3477_2.png) [@Schnappa](https://discourse.pi-hole.net/u/Schnappa)
#### Post date: [May 19, 2021, 2:52pm UTC](https://discourse.pi-hole.net/t/free-space-on-sd-card/47156/1 "2021-05-19T14:52:09Z")

</div>

I have the same issue and the log says there would be no space left on the SD-card. But there is about 4 GB of free space! The issue suddenly appeared some days ago but I did not changed the setup of the Pi or copied large files.

[https://tricorder.pi-hole.net/3g5yjqi530](https://tricorder.pi-hole.net/3g5yjqi530)

---

<div class="post-metadata">

### Author: ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)
#### Post date: [May 19, 2021, 7:16pm UTC](https://discourse.pi-hole.net/t/free-space-on-sd-card/47156/2 "2021-05-19T19:16:24Z")

</div>

> [@Schnappa](#):
>
> But there is about 4 GB of free space!

How do you know this?

`2021-05-17 07:11:46: (mod_accesslog.c.180) writing access log entry failed: /var/log/lighttpd/access.log No space left on device`

What are the outputs of the following from the Pi terminal:

`df -h`

`ls -lha /etc/pihole`

`ls -lha /var/log/pihole*`

---

<div class="post-metadata">

### Author: ![Schnappa](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/schnappa/32/3477_2.png) [@Schnappa](https://discourse.pi-hole.net/u/Schnappa)
#### Post date: [May 19, 2021, 8:34pm UTC](https://discourse.pi-hole.net/t/free-space-on-sd-card/47156/3 "2021-05-19T20:34:47Z")

</div>

> How do you know this?

Because of df -h and RPI-Monitor. The latter shows 4.71 GB free on / at the moment and df -h this:

```auto
Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf
/dev/root 59G 54G 2,3G 96% /
devtmpfs 236M 0 236M 0% /dev
tmpfs 241M 1,3M 239M 1% /dev/shm
tmpfs 241M 6,5M 234M 3% /run
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 241M 0 241M 0% /sys/fs/cgroup
/dev/mmcblk0p1 43M 23M 20M 53% /boot
/dev/sda1 7,5G 3,7G 3,9G 49% /media/extern
tmpfs 49M 0 49M 0% /run/user/1000
tmpfs 49M 0 49M 0% /run/user/998

```

In wonder why there is a discrepancy between both tools which was not the case when I once compared both. It was some weeks ago, though.

Just now, when I writing this, the Pihole ran fine since I posted the question this afternoon. I have just opened the section "Tools" in the web interface and it suddenly showed this "undefined%" message and deleted the graphs. Nothing is written in the "Pi-Hole diagnosis" section.

---

<div class="post-metadata">

### Author: ![deHakkelaar](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dehakkelaar/32/674_2.png) [@deHakkelaar](https://discourse.pi-hole.net/u/deHakkelaar)
#### Post date: [May 20, 2021, 4:37am UTC](https://discourse.pi-hole.net/t/free-space-on-sd-card/47156/5 "2021-05-20T04:37:25Z")

</div>

> [@Schnappa](#):
>
> `/dev/root 59G 54G 2,3G 96% /`

Not related to the problem but its generally advised/best practice to expand storage if more than 80% full.  
This because file fragmentation will increase because there is no continuous diskspace available for larger files.  
And some operations like for example defraging needs the extra fee space.

---

<div class="post-metadata">

### Author: ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)
#### Post date: [May 20, 2021, 5:59am UTC](https://discourse.pi-hole.net/t/free-space-on-sd-card/47156/6 "2021-05-20T05:59:33Z")

</div>

What's the output of

> [@jfb](#):
>
> `ls -lha /etc/pihole`
> 
> `ls -lha /var/log/pihole*`

---

<div class="post-metadata">

### Author: ![deHakkelaar](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dehakkelaar/32/674_2.png) [@deHakkelaar](https://discourse.pi-hole.net/u/deHakkelaar)
#### Post date: [May 20, 2021, 1:16pm UTC](https://discourse.pi-hole.net/t/free-space-on-sd-card/47156/7 "2021-05-20T13:16:12Z")

</div>

Below is disk usage by Pi-hole (approximatly):

```auto
pi@ph5b:~ $ du -chs /usr/bin/pihole-FTL /etc/pihole/ /opt/pihole/ /var/www/html/{admin,pihole} /var/log/pihole*
12M /usr/bin/pihole-FTL
42M /etc/pihole/
236K /opt/pihole/
13M /var/www/html/admin
32K /var/www/html/pihole
0 /var/log/pihole
0 /var/log/pihole-FTL.log
60K /var/log/pihole-FTL.log.1
4.0K /var/log/pihole-FTL.log.2.gz
8.0K /var/log/pihole-FTL.log.3.gz
856K /var/log/pihole.log
812K /var/log/pihole.log.1
28K /var/log/pihole.log.2.gz
68K /var/log/pihole.log.3.gz
76K /var/log/pihole.log.4.gz
52K /var/log/pihole.log.5.gz
4.0K /var/log/pihole_updateGravity.log
68M total

```

Below how you can inspect particular folders:

> [@Can't tail pihole log](https://discourse.pi-hole.net/t/cant-tail-pihole-log/20761/5):
>
> Go hunt with the du tool: pi@noads:~ $ sudo du --max-depth=1 -h /var 35M /var/www 4.0K /var/tmp 4.0K /var/local 12K /var/mail 7.0M /var/log 651M /var/cache 1.9M /var/backups 144M /var/lib 36K /var/spool 4.0K /var/opt 938M /var

---

<div class="post-metadata">

### Author: ![Schnappa](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/schnappa/32/3477_2.png) [@Schnappa](https://discourse.pi-hole.net/u/Schnappa)
#### Post date: [May 20, 2021, 1:38pm UTC](https://discourse.pi-hole.net/t/free-space-on-sd-card/47156/8 "2021-05-20T13:38:54Z")

</div>

Here are the outputs. By the way, I opened the web interface for the first time today and it reports "Lost connection to api".

```auto
ls -lha /etc/pihole
insgesamt 482M
drwxrwxr-x 3 pihole pihole 4,0K Mai 19 22:42 .
drwxr-xr-x 115 root root 12K Mai 19 16:57 ..
-rw-r--r-- 1 root root 118 Jul 22 2020 adlists.list
-rw-r--r-- 1 root root 38 Mai 3 2020 black.list
-rw-r--r-- 1 root root 0 Dez 11 12:46 custom.list
-rw-r--r-- 1 pihole pihole 0 Mai 19 17:01 dhcp.leases
-rw-r--r-- 1 root root 618 Apr 23 21:00 dns-servers.conf
-rw-r--r-- 1 root root 18 Mai 19 19:21 GitHubVersions
-rw-rw-r-- 1 pihole pihole 31M Mai 19 22:42 gravity.db
-rw-r--r-- 1 root root 2,9M Mai 3 2020 gravity.list
-rw-r--r-- 1 root root 1,1K Apr 23 21:01 install.log
-rw-r--r-- 1 root root 1,6M Mai 19 22:39 list.1.raw.githubusercontent.com.domains
-rw-r--r-- 1 root root 95 Mai 19 22:39 list.1.raw.githubusercontent.com.domains.sha1
-rw-r--r-- 1 root root 403K Apr 23 21:02 list.3.sysctl.org.domains
-rw-r--r-- 1 root root 80 Apr 23 21:02 list.3.sysctl.org.domains.sha1
-rw-r--r-- 1 root root 521 Apr 23 21:02 list.5.s3.amazonaws.com.domains
-rw-r--r-- 1 root root 86 Apr 23 21:02 list.5.s3.amazonaws.com.domains.sha1
-rw-r--r-- 1 root root 43K Apr 23 21:02 list.6.s3.amazonaws.com.domains
-rw-r--r-- 1 root root 86 Apr 23 21:02 list.6.s3.amazonaws.com.domains.sha1
-rw-r--r-- 1 root root 8,4M Mai 19 22:39 list.8.www.github.developerdan.com.domains
-rw-r--r-- 1 root root 97 Mai 19 22:40 list.8.www.github.developerdan.com.domains.sha1
-rw-r--r-- 1 root root 688K Mai 19 22:40 list.9.www.github.developerdan.com.domains
-rw-r--r-- 1 root root 97 Mai 19 22:40 list.9.www.github.developerdan.com.domains.sha1
-rw-r--r-- 1 root root 20 Mai 20 15:30 localbranches
-rw-r--r-- 1 root root 45 Mai 19 22:41 local.list
-rw-r--r-- 1 root root 42 Mai 20 15:30 localversions
-rw-r--r-- 1 root root 234 Apr 23 21:00 logrotate
-rw-r--r-- 1 pihole pihole 2,6M Apr 23 21:00 macvendor.db
drwxr-xr-x 2 root root 4,0K Mai 11 2020 migration_backup
-rw-rw-r-- 1 pihole pihole 15 Apr 23 21:01 pihole-FTL.conf
-rw-r--r-- 1 pihole pihole 0 Mai 14 10:08 pihole-FTL.db
-rw-r--r-- 1 pihole pihole 434M Mai 14 00:50 pihole-FTL-old.db
-rw-r--r-- 1 root root 551 Mai 19 14:14 setupVars.conf
-rw-r--r-- 1 root root 564 Apr 23 21:00 setupVars.conf.update.bak

```

```auto
ls -lha /var/log/pihole*
-rw-r--r-- 1 root pihole 40K Mai 19 16:50 /var/log/pihole_debug.log
-rw-r--r-- 1 pihole pihole 346K Mai 20 10:18 /var/log/pihole-FTL.log
-rw-r--r-- 1 pihole pihole 869K Mai 20 00:00 /var/log/pihole-FTL.log.1
-rw-r--r-- 1 pihole pihole 42K Mai 19 00:00 /var/log/pihole-FTL.log.2.gz
-rw-r--r-- 1 pihole pihole 806K Mai 20 10:19 /var/log/pihole.log
-rw-r--r-- 1 pihole pihole 5,1M Mai 20 00:00 /var/log/pihole.log.1
-rw-r--r-- 1 pihole pihole 211K Mai 19 00:00 /var/log/pihole.log.2.gz
-rw-r--r-- 1 root root 2,5K Mai 16 04:49 /var/log/pihole_updateGravity.log

/var/log/pihole:
insgesamt 8,0K
drwxr-xr-x 2 pihole pihole 4,0K Mai 2 2019 .
drwxr-xr-x 7 root root 4,0K Mai 20 00:00 ..

```

---

<div class="post-metadata">

### Author: ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)
#### Post date: [May 20, 2021, 3:14pm UTC](https://discourse.pi-hole.net/t/free-space-on-sd-card/47156/9 "2021-05-20T15:14:56Z")

</div>

> [@Schnappa](#):
>
> ```auto
> -rw-r--r-- 1 pihole pihole 0 Mai 14 10:08 pihole-FTL.db
> -rw-r--r-- 1 pihole pihole 434M Mai 14 00:50 pihole-FTL-old.db
> 
> ```

What happend here? Did you modify your database?

```auto
   [2021-05-19 16:48:27.382 25034/T25036] Client denied (at max capacity of 255): 527
   [2021-05-19 16:48:27.383 25034/T25036] IPv4 telnet error: Success (0)
   [2021-05-19 16:48:28.404 25034/T25036] Client denied (at max capacity of 255): 527
   [2021-05-19 16:48:28.405 25034/T25036] IPv4 telnet error: Success (0)
   [2021-05-19 16:48:29.425 25034/T25036] Client denied (at max capacity of 255): 527
   [2021-05-19 16:48:29.426 25034/T25036] IPv4 telnet error: Success (0)
   [2021-05-19 16:49:00.504 25034/T25039] SQLite3 message: no such table: network_addresses in "DELETE FROM network_addresses WHERE lastSeen < 1589899740;" (1)
   [2021-05-19 16:49:00.507 25034/T25039] ERROR: SQL query "DELETE FROM network_addresses WHERE lastSeen < 1589899740;" failed: SQL logic error
   [2021-05-19 16:49:00.510 25034/T25039] SQLite3 message: API call with invalid database connection pointer (21)
   [2021-05-19 16:49:00.510 25034/T25039] SQLite3 message: misuse at line 165242 of [5d4c65779d] (21)
   [2021-05-19 16:49:00.512 25034/T25039] Error while trying to close database: bad parameter or other API misuse

```

* * *

There are other issues in your debug log as well

```auto
*** [DIAGNOSING]: Networking
[✓] IPv4 address(es) bound to the enxb827eb04f4e7 interface:
   192.168.100.100/24 does not match the IP found in /etc/pihole/setupVars.conf (https://discourse.pi-hole.net/t/use-ipv6-ula-addresses-for-pi-hole/2127)

    PIHOLE_INTERFACE=enxb827eb04f4e7
    IPV4_ADDRESS=192.168.0.100/24

```

---

<div class="post-metadata">

### Author: ![Schnappa](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/schnappa/32/3477_2.png) [@Schnappa](https://discourse.pi-hole.net/u/Schnappa)
#### Post date: [May 20, 2021, 4:37pm UTC](https://discourse.pi-hole.net/t/free-space-on-sd-card/47156/10 "2021-05-20T16:37:09Z")

</div>

I created a new database with the help of this post:

[https://discourse.pi-hole.net/t/percentage-blocked-blinking-undefined/46792/8](https://discourse.pi-hole.net/t/percentage-blocked-blinking-undefined/46792/8)

I did not change anything else. I don't know what causes the issue with the IPv4 address.

---

<div class="post-metadata">

### Author: ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)
#### Post date: [May 20, 2021, 6:47pm UTC](https://discourse.pi-hole.net/t/free-space-on-sd-card/47156/11 "2021-05-20T18:47:35Z")

</div>

> [@Schnappa](#):
>
> ```auto
> ls -lha /etc/pihole
> insgesamt 482M
> 
> ```

So Pi-hole is occupying ~500M of space.

Compare this to:

> [@Schnappa](#):
>
> `/dev/root 59G 54G 2,3G 96% /`

Whatever consumes \>50G of space on your file system isn't Pi-hole.

You probably should start looking at your other software.  
Next to RPiMonitor, it seems you are running some kind of remote syncing software?

```auto
*** [DIAGNOSING]: Ports in use
*:51164 rslsync (IPv4)
*:51164 rslsync (IPv6)
*:8888 rslsync (IPv4)
*:8889 rpimonitor (IPv4)

```

---

<div class="post-metadata">

### Author: ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)
#### Post date: [May 20, 2021, 6:50pm UTC](https://discourse.pi-hole.net/t/free-space-on-sd-card/47156/12 "2021-05-20T18:50:57Z")

</div>

> [@Schnappa](#):
>
> I did not change anything else. I don't know what causes the issue with the IPv4 address.

Did you set a static IP address on your device hosting Pi-hole? Or made a DHCP reservation for this device on your router?

To correct for the changes IP address run `pihole -r` and choose `reconfiguration`.

---

<div class="post-metadata">

### Author: ![Schnappa](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/schnappa/32/3477_2.png) [@Schnappa](https://discourse.pi-hole.net/u/Schnappa)
#### Post date: [May 20, 2021, 6:53pm UTC](https://discourse.pi-hole.net/t/free-space-on-sd-card/47156/13 "2021-05-20T18:53:37Z")

</div>

I know what is occupying the space, it is Resilio Sync, but I don't know why Pihole reports there were too little disk space when there is enough. I have Pihole running for years and there were many situations where less disk space than 2 GB left. So, why does it not work anymore now?

---

<div class="post-metadata">

### Author: ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)
#### Post date: [May 20, 2021, 7:14pm UTC](https://discourse.pi-hole.net/t/free-space-on-sd-card/47156/14 "2021-05-20T19:14:46Z")

</div>

```auto
*** [DIAGNOSING]: contents of /var/log/lighttpd

-rw-r--r-- 1 www-data www-data 20365 May 19 16:48 /var/log/lighttpd/error.log
   -----head of error.log------
   2021-05-17 07:11:40: (mod_fastcgi.c.2543) FastCGI-stderr: PHP Warning: Unknown: write failed: No space left on device (28)

```

Pi-hole or rather _`lighttpd`_ is just reporting what your OS returns: "_No space left on device_" indicates that the OS reported it cannot fulfill a write request.

There may be a multitude of reasons for that, e.g. because it run out of free blocks, or it exhausted its inode pool, or the mount you are writing to actually points to a smaller device, or it exceeded some quota, or...

The common solution would be removing unused files to free up disk space.

---

<div class="post-metadata">

### Author: ![DanSchaper](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/danschaper/32/91_2.png) [@DanSchaper](https://discourse.pi-hole.net/u/DanSchaper)
#### Post date: [May 20, 2021, 7:14pm UTC](https://discourse.pi-hole.net/t/free-space-on-sd-card/47156/15 "2021-05-20T19:14:55Z")

</div>

> [@Schnappa](#):
>
> So, why does it not work anymore now?

Because it's out of space.

---

<div class="post-metadata">

### Author: ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)
#### Post date: [May 20, 2021, 7:17pm UTC](https://discourse.pi-hole.net/t/free-space-on-sd-card/47156/16 "2021-05-20T19:17:04Z")

</div>

> [@Schnappa](#):
>
> ```auto
> -rw-r--r-- 1 pihole pihole 0 Mai 14 10:08 pihole-FTL.db
> -rw-r--r-- 1 pihole pihole 434M Mai 14 00:50 pihole-FTL-old.db
> 
> ```

This isn't going to help your free space issue. You have the old database (which will never change) at 434 MB, and now you are growing a new database that will eventually grow to about the same size.

---

<div class="post-metadata">

### Author: ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)
#### Post date: [June 10, 2021, 7:32pm UTC](https://discourse.pi-hole.net/t/free-space-on-sd-card/47156/18 "2021-06-10T19:32:57Z")

</div>

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