[Howto] Cannot open access to console, the root account is locked in emergency mode (dracut emergency shell)

If Fedora can’t mount /home partition for any reason, it’ll enter emergency mode (also known as dracut emergency shell) as it should, but will give this error message:

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

Press Enter to continue.

On pressing [Enter] it tries to reload emergency shell and the process repeats. Emergency shell is unusable.

Why does this happen

This is a known problem. It happens Fedora releases 28 and newer, which don’t require password for root account during installation and use first user added as administrator/superuser. In this case root account is locked, and if /home is inaccessible – then the system can’t use superuser/administrator account either.

What to do

If you find yourself in this situation and you can’t resolve problem with /home mounting from Live disk/USB, and you need access to emergency mode, the solution is simple.

  1. Boot into Live disk/usb and chroot into your Fedora installations as documented in this Fedora quick-docs article – following steps 1 through 8.

  2. Unlock root account by supplying password for it:

    passwd root
    
  3. Exit chroot environment with [Ctrl-d] or

    exit
    
  4. Reboot your computer with GUI or with

    systemctl reboot
    

You should get back to emergency mode but with perfectly functional shell/console.

2 Likes