"you are in emergency mode" during first boot after power failure - how to avoid it?

us flag

For a few years I'm running Ubuntu on my home server. New thing this year in my area are short but frequent power grid outages.
After each such power failure my system is not booting to desktop, but to emergency mode.
A solution is simply to reboot the system by hitting the reset button - a bit inconvenient since the system is placed in obscure corner at the attic. It is even harder when I'm away... ;-)

Is there any brute force method possible for disabling the emergency mode?

Also, there probably is some reason (like some problem with my hardware) for such behavior - any pointers where to look for it?

us flag

Solution presented under this link seems to work for me:

It is not avoiding to enter emergency mode but rather rebooting the server after specified timeout - still giving you a chance to enter emergency mode and do some diagnostics if there is a need.

There were two modifications of the answer linked above needed on my system:

  • under sh command read is not recognizing -t option - needed to use bash instead
  • systemctl reboot restarts the machine but filesystem is sill mounted in read-only mode - systemctl default however does the job

So complete steps:

  1. sudo systemctl edit emergency.service
  2. Enter:
    ExecStartPre=/bin/bash -c "read -t 6 || systemctl default"

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.