Also, I would not have thought that random power off events would affect modern file systems as poorly as you're suggesting.
Interesting thoughts though.
Also, I would not have thought that random power off events would affect modern file systems as poorly as you're suggesting.
Interesting thoughts though.
https://learn.adafruit.com/external-drive-as-raspberry-pi-ro...
I've thought about the idea of having some super-capacitor based temporary power storage, and an interrupt that triggers a graceful shutdown if the power input goes down. I think it could be done with fairly basic circuitry.
For most <1 day outages, a simple USB power-bank with passthrough capability (output whilst also possibly charging) will happily keep the pi going, but without some frankenbodging there's no 'power lost' signal that the pi can sense. I've idly toyed with the idea of a phototransistor on the powerbank status LED and an attiny or something.
Now that I think about it, there was someone trying to make a supercap idea, but I don't think it went anywhere: https://www.indiegogo.com/projects/juice4halt-supercapacitor...
You can also echo a magic sysrq key (eg-"b") to /proc/sysrq-trigger. "e i s u o" would do the full graceful shutdown. This nicely asks processes to quit, kills (almost) everything, halts the system, syncs disks, and remounts fs ro before going down.
Or you could create a service with systemd to (run a script to) check when dbus gets a particular signal, like a network device being added or removed if an SSID disappearing was your indicator of power loss, then halt.
I'd probably just plug them into a UPS, though. Just have it send one of the shutdowns to the "master" when running battery power for longer than a few minutes.
Unfortunately, it's been over a year.