Difference between revisions of "SD card read-only mode"

From Nocrashwiki
(Created page with "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 pe...")
 
Line 10: Line 10:
 
<br><br>
 
<br><br>
  
If you need to enable access again to carry out an update or adjust your scripts, SSH back into your Raspberry Pi and run this command to allow write access temporarily:
+
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 in reverse, then reboot.
 
 
$ sudo mount -o remount,rw /boot
 
You can now carry out any work required. Another reboot will revert your SD card to a read-only state.
 

Revision as of 16:57, 12 December 2024

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 in reverse, then reboot.