[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.

3 Likes

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.

8 Likes

Hello,

I have the same problem as nightromantic’s posted solution and I am trying to solve this. I have the below output, but I don’t know how to match my output with the instructions of Fedora quick-docs article.

Device         Start        End    Sectors   Size Type
/dev/sda1       2048     923647     921600   450M Windows recovery environment
/dev/sda2     923648    1128447     204800   100M EFI System
/dev/sda3    1128448    1161215      32768    16M Microsoft reserved
/dev/sda4    1161216  313420961  312259746 148.9G Microsoft basic data
/dev/sda5  313421824  315121663    1699840   830M Windows recovery environment
/dev/sda6  315121664  317218815    2097152     1G Linux filesystem
/dev/sda7  317218816 1953523711 1636304896 780.3G Linux LVM

Could I have a help please?

Check this way:

lsblk
ls /dev/mapper
1 Like

@vgaetera ,

[liveuser@localhost ~]$ lsblk
    NAME                            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sda                               8:0    0 931.5G  0 disk 
    ├─sda1                            8:1    0   450M  0 part 
    ├─sda2                            8:2    0   100M  0 part 
    ├─sda3                            8:3    0    16M  0 part 
    ├─sda4                            8:4    0 148.9G  0 part 
    ├─sda5                            8:5    0   830M  0 part 
    ├─sda6                            8:6    0     1G  0 part 
    └─sda7                            8:7    0 780.3G  0 part 
      ├─fedora_localhost--live-swap 253:2    0   5.9G  0 lvm  [SWAP]
      ├─fedora_localhost--live-home 253:3    0 724.4G  0 lvm  /run/media/liveuser/d0ba1ebb-291d-472e-8746-7411f6b0bf4c
      └─fedora_localhost--live-root 253:4    0    50G  0 lvm  
    sr0                              11:0    1   1.4G  0 rom  /run/initramfs/live
    loop0                             7:0    0   1.4G  1 loop 
    loop1                             7:1    0   6.5G  1 loop 
    ├─live-rw                       253:0    0   6.5G  0 dm   /
    └─live-base                     253:1    0   6.5G  1 dm   /run/media/liveuser/Anaconda
    loop2                             7:2    0   512M  0 loop 
    └─live-rw                       253:0    0   6.5G  0 dm   /

and

[liveuser@localhost ~]$ ls /dev/mapper
control  fedora_localhost--live-home  fedora_localhost--live-root  fedora_localhost--live-swap  live-base  live-rw

but I am in from live DVD.

This should be the volume with your root file system:

/dev/mapper/fedora_localhost--live-root
1 Like

6 posts were split to a new topic: After I’ve given the root user a password, how do I log in and use that account?

You might find you get stuck on @nightromantic’s suggestion of step 1 when using logical partitions in dual boot scenario’s.

Tried:

mount /dev/sda1 /mnt/root/boot/

Error:

mount: /mnt/root/boot: unknown filesystem type 'LVM2_member'.

Worked through mounting an LVM partition and everthing worked as expected. :slight_smile:

Thank you @nightromantic :+1:

2 Likes

thanks! this helped me get out of the emergency mode loop…

1 Like

Hi @bunnydays, and welcome to Ask Fedora!

Yep, this catch22 is quite a tricky one is you don’t have an appropriate info.

Note that (at least in F31) you can’t enter into rescue.target (by running systemctl isolate command or by adding systemd.unit kernel parameter, it’s the same) if SELinux is in “enforcing” mode. I don’t know it’s a bug or not, but keep in mind that if you want to use rescue target, previously you should have put your system in “permissive” SELinux’s mode

A post was split to a new topic: Root account is locked