All Projects → JasperE84 → root-ro

JasperE84 / root-ro

Licence: GPL-3.0 License
Read-only root filesystem for Raspbian Stretch (using overlay)

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to root-ro

MobileNetV2-PoseEstimation
Tensorflow based Fast Pose estimation. OpenVINO, Tensorflow Lite, NCS, NCS2 + Python.
Stars: ✭ 99 (+32%)
Mutual labels:  raspberrypi, raspbian
balena-chromium-kiosk
BalenaOS/BalenaCloud based Kiosk using Chromium on a RaspberryPi
Stars: ✭ 46 (-38.67%)
Mutual labels:  raspbian, kiosk
pihut-xmas-asyncio
Demonstration driving The Pi Hut Raspberry Pi 3D Xmas tree using Python Asyncio
Stars: ✭ 15 (-80%)
Mutual labels:  raspberrypi, raspbian
Briarids
An All-In-One home intrusion detection system (IDS) solution for the Raspberry PI.
Stars: ✭ 187 (+149.33%)
Mutual labels:  raspberrypi, raspbian
PiBeacon
Low-cost iBeacon using Raspberry Pi
Stars: ✭ 41 (-45.33%)
Mutual labels:  raspberrypi, raspbian
Pivccu
piVCCU is a project to install the original Homematic CCU2 firmware inside a virtualized container (lxc) on ARM based single board computers.
Stars: ✭ 230 (+206.67%)
Mutual labels:  raspberrypi, raspbian
Bazel bin
Bazel's pre-built binaries for armv7l / aarch64 / x86_64.
Stars: ✭ 23 (-69.33%)
Mutual labels:  raspberrypi, raspbian
Gumcp
Web Control Panel for Raspberry Pi
Stars: ✭ 124 (+65.33%)
Mutual labels:  raspberrypi, raspbian
seb-mac
Safe Exam Browser for macOS and iOS
Stars: ✭ 74 (-1.33%)
Mutual labels:  kiosk, kiosk-mode
webconverger-addon
How we lock down Firefox
Stars: ✭ 27 (-64%)
Mutual labels:  kiosk, kiosk-mode
Raspberrypi Ua Netinst
RaspberryPi (minimal) unattended netinstaller
Stars: ✭ 179 (+138.67%)
Mutual labels:  raspberrypi, raspbian
aprenda-python
Aprendizado, dicas e projetos sobre Python
Stars: ✭ 22 (-70.67%)
Mutual labels:  raspberrypi, raspbian
Piwheels
Python package repository providing wheels (pre-built binaries) for Raspberry Pi
Stars: ✭ 180 (+140%)
Mutual labels:  raspberrypi, raspbian
Cattlepi
effortlessly boot, configure, update and monitor your raspberry pi ☁️
Stars: ✭ 250 (+233.33%)
Mutual labels:  raspberrypi, raspbian
Pimusicbox
An image (SD-card) to turn the Raspberry Pi into an easy to use MusicBox with Spotify playback and AirTunes streaming
Stars: ✭ 1,967 (+2522.67%)
Mutual labels:  raspberrypi, raspbian
fresh-coffee-listener
Using a raspberry pi, we listen to the coffee machine and count the number of coffee consumption
Stars: ✭ 52 (-30.67%)
Mutual labels:  raspberrypi, raspbian
Yahm
Yet Another Homematic Management - Skripte zur Einrichtung der Homematic CCU Oberfläche in einem LXC Container unter Debian Jessie auf ARM CPU (z.B.: Raspberry Pi & Co)
Stars: ✭ 113 (+50.67%)
Mutual labels:  raspberrypi, raspbian
Crankshaft
Crankshaft: A turnkey GNU/Linux solution that transforms a Raspberry Pi to an Android Auto head unit.
Stars: ✭ 1,703 (+2170.67%)
Mutual labels:  raspberrypi, raspbian
wor-flasher
Legal utility that runs on RPiOS to flash another SD card with Windows 10/11
Stars: ✭ 451 (+501.33%)
Mutual labels:  raspberrypi, raspbian
epdtext
A simple display manager app for the WaveShare 2.7in e-Paper Display
Stars: ✭ 18 (-76%)
Mutual labels:  raspberrypi, raspbian

Read-only root filesystem for Raspbian Stretch

This repository contains some useful files that allow you to use a Raspberry PI using a readonly filesystem. After running install.sh everything will be set up and the system will reboot into read-only mode.

See instructions below to see how to switch to permanent or temporary write-mode.

This script is tested with a freshly deployed Raspbian image with "desktop and recommended software", specifically with the img file dated 2018-11-13, kernel 4.14. (Tested on a Rpi 3B+). It has also been tested on a recent Rasbian image (Buster) on a Rpi 4B and a Rpi Zero W.

This files contains some ideas and code of the following projects:

Congratulate the original authors if these files work as expected.

Why use a read-only root filesystem

There can be many reasons to configure a read only root filesystem. In my case I use it on Raspberry Pi's which are used for narrowcasting, kiosk installations and dashboard applications. I have the read-only filesystem enabled for three reasons:

  • Extend microSD card lifespan.
  • Make sure the filesystem isn't corrupted by random power cut shut downs (the Rpi's get their power from USB ports on flatscreen TV's).
  • Undo any user changes and fix any user-induced errors by simply rebooting the Raspberry Pi.

How it works

The script uses an overlay filesystem. Basically the normal root storage device gets mounted in readonly bottom layer. A writable in-memory layer is configured on top of it. Any changes made will be written to the top layer and will not be written to the I/O device. There are two options to go back to write mode.

  1. The bottom layer can be remounted in readwrite mode, chroot to the mount point of the bottom layer and make changes there.
  2. Use the provided script in /root to disable or enable the overlayfs altogether after a reboot.

Read more about the overlay filesystem here: https://wiki.archlinux.org/index.php/Overlay_filesystem

Setup

To get everything configured and to enable the read-only filesystem, you can simply paste these commands.

sudo apt-get -y install git
cd /home/pi
git clone https://github.com/JasperE84/root-ro.git
cd root-ro
chmod +x install.sh
sudo ./install.sh

The install.sh script will configure and request to reboot the system.

Rebooting to permanent write-mode (disabling the overlay fs)

Execute:

sudo /root/reboot-to-writable-mode.sh

Rebooting to permanent read-only mode (enabling the overlay fs)

Execute:

sudo /root/reboot-to-readonly-mode.sh

Enabling temporary write access mode:

Write access can be enabled using following command.

sudo mount -o remount,rw /mnt/root-ro
# next command enables DNS in chroot because resolvconf service needs to read /run/resolvconf/resolv.conf
sudo mount -o bind /run /mnt/root-ro/run
sudo chroot /mnt/root-ro

Exiting temporary write access mode:

Exit the chroot and re-mounting the filesystem:

exit
sudo mount -o remount,ro /mnt/root-ro

Original state

To return to the original state to allow easy apt-get update/upgrade and rpi-update, you need to add a comment mark to the "initramfs init.gz" line to the /boot/config.txt file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].