On Tue, May 26, 2020 at 1:27 PM Neil Bothwick <n...@digimed.co.uk> wrote:
> On Tue, 26 May 2020 19:14:18 +0100, antlists wrote: > > > > That's the Gentoo version that I'm using. But I'm looking for a way > > > to make it bullet-proof to having the plug pulled. > > > > Don't use an SD card? Seriously, pulling the power on an SD card has > > been known to corrupt it beyond recovery. BUT. > > Mounting the card with sync will significantly reduce the likelihood of > corruption, at a cost of reduced life. > > > Is the big worry that the home directory will get corrupted etc etc? I > > don't know if you can partition an SD card, but look at doing a > > kiosk-style install with the OS protected and read-only. Then look at > > sticking a loopback device on top of home, so that any changes exist > > only in ram, and are lost on shutdown. Hopefully, that means you now > > have a system that can boot and run off a write-protected SD card :-) > > This will mitigate the reduced life as you are hardly writing to the > card. Booting from a read-only / has caused problems for me in the past, > because of the inability to write to /etc. > Consider a hybrid approach like how many embedded systems do things. E.g. openwrt. /root is actually a read-only squashfs image, and on top of that there's an overlay fs that uses a second partition as it's backing storage. This way, almost all of your system is purely read-only, but you have the ability to store changes to things you need to store changes for.