Pi 5 Bookworm 64bit cannot set filesystem to read only

Unable to make SD card filesystem read-only on PI5 with 64bit Bookworm OS.

  • tried using raspi-config…performance…overlay…and read-only boot settings. It doesnt work. I can still, for example, create a file on the desktop, and after reboot or power-up, the file remains. I have rebooted after setting the raspi-config settings, several times, before testing.

Am I missing something, or is this facility now broken? If broken, is there a work-around?

Thanks in advance for any help.

Hi @joseph256683

Welcome to the forum!

This comment thread on the Bookworm github might point you in the right direction for getting your issue sorted.

Hi Dan,

Unfortunately, that thread does not deal with the same issue. I have found that I can set the file system to read-only using the 32 bit OS, but not with the 64 bit OS.

Has anybody successfully implemented the read-only file system using the full 64 bit Bookworm OS using the prescribed rasppi-config settings?

Hey @joseph256683,

From what I can gather from that thread Dan shared, the file system not locking correctly is a known issue on more recent Pi OS versions. The method that involves changing settings using raspi-config still works but only to lock the root partition, not the user-accessible section of the SD card like the desktop.

It seems like the line overlayroot="tmpfs" in /etc/overlayroot.local.conf and overlayroot=tmpfs in /boot/cmdline.txt are responsible for controlling this behaviour although I couldn’t find a combination of settings for these values that successfully locked the file system on the most recent version of Bookworm on a Pi 5.

The cmdline.txt file has moved from /boot/cmdline.txt to /boot/firmware/cmdline.txt at some point between versions so this could be responsible for this problem in some way.

Hopefully someone else has more luck getting this to work.