SD card read-only mode

From Nocrashwiki

Unplugging your Raspberry Pi to shut it down can eventually result in system file corruption. Any operating system stored on an SD card may eventually fail if used for long periods of time. To reduce these risks, you can make your SD card read-only. Open the raspi-config tool with the following command:

$ sudo raspi-config

Navigate through the menu system as follows:

  1. Select Performance options
  2. Select Overlay File System
  3. Confirm that you would like to enable the overlay file system
  4. Confirm that you would like to write-protect the boot partition
  5. Confirm reboot

This whole process may take a few minutes to complete.

If you need to enable access again to carry out an update or adjust your scripts, SSH back into your Raspberry Pi and run the above steps to disable overlay fs, then reboot.