Re:Mmm, Pi-hole
by jschwartzi on Wednesday September 26, 2018 @11:28AM
(#18076919)
Use a different root filesystem. Ext4 is not robust against power loss, as I've discovered in multiple embedded Linux systems where Ext4 was used.
The best filesystems for robustness against power loss seem to be log-structured filesystems like YAFFS2 or QNX's ETFS. The design of the filesystem basically means that a block is never modified on flash, only obsoleted by future writes. The trade-off is that the filesystem has to be reconstructed from the raw blocks at power-on but it's incredibly robust. And the filesystem also has to be garbage-collected before additional writes can be performed. But as long as you run your filesystem below capacity this isn't a big deal.
Back in the day (also before ext4) we solved this by mounting the root filesystem read-only. Depending on any other application for the machine, you may not need filesystem writes at all once it is set up. Bonus: itβs even friendlier to the flash.
Re:Mmm, Pi-hole
by jschwartzi on Wednesday September 26, 2018 @06:37PM
(#18080855)
This is how I've solved the problem in the past. Too bad systemd discourages this. It also doesn't protect the partition where your database and log files are kept.
Re:Mmm, Pi-hole
by _emacsomancer_ on Wednesday September 26, 2018 @11:07PM
(#18081879)
I'm running a Rpi with 64bit kernel & runit as init via Void Linux, so you're not necessary stuck with systemd as the only option for Rpis.
Re:Mmm, Pi-hole
by freeone3000 on Wednesday September 26, 2018 @11:03PM
(#18081862)
Yet another reason to not run systemd. (Also, systemd? On a router? That's excessively overkill. Why not a sane init, like SysV?)
Re:Mmm, Pi-hole
by jschwartzi on Wednesday September 26, 2018 @11:19PM
(#18081922)
You're assuming I make routers.
Re:Mmm, Pi-hole
by _emacsomancer_ on Wednesday September 26, 2018 @11:08PM
(#18081882)
Do you use YAFFS2 or ETFS on a raspberry pi? I'd be interested to know more about setting something like this up.
I got cheap SSDs in cheap USB cases for my 2 Pis after getting annoyed with SD corruption. SSD prices have dropped recently after being flat for a long time. If you are really cheap the cases often go for $1 or free after rebate at newegg.
Pi-Hole is a drop in replacement to an existing network setup that doesn't require hacking your router to install a custom firmware. It will also persist router upgrades.
My only gripe with Pi-Hole, which isn't their fault really, is that power losses can quickly corrupt the Raspberry Pi's SD Card. I have my network gear on a battery backup but when I was first validating Pi-Hole I had it sitting on my desktop and managed to corrupt the SD card with power drops.