7

Can an OS on Raspberry Pi run with a write-protected SD card? Or is there anything that requires write-access to the SD card when the OS is being used?

5
  • Linux can run from a read-only root file system. Files that need writing could be put in a RAM-based file system, e.g. tmpfs.
    – Ghanima
    Commented Dec 17, 2015 at 18:04
  • logs, cache, fake hardware clock etc. will need write access. You may want to look at this question raspberrypi.stackexchange.com/questions/5112/… Commented Dec 17, 2015 at 18:05
  • adding to what @Ghanima mentioned (re: tmpfs) you can also create a writeable FS on a flashdrive, another SD card or external HD. Commented Dec 17, 2015 at 18:08
  • 1
    "Snappy Core Ubuntu" for the pi runs read-only by default.
    – goldilocks
    Commented Dec 17, 2015 at 18:22
  • If this is for security purposes, note read-only on SD cards is only a software-based request and compare to your situation. It may still be appropriate.
    – Chris H
    Commented Dec 18, 2015 at 8:56

3 Answers 3

7

The short answer is yes, Linux and by extension, the RPi can be run from a read only SD card, but some things do need the ability to write and then later read from somewhere.

To set up what you're asking for, you have a couple options:

  1. You can setup linux so that the sections of the filesystem that need to be writeable are mounted to tmpfs. This will put all the filesystem writes into a RAM disk.

    The benefits of this solution is that they may speed up your RPi, especially on slower cards, but you will lose information on reboot. This may or may not be a problem based on your setup, but a UPS could significantly reduce the possible impact

  2. Some people prefer that their Pi boots from the SD card, and then loads the OS from a flash drive or eHDD. This will significantly reduce writes to the SD card, and will retain information between reboots. Performance will vary pretty wildly based on the USB device, but it's a viable option.

The details on how to setup either of these is out of the scope of this site, but you should be able to find a tutorial for either fairly easily on Google.

3

Try piCore OS, a Tiny Core Linux based rpi distribution.

Its a special linux distribution that runs from RAM and it needs an sdcard for booting and reading the settings only (read only). You can reboot the pi any time with no risks of corrupting the sdcard.

Heres a link to 6.0 release: http://forum.tinycorelinux.net/index.php?topic=17945.0

2
  • tinycorelinux.net appears to be dead, at least temporarily.
    – Jacobm001
    Commented Dec 18, 2015 at 16:45
  • @Jacobm001 Unfortunately the site is sometimes down, however its very active and has frequent releases. At the moment is up. Commented Dec 26, 2015 at 20:51
2

Nard SDK uses the SD card only during boot and then runs entirely from RAM. It's designed for remotely located long-lived embedded systems.
http://www.arbetsmyra.dyndns.org/nard/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.