I've got a pi 3b that boots from the ssd card, but has an external usb drive to store media files. The external drive seems to have died (makes terrible sounds and doesn't spin up) but the bigger problem is that I can't access the system anymore. While booting it times out after waiting for the bad device, then reports "You are in emergency mode." After a few more messages it says

Cannot open access to console, the root account is locked. See sulogin(8) man page fore more details. 

Press Enter to continue.

But pressing enter or switching to other virtual consoles doesn't give me a command or login prompt. I tried booting in safemode by adding S to /boot/cmdline.txt but there's no change.

  • Please edit your question and add the contents of your /boot/cmdline.txt to it. – Ingo May 20 at 9:37

I have never heard of this method and the command line is not correct for current Raspbian. You should list your actual cmdline.txt

Your best option is to restore from your backup.

If you do not have a backup you can attempt to repair problems on the Pi by rebooting to a root shell. This won't work if you have used NOOBS

  1. Append init=/bin/sh at the end of cmdline.txt and reboot. (This will need to be done on another computer.)
  2. After booting you will be at the prompt in a root shell.
  3. Your root file system is mounted as readonly now, so remount it as read/write mount -n -o remount,rw /

You can then edit files.

| improve this answer | |
  • No dice. Adding init=/bin/sh makes the boot hang early after random: crng init done but with no error messages. – pgcudahy May 20 at 7:09

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.