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.
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.