0

I've bought a USB flash stick with a write-protect switch. I've installed and updated buster and enabled the overlay fs (also changing /boot to read-only).

The intent is to be able to boot with the WP switch on, do whatever I want to do, and then power off and reboot with no changes made to the underlying fs. However, when I attempt to boot that way I get thrown into an emergency shell (which fails because root is locked) because fsck fails because the media is read-only.

What I really want is to be able to boot with the WP switch off when I want to make permanent updates and the like, but then boot with WP turned on when I don't want the state altered.

1
  • Why on earth did this get a downvote?! It’s a perfectly reasonable question!
    – nsayer
    Jan 4 at 14:48
1

Standard Linux REQUIRES write access to store temporary files etc.

It is possible to make an OS which runs in RAM or which uses RAM for volatile storage. These are commonly used for "Live" images.

The normal Raspberry Pi OS would require significant modification to do this, and it is not feasible to just turn it on & off, so you can have a RO file system which remains unchanged OR a normal system.

NOTE it is not necessary - there are lots of scare stories about OS corruption, but these are just that. The risk is very low, and better handled by a proper backup strategy.

1
  • The reason I have for booting with RO media doesn’t have anything to do with reliability. It’s security and it’s a very long story, but the short version is that when used in anger I need to be able to prove that there’s no possibility of storing anything in non-volatile memory. The overlay FS should be the means to accomplish this - it can write deltas into RAM and then you just power off.
    – nsayer
    Jan 4 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.