OpenHAB will not boot - is in emergency mode?

I’m not sure what I did to cause this but ultimately power-cycling my RPi after stopping opHAB caused this.

openHAB will not start and I cannot access via putty etc. Plugging in a monitor gives me:

Welcome to emergency mode! After logging in try.........sulogin: root account is locked, starting shell.

What do I do to get things back to normal?


Since this is obviously an OS related problem, I’d search for answers there. A simple search using the message you got will return lots of help.
OpenHAB isn’t even started on your system and OpenHAB is no OS.

I did do that but all the articles suggested that I go into ‘recovery mode’ which doesn’t appear to be possible with Rasbian.

…then, how long does a complete new install with openhabian would take? You already spent 2 houres, that could be close to enough!

But wouldn’t I lose all my config files if I did that? (My last back up was a few weeks ago and I’ve made a lot of changes since then).

It’s not totally dead - I can get the openhabian-config tool up, for example.

In this case I’d save all needed config files and use them after the reinstall!
If this situation arised because of a SD card problem, you’d have the saved data anyway.

Thanks for your help. I couldn’t even read the USB flash drive so I couldn’t get any files from there so I had to get a new drive.
I guess I ought to make backups more frequently.

I’ve got a question that you or someone else may be able to answer.

If I get a few spare USB sticks, can I just copy (in my PC) the contents of the one on my PI to the spares so if I get a corrupt drive again, I can just swap them out (rather than re-install openHAB from the backup?)

If so, would it be as simple as:

  • Stop openHAB service (if actually running)
  • Remove USB flash stick
  • Copy contents on PC (drag and drop) to new drive.
  • Re-insert drive.
  • Start openHAB service

Or do I have to do some more of that command line stuff?

I had the same issue after having perfectly working system and went to apply fixes/permissions i got in the same problem. i could repeat this multiple times until i figured out the problem. running stable OH3 fresh or upgraded from OH2