Why would the running knoppix partition be mounted rw?
# mount | grep mnt
/dev/sda4 on /mnt-system type ext4 (rw,relatime)
# uname -a
Linux Microknoppix 3.16.3-64 #10 SMP PREEMPT Fri Sep 26 02:00:22 CEST 2014 x86_64 GNU/Linux
lbrtchx: http://knoppix.net: Why would the running knoppix partition be mounted rw?
Only Klaus K can answer correctly - but here is some motivation
Only Klaus Knopper can give you the correct answer, but after some weeks with Debian 8.3 live - which mounts the partition ro when there is no persistence, I think I can provide some motivation. Have you tried Debian live with and without persistence?
In short: While it can be argued that mounting a partition with a compressed image readonly is the "correct" thing to do, in practice we often lose more than we gain that way. There are usually quite a few other files apart from the compressed live image on the partition, and why should it be impossible to modify any of them, or, for example, add more compressed images to the partition while running off it? Personally, I have found ro mounting to be mostly a hassle for me. Over time, partition sizes have grown dramatically, while the Knoppix CD and DVD images have stayed essentially the same size.
As for Knoppix, ro mounting would make it impossible both to change the booting configurations - unless they are placed on another drive, and I think many would find that impractical. Maybe more important, is that we would not be able to do any administration work on any persistent image, like fixing the file system, take a backup on the same partition or resizing it, from any Knoppixes on that partition. To patch this newly created problem, add a cheatcode for "mount rw" - and get back to where we started.
I'm quite sure you could modify init in minirt.gz to add and implement a "ro" cheatcode if you really want it, shouldn't be too hard.
Something that might be tried
I think this might be tried:
1. On startup, if persistent not empty, copy persistent content to ramdisk, run with ramdisk. Otherwise, swap KNOPPIX.sq and KNOPPIX_b.sq, run from KNOPPIX.sq
2. During running, use two (script) commands: ramdisk_save and ramdisk_commit. ramdisk_save saves to a overlayfs mount of knoppix-data.img and KNOPPIX.sq, unmounting afterwards.
3. ramdisk_commit first performs a ramdisk_save, then compresses the overlayfs mount to KNOPPIX_b.sq, unmounts and clears knoppix-data.img.
4. Unless otherwise requested, KNOPPIX_b.sq will be renamed to KNOPPIX.sq and used at next startup, the old KNOPPIX.sq becoming KNOPPIX_b.sq and usable as a backup until next commit.
5. Cheatcode revert either aborts the swapping after a commit, or works with the oldest squashfs image available.
This way, we never use the persistence for daily work, we just save to it. There is not much complexity added to minirt init either: Copying and possibly image swapping, using noimage setup. With the revert cheatcode, KNOPPIX.sq and KNOPPIX_b.sq are swapped, if KNOPPX.sq is not already the oldest.
With FAT32 limits, this could be done within ca 12GB space if mksquashfs can use a pipe. Otherwise, ca 12 GB extra is needed for filesystem copy. When a 32GB USB3 stick costs about $20, I don't think an extra 16GB is that much to care about. I would guess ca 2GB persistent store would be fine with this setup, and starting from DVD Knoppix slimmed down to ca 3GB (example of purging procedure provided elsewhere), the should be enough workspace for many needs. Even when the least efficient squashfs compression is used.
And using NTFS or ext3 file system, the 4GB limit does of course not apply.