9

Is there any Raspberry Pi Live Boot or Read Only Distros available? I was wondering, since the EE stack exchange normally gets some questions regarding safe power disconnect on the RPi, if such a distro existed. There are many Linux distros that come on Live Boot Cds or flash drives, which unpack from the cd and run completely from memory (One I'm personally familiar with was DamnSmallLinux, another being BackTrack). Most embedded systems in consumer products are also run almost entirely on ram disks, to the point they go entire boot cycles without writing a single thing to flash.

The main goals being
1) to prevent file corruption on the SD card if power is lost unexpectedly, without having to rely on UPS or Battery solutions.
2) running programs from boot to shutdown (or power loss) that need no writing to the sd card.

So is there any such Targeted to the RPI distro, or any groups planning to make one?

cde
  • 301
  • 1
  • 2
  • 11
  • What happens when you use the protect switch on the SD card? – John La Rooy Apr 18 '13 at 20:58
  • 3
    @gnibbler As far as I know, the write protect pin isn't used in the RPI. Pin 13 of the sd card socket is left unconnected. And simply running a standard distro in read only mode isn't that simple even if it were connected. – cde Apr 18 '13 at 21:12
  • The Raspbian can do this out of the box: https://learn.adafruit.com/read-only-raspberry-pi#enabling-read-only-slash-boot-2871480-5 – andras.tim Apr 27 '22 at 00:56

5 Answers5

7

Yes there is; my project Nard SDK
http://www.arbetsmyra.dyndns.org/nard/
does exactly what you want. It's a minimal OS which runs entirely from RAM. After bootup one can even remove the SD card and it will continue run just fine. During system upgrade it has preventive actions against power cut in the middle of the upgrade.

N ot A nother R aspberry D istribution is a GNU/Linux based software development kit (SDK) written from scratch for the Raspberry Pi family of boards.

cde
  • 301
  • 1
  • 2
  • 11
Ronny Nilsson
  • 898
  • 5
  • 13
2

You can use TinyCoreLinux shown here. It runs entirely from RAM, but can store settings/files/apps on demand. At the moment of writing this one was the latest with just command line and SSH, having a little more then 18MB zipped. Versions having X in it's name are with GUI. And yes, there are QEMU (virtual machine) images to try too. There are many packages ready to be installed, and you can also make your own or install from source.

avra
  • 1,273
  • 8
  • 9
1

One solution (untested) would be to use Raspbian, but instead of directly mounting the filesystem from the sd card as / (root), you would mount it in some folder, say /readonly, with -ro option (mount -o ro /dev/mysdcardpartition /readonly), create a directory /readwrite, then mount a unionfs as / using /readonly for the readonly part and /readwrite for the read-write part.

Note all this needs to be done very early during the boot, and you'd better have a reasonable understanding of the linux boot process before you attempt that.

This is basically what most livecds do, except that they mount from a squashfs or similar image of the disk instead of using a real partition.

You can probably find some information on the internet on how to make a livecd from an existing debian installation, and if you need help doing the steps I described above, you'll get more answers by asking on stackoverflow or superuser as these steps aren't specific to the Raspberry Pi.

Edit: It seems the linux kernel for the Pi (at least raspbian's kernel) expets the SD card to be always there, so you may have a few problems if you try to remove the sd card after boot, see this post on http://www.raspberrypi.org (I haven't read the whole thread, so I don't know if there's a solution).

Suzanne Soy
  • 249
  • 1
  • 5
0

Puppy linux for raspberry pi. Testing it now. Called rasppuppy, runs in RAM, and at your discretion may save sections on sdcard.

m33600
  • 61
  • 6
0

One image that fits your description is Industrial Perennial Environment. It doesn't run completely from memory, but does mount the SD card read-only and provides a few tools to work with the read-only file system. There are actually two branches: a version based on buildroot with a focus on pre-built embedded systems without much flexibility and a version that's just a (stripped down) Raspbian flavor and thus can be used like most Pi's if you install additional packages and learn to work around the read-only property. The Raspbian version is officially deprecated, but it was recently updated anyway.

Another Code
  • 138
  • 6