Guide on how to fix “Cannot open access to console, the root account is locked.” error.

  1. Retrieve your SD card from the Pi. Using a PC, insert the SD card using build in port or SD card reader.
  2. Within File explorer, /boot partition of the SD card should be visible.
  3. Within that partition, locate the file cmdline.txt and add the following at the end of the line init=/bin/sh. Do not create a new line, just add the above to end of the current line.
  4. Load the SD card back to your pi and boot up.
  5. You should now get the a root shell prompt.
  6. Run mount -a command to mount second partition. This will allow to save the fstab file
  7. From here undo the changes to /etc/fstab by running sudo nano /etc/fstab or whatever else that initially broke the system.
  8. Before returning SD card to the pi, remove suffix from step 3.
Source
https://samx18.io/blog/2017/11/05/piBootIssue.html

Categorized in:

Raspberry Pi,

Last Update: June 27, 2024