PiHole with Balena - RPi SD Card dying

Hey Guys,

Just a quick post as I’ve been running some Pi at home using the PiHole for balena projet

It’s the second SD card now that becomes unwritable after a while - so I wanted to check to see if there would be anyone else in the same situation as me.
I’m suspecting Pihole to maybe write too much to the card, which ultimately kills it. (I haven’t tried yet on a third card while deactivating all sorts of logs).

But yeah, is it just me?
And, would there be a solution?


Hi there, could you be a bit more specific about the problem you’re having?
Are you having issues flashing the SD card with balenaOS, pushing the application or is it an issue at runtime?

Sure :slightly_smiling_face:

So basically, after few months, if I want to push an update (say upgrade pihole base) to the Pi, it pushes and indicates successfully downloading on the Pi, but never succeeds in reloading things (it loops on the install/restart). If I shutdown and restart the Pi, I’m back on the older commit and the loops starts again as it tries to install the latest commit.

I tried to re-flash the card with etcher, then I get an error that i can’t write on the card / or sometimes it writes, but when I boot up the Pi, it’s actually still the old one there (basically nothing happened)
Tried disk utility on mac, diskutil, dd, etc impossible to delete any of the partitions from the SD card to completely clean the SD card before etcher burn.

I tried the SDcard software from sandisk and it gives me a defective sector error. On some forums people seem to say that this is a typical dead SD error.

If I take a new SD card, flash with etcher, boot up and load the last commit, all works again.
Thus my assumption about the is card reaching max write cycles sometime with PiHole.

I never had this issue using balena and other apps.

It could be that the SD card reached its limit then, yes, even more so if it was working before.
Just to double check: does the new SD card have the latest version of the application whilst still working? Is the power supply enough/stable?
Generally, we suggest using SanDisk Extreme Pro SD cards as we had good reliability results while using it.
You can also check dmesg in search for storage failure logs.

If you want, we can check the device for you, but if the new SD card works in the same environment, I think it’s probably what you noticed (card usury), although i doubt it’s due to the application itself as the only two services are both for config purposes as far as I can tell.

does the new SD card have the latest version of the application whilst still working?
=> so the card that died, was still working, it’s the update of the app that made me discover that I couldn’t write to it anymore. Seems that PiHole can still sort of operate when running on a read only card (once it is all loaded up).

Is the power supply enough/stable?
=> Hm, It’s a 2A adapter, but maybe I should get something a little more beefy.

You can also check dmesg in search for storage failure logs.
=> I’ll check if I find something :slight_smile:

SanDisk Extreme Pro SD cards
=> Gonna order one, thanks for the recommendation. The two cards I had were Adata UHS-1 class 10 64GB cards. They are definitely not last gen, but for sure cheaper than the one you mention :slight_smile:

I’ll try again with the new card and a better adapter. (thanks black friday!) and if I’m not back in a few months, then it means it worked out!

Thanks for your insights!