RPi-Distro / raspi-config

Configuration tool for the Raspberry Pi
Other
570 stars 209 forks source link

OverlayFS doesn't work, SD card still writes persistent changes #215

Closed DonGuig closed 1 year ago

DonGuig commented 1 year ago

Hi, I've been trying to enable the overlay file system with raspi-config. While turning the /boot read-only works (I can't write anything to /boot afterward), the overlay fs doesn't seem to properly work, as I can write something to e.g. /home/pi, and this change persists after reboot, so it does get written to the SD card.

I'm using raspberry pi os Lite bullseye.

No idea how to troubleshoot this !

DonGuig commented 1 year ago

I did the same with a freshly-installed raspberry pi os (2023-05-03), and it works correctly, changes done to /home/pi are lost upon reboot.

Thing is, I do not want to make a fresh install for that other SD card I work with, since it is running a program for which reliability is key, and I don't want to test it with a new os release (it relies on several pre-installed softwares and I'd rather not change that configuration).

How do I go about troubleshooting why the overlay fs doesn't work on this other SD card ?

DonGuig commented 1 year ago

I solved it. I had a modified /boot/config.txt, in which the last section was flagged with [pi4]. When raspi-config set up the overlay, it added the "initramfs" line after that [pi4] flag, and since the SD card was running on a Rpi3, this initramfs wasn't actually executed.

Solved it by adding an [all] flag before the initramfs line.