Skip to content

Enable read only filesystem

Vince Pike edited this page Jul 11, 2023 · 2 revisions

You can increase the lifetime of your microSD card and reduce the risk of filesystem corruption from unplanned shutdowns by enabling read-only mode on your Pi.

As the name implies, the read-only filesystem makes it so that no writes to the filesystem persist across reboots. To perform system updates or make permanent changes to your TinyPilot, you'll need to disable the read-only filesystem.

To enable read-only mode / overlay filesystem:

  1. sudo raspi-config
  2. Choose 7 - Advanced options If you are using the pro version, select 4 Performance Options
  3. Choose AB - Overlay FS If you are using the pro version, select P3 Overlay File System Enable
  4. When prompted, "Would you like the overlay file system to be enabled?" choose "Yes"
  5. When prompted "Would you like the boot partition to be write-protected?" choose "No"
  6. Choose "Finish"
  7. When prompted "Would you like to reboot now?" choose "Yes"

Read-only mode slows down the boot process, so don't worry if your reboot takes 2-3x as long as normal.

To disable read-only mode, follow the same steps as above, but when prompted, "Would you like the overlay file system to be enabled?" choose "No".

overlayfs

Another option for enabling read-only mode is the overlayfs script. It's not included natively in Raspberry Pi OS, but you can install it from the repo and use it to control read-only mode from the command-line.