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?
3 Answers
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:
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
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.
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
-
tinycorelinux.net appears to be dead, at least temporarily. 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
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/
tmpfs
.