Is overlayfs supported?

I’m having trouble finding a definitive answer.

I’m using an orangepi zero 2 w as an appliance. It will be headless and have no keyboard or monitor. I’ll plug those in when needed.

In particular, I’ll be plugging it in, using it, and then unplugging it. No option for “shutdown”.

So, I need to setup a read-only file system to avoid disk corruption.

I tried going into dietpi-disk_manager and making the root (only) drive read only but I keep getting an error about the mount point being busy.

Help?

Number 1 reason is that there is a swapfile active. That would need to be removed in any case, or moved to a dedicated block device. But just mounting the rootfs R/O will break a lot of things, using an overlayfs is the practical solution, indeed.

These instructions are old, but should still work well: Samba Fails on RO filesystem - #2 by Joulinar

Thank you. I’ll try it now.

OK, it worked. Now, how to I make it so that I can turn it on and off?

I tried a few things, but I was not able to make it stop being read-only. I ended up reformatting the SD and reinstalling the os.

The Orange pi Zero 2 W is a great platform for embedded development, but an easy solution to the read-only problem like the raspberry pi is really needed here. R-pi is open source, so can’t you just the their script?

Of course, you could do that. But then who would take responsibility for maintaining it and adapting it to new Debian or kernel versions? What happens if the script suddenly stops working and the system remains in read-only mode? The linked repository is over 6 years old and has not been updated since then. It may still work today, but what about in the future?