A couple of weeks ago, I opened this issue. Basically, the issue is that after a couple of months of use, the SD Card is dying and I'm unable to update Pi Hole and/or the underlying operating system either. It's the second time it happen in 2 years.
The network behind the Pi Hole has ~35 devices and the Pi Hole had ~6 millions blocked hosts.
I'm opening a new issue to gather feedback and good practices tips on how to install a Pi Hole and make sure it will still continue to work properly in the long run.
With 35 devices on the network, you can imagine that there's a lot of logs. But honestly, I don't need the logs, I just need a clean network So, I'm trying to gather the options that I have here.
Tomorrow I'm going to buy a new SD Card and reinstall a fresh Raspberry Pi OS instance and then re-install Pi Hole.
What would you advise to avoid hammering on the SD Card when using Pi Hole?
Use a good quality power supply of adequate size. This includes both the power supply and the cable you use to connect the power supply to your Pi. Inadequate power is the leading cause of premature SD card failure. Without adequate power, writes to the SD card may not be completed properly.
Use high quality SD cards with plenty of space. They don't have to be specific high endurance cards. I have had great success over 5+ years with SanDisk Ultra cards, 32 GB. Zero failures on multiple Pi's running 24/7. The reason you want to use larger SD cards is that this provides a larger wear surface for writes.
I have about 40 devices on my network. The logs are driven partly by the number of clients, but more by the number of queries from those clients. If you have a poorly behaved client repeatedly requesting a blocked domain, that will drive more log entries.
My 40-ish clients made 55K queries in the past 24 hours. I suspect this is typical for a network that size.
Note that Pi-hole is not the only software running on your Pi that writes to the SD card. The OS itself makes entries in various logs, etc.
I've always been using the default power transformer shipped with the Pi bundle and also very good SD Cards quality. The PI only runs Pi Hole and a wireguard server for VPN, I don't even need XWindow and all these stuff.
I usually do the updates once a week, maybe it was too much? Don't know.
Regarding the OS, I was wondering if having /var/log/, /var/tmp and /tmp as tmpfs, that would reduce the SD Card writes operations. WDYT ?
When I add FTLCONF_DBFILE=, the resulting pihole-FTL.conf is:
#; Pi-hole FTL config file
#; Comments should start with #; to avoid issues with PHP and bash reading this file
PRIVACYLEVEL=0
LOCAL_IPV4=192.168.2.10
REPLY_ADDR4=192.168.2.10
RATE_LIMIT=1000/60
declare=-x FTLCONF_DBFILE=""
Ah yes, I guess the environment variable handling needs a special case for this valid empty configuration (@DL6ER , could FTL be modified to accept an explicit none/false value here?)