Power outage, root account locked. Doesn't boot without Keyboard to hit enter

What is the problem?

Hello everyone, I had an power outage today during a print. After power returned my raspberry was stuck on the command line with the following error:

"Cannot open access to console, the root account is locked." Enter to continue

After plugging in an keyboard and hitting enter, the Pi & TouchUI started like nothing happend. But now, after shutting down / restarting the pi, the error pops up again.

What should I do now? It would be a huge pain to reinstall everything. Everything was working fine before the power outage. So I guess some config got corrupted or whatever.

Thanks for any help I can get.

Best regards from Germany,
Frank.

What did you already try to solve it?

Restarting the Pi a few times, added some weird command into the boot.txt that made my pi not boot at all etc.

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...)

OctoPrint Version: 1.3.8 (1.3.9 doesn't work with TouchUI yet)
OctoPi Version: 0.15.1
Printer: Creality Ender 3

I followed this tutorial to get my touchscreen working: https://github.com/BillyBlaze/OctoPrint-TouchUI/wiki/Setup:-Boot-to-Browser-(OctoPi-or-Jessie-Light)

I googled this, and it looks like it is often the fstab. If you have no idea what that is, make a new Octoprint install. If you want to try, there's an init= argument you can give and see if you can fix it; since it boots after hitting enter, you should be able to explore syslog and run dmesg to look for catastrophic events.

For some reason it works now. All I did was basically restarting it multiple times. I checked syslog but saw nothing special. Went frustrated to bed and when I powered up the printer in the morning, everything booted as nothing happend. I don't know why. Thanks anyway :blush:

1 Like

Indeed.

Jump in the Wayback Machine to the days when you were working with Microsoft Windows. You boot up and you're still in a command prompt sort of world and it's running an fdisk to fix a corrupt FAT table. Grindy, grindy, grindy... it's taking a good five minutes. And then it's eventually done and you get a more familiar GUI experience.

It's the same thing. You have a headlesss server and it's got a corrupt partition and it needs to fix that on bootup. Since there's no screen, you wouldn't know this. Even if you had a screen, it's marshaled off things so that you can't have access yet while the work is proceeding.

I don't know what to say. It came back, sometimes it's there. Sometimes it works. My Pi probably hates me, haha. What is the "sulogin man page"?

I woud say here:

  1. You might want to backup your image from time to time just to be on the safe side
  2. The quality of your microSD could be in question here (there are cheap brands which aren't really 100% if you know what I mean)
  3. It's super important that your Raspberry's power adapter be 5V @ 2.5A. If the power drops, it could cause corruption.
  4. Make sure that you're running the OctoPrint -> Settings -> Shutdown religiously before cutting power to it.

So now, you want to get into it. If you can ssh to it (or do this from your workstation by editing the microSD there), try adding...

init=/bin/sh

...as a second line to your cmdline.txt file. You'll need a monitor/keyboard/mouse on the Raspberry itself.

Once in, do a df -h to make sure that you've not filled up the root partition. More typically, though, the fstab is unhappy somehow... or it's having a problem loading that root partition. The gparted program is great for fixing things like this. I personally boot my workstation from an Ubuntu Live USB and then run it from there for the fix.

I wasn't able to fix it. So I reinstalled everything completely and its working now. After setting everything up I made a backup. So I hope I'm good now. Im still wondering why my installation can get corrupted like that. Before I had a touchscreen attached and TouchUI running, I always powered everything down without shutting the pi down. And it always worked.

Luckily I found some plugins and help from the plugin author to shut the pi down automatically and cut power after shutdown trough my TP-Link plug.

I also tested if simply unplugging it would cause the issue to reappear. And it does.

Since I had to do every installation step again (which was a huge mess, I had to grind trough many guides since the installation process for the different touchscreens is so different) I wrote a complete guide how to set my cobination up. I added the complete guide in the description of my thingiverse file.

Maybe some people find this useful. :slight_smile:

Thanks again for your help. :wink: I still have a slight problem but I'm going to open a seperate topic for that.

If you're finding that a simple power outage could corrupt your microSD, I might suggest:

  1. clone your microSD card after you get it the way you want it
  2. use something like the OctoPi-upgrade-helper to periodically backup just your .octoprint folder
  3. consider putting all this on a UPS

Pull the card
Insert into a Linux machine that has gparted
scan and fix the partitions

Put back into RPi

1 Like