Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/quantumlibet/immutablefs
make the root filesystem immutable on a debian/armbian/raspbian installation
https://github.com/quantumlibet/immutablefs
armbian debian filesystem immutable pi-os raspberry
Last synced: 6 days ago
JSON representation
make the root filesystem immutable on a debian/armbian/raspbian installation
- Host: GitHub
- URL: https://github.com/quantumlibet/immutablefs
- Owner: QuantumLibet
- Created: 2024-10-27T12:38:40.000Z (10 days ago)
- Default Branch: main
- Last Pushed: 2024-10-27T12:45:26.000Z (10 days ago)
- Last Synced: 2024-10-27T14:21:55.042Z (10 days ago)
- Topics: armbian, debian, filesystem, immutable, pi-os, raspberry
- Language: Shell
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ImmutableFS for Raspberry Pi
This script installs (if necessary) and then enables/disables an union filesystem based on the `overlayroot` OverlayFS implementation.
That's a mouthful for: It makes the current root filesystem read-only and redirects all writes to the memory.The idea is taken from `raspi-config`.
If you have a Raspberry Pi, `sudo raspi-config` offers the same and more, via a GUI.### Usage:
/path/to/immutablefs.sh [ enable | disable | info]
It requires `sudo` (as in: `sudo` must be available and the user calling the script must have permissions to use `sudo`).
### Motivation:
The motivation for this was simple: I wanted to freeze an installation, experiment on/with it, and unfreeze it. A poor man's time machine of sorts.
To do so is simple: Redirect writes to the filesystem to the machine's memory instead. Done.
This basically makes the filesystem read-only. To reset the machine to the original state, just reboot, since that looses all contents of the memory.This has turned out to be useful in different places, e.g. with my (smol) fleet of Raspberry Pi's. There I freeze machines, once they have the desired state.
A poor man's immutable operating system.
To update the machine, I'll unfreeze it (which requires a reboot), update it, and freeze it again (which requirest yet another reboot). Simple, really.### Implementation:
This uses the (debian) [`overlayroot`](https://packages.debian.org/bookworm/overlayroot) package, which is part of the (debian) [`cloud-initramfs-tools`](https://packages.debian.org/source/bookworm/cloud-initramfs-tools) that have been upstreamed to debian from the Canonical `overlayroot` package, part of the bigger (Canonical) [`cloud-initramfs-tools`](https://launchpad.net/cloud-initramfs-tools) package.
### Sources:
[OverlayFS on The Linux Kernel](https://docs.kernel.org/filesystems/overlayfs.html)
[OverlayFS on the ArchLinux man page](https://wiki.archlinux.org/title/Overlay_filesystem)
[OverlayFS on Wikpedia](https://en.wikipedia.org/wiki/OverlayFS)
[Protecting the Root Filesystem on Ubuntu](https://spin.atomicobject.com/protecting-ubuntu-root-filesystem/)