We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

Read-only Raspberry Pi script: how to secure a micro SD card so nothing can be written to it

By Russell Barnes. Posted

Read-only Raspberry Pi script: how to secure a micro SD card so nothing can be written to it

Advertisement

Introducing the smarter desktop: use cloud apps, thin clients, and get real work done on a Raspberry Pi. Also in the magazine we’re building a digital jukebox, controlling a robot arm, storing…

or free PDF download

If you’ve ever built a Pi for a kiosk, installation or information display, you’ll find Adafruit’s read-only Pi script invaluable. This script disables all the write-to-SD-card functions, meaning that you can pull the plug without any risk of data loss or corruption.

The Adafruit script forces Raspbian to store all its temporary data in memory, so no data stored on the SD card can be corrupted. This also means that nothing at all can be written to the SD card.

Adafruit Script puts Raspberry Pi in read-only mode

Script author, and Adafruit Creative Engineer, Phillip Burgess tells us, “We’re seeing Raspberry Pi really take off in situations where a microcontroller may have once sufficed,” and points out that less technical users are making things with a Raspberry Pi. Phillip wanted the ability to simply cut power like one does with an Arduino or a consumer product.

Phillip’s script includes ways to disable read-only mode, by use of a jumper or quick button connect

The script only works on Lite installations – “Stretch or Jessie should work,” Phillip tells us – and you can find the full instructions at Adafruit.

Russell Barnes photo

Russell runs Raspberry Pi Press, which includes The MagPi, Hello World, HackSpace magazine, and book projects. He’s a massive sci-fi bore.

Subscribe to Raspberry Pi Official Magazine

Save up to 37% off the cover price and get a FREE Raspberry Pi Pico 2 W with a subscription to Raspberry Pi Official Magazine.

Subscribe

Sign up to the newsletter

Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.