User avatar
Seb.26
Posts: 29
Joined: Mon Jul 07, 2014 12:06 pm

simple RO headless pi zero system

Tue Sep 04, 2018 8:43 am

Hi world,
I have build a small camera system based on a PI zero + Camera v2.

I want to make it a true read-only system the simplest way, no more update needed, no file writing ...

I'm using the last Strech version and all tutorials are about 'overlay'.

Can't I just use simple way like :
> disable swap
> mount some files in ram disk (logs & cie)
> make SD card read-only

Is there a tutorial about RO system for Raspian Strech version ?

Thanks.

User avatar
thagrol
Posts: 1402
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: simple RO headless pi zero system

Tue Sep 04, 2018 1:05 pm

I've had success with this: https://learn.adafruit.com/read-only-raspberry-pi/

Does what you're asking for.
Note to self: don't feed the trolls

If I've asked you a question, please answer it. I'm unlikely to be able to help without that information.

User avatar
Seb.26
Posts: 29
Joined: Mon Jul 07, 2014 12:06 pm

Re: simple RO headless pi zero system

Tue Sep 04, 2018 1:51 pm

I will try this, thanks for your help.

User avatar
Joel_Mckay
Posts: 288
Joined: Mon Nov 12, 2012 10:22 pm
Contact: Website

Re: simple RO headless pi zero system

Thu Sep 06, 2018 9:01 am

Indeed, I put together a gpu mate desktop Raspbian Stretch pi3 kernel version with Overlay, AUFS, and the vc4 core bug fix.
https://sourceforge.net/projects/microm ... -pi/files/
(there is still that flash & gpu enabled VLC plug-in bug that requires restarting midori once)

> disable swap
not a good idea for users given the ram drive fills quickly, but I simply moved the swap file into a user partition
(The OS / and /boot is read-only)

> mount some files in ram disk (logs & cie)
already done, keep in mind you'll need to modify several processes (mostly systemd related)

> make SD card read-only
While the program is compiled in this OS, it doesn't really allow easy updates

You could easily modify the scripts for your setup with:
1. remount the os in RW mode
2. cp -R /home/pi /root/pi
3. apt-get remove purge dphys-swapfile
4. unmount /home
5. mv /root/pi /home/pi
6. comment out /home mount in /etc/fstab*
7. edit RO/RW mount shell scripts in /opt to support card (un)locking (the sdcard program is in /usr/local/ )
8. reboot in RO

Be aware you will have about 40MB of changes in /home before the system runs out of ram.
However, I'm sure you can rebuild the ramdisk file for your needs, and start purging files you don't need to make the OS smaller.
;-)

Best of luck,
~J~

User avatar
HawaiianPi
Posts: 3765
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: simple RO headless pi zero system

Mon Sep 10, 2018 10:34 am

You might want to take a look at Tinycore Linux for the Pi. http://tinycorelinux.net/ports.html

It runs entirely from RAM, so no writes to the SD card.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

rln
Posts: 170
Joined: Wed Apr 09, 2014 1:43 pm
Location: Sweden
Contact: Website

Re: simple RO headless pi zero system

Tue Sep 18, 2018 9:48 am

HawaiianPi wrote:
Mon Sep 10, 2018 10:34 am
It runs entirely from RAM, so no writes to the SD card.
Another ramdisk distro alternative is my Nard.
http://www.nard.se/
Author of the robust Nard distro http://www.nard.se

Return to “Advanced users”