Overview
Unlike most microcontroller projects that can simply be switched off when done,
computerslike the Raspberry Pi require an orderly shutdown procedure…otherwise
the storage card maybecome corrupted and the system will no longer boot.
There are situations where just pulling the plug would certainly be handy, like
slideshow or video kiosks, or systems left in the hands of non-technical users.
Fortunately recent Raspberry Pi OS releases have a configuration option to make
systems more resistant to unplanned power cuts.
The Concern
Linux—or any substantial computer operating system, Windows and Mac are the same
way—behind the scenes they’re frequently writing temporary data to disk (or the SD
card with Raspberry Pi).This is why we normally use the shutdown command: every
file is put away in a known validstate. But if power is unexpectedly cut, these
lingering half-files can render acard unbootable…one can try patchingit up, but often
there’s no recourse but to wipe the card and reinstall everything.
The Solution
Recent Rapsberry Pi OS releases have an option to put the /boot partition (where the
kernel image and other critical files reside) in a read-only mode.If software installed
on this system only performs reading and playback operations (e.g. aslideshow
kiosk(https://adafru.it/zrA), a Fadecandy(https://adafru.it/zrB) server, a Halloween
display(https://adafru.it/zrC)), then you can just unplug the system when done. It’s not
ideal for read/write tasks like databases, web servers or data logging, but it has a
place.
Before You Begin
This works with Raspberry Pi OS and close derivatives (e.g. RetroPie), but might
not work with other distributions.
Setting up read-only mode should be the very last step before deploying a
project. Get all your code and data on the system, get software auto-starting as
needed, test it normally with the usual boot and shutdown methodology. It’s
easier up-front. Once you’re 100% confident in its operation, then configure the
system for read-only boot.
•
•
©Adafruit Industries Page 3 of 8