Stuck in emergency mode

Hello everyone.
It seams that I really messed up somehow. Firstly, some context:
Today I turned on my PC and everything was fine, except that I couldn’t log in. Says “Failed to login”, and I’m 100% sure that caps lock was off, keyboard layout was right. Other tty showed “login incorrect”. So I started searching how to fix the problem online. In some topic I found that maybe a wrong version of some package making the problems, so I decided to chroot and run “pacman -Syu”. After reboot I ended up here:

You are in emergency mode. After logging in, type “journalctl -xb” to view system logs, “systemctl reboot” to reboot or"exit" to continue bootup.
Give root password for maintenance
(or press Control-D to continue):

I gave my password and system recognized it for the first(and last) time today. I typed “journalctl -xb” to see if there is anything useful for me. Then I typed “exit” to continue bootup and whole “You are in emergency mode…” appeared again with only difference that at this time when I try to enter my password it says “Login incorrect” - the same thing was when I tried to login in tty2 or tty3…
Pressing Ctrl+D doesn’t work - it just send me the same “You are in emergency mode…” message again. If I press it 5-6 times the message will stop appearing and everything will stuck on “Starting default.target” line.

Also, I just noticed what might cause emergency mode:

[FAILED] Failed to mount /efi.
See ‘systemctl status efi.mount’ for details.
[Depend] Dependency failed for Local File Systems.

I haven’t done anything special with the system in recent days and haven’t made any updates.
Please help :frowning:

I saw an earlier post about EFI (or rather vfat) not apparently being in the current kernel for some. Suggest trying another kernel like LTS.

Did you try booting the fallback image from the boot menu? If that works, when you are in the system rebuild your initrds.

If not, maybe this helps. Chroot again and rebuild your initrds with the command dracut-rebuild if you are using dracut or mkinitcpio -P if you are using mkinitcpio.

Hello, thanks for response. Yes, I already tried booting the fallback and didn’t notice any changes.
And it fails to dracut-rebuild.

Couldn’t find EFI system partition. It is recommended to mount it to /boot or /efi.
Alternatively, use --esp-path= to specify path to mount point.
/usr/bin/dracut-rebuild: line 33: /dev/fd/63: No such file or directory

Also, “efi” folder is empty..

This is something I don’t know about.

I suggest to chroot.
In chroot: pacman -Syu dracut kernel-install-for-dracut and reinstall-kernels

Also, check if you have boot dracut and mkinicpio installed. If you have mkinicpio, remove it.

ugh, I guess it didn’t work.. while pacman -Syu dracut kernel-install-for-dracut:

:: Running post-transaction hooks…
(1/5) Reloading system manager configuration…
Skipped: Running in chroot.
(2/5) Restarting marked services…
Skipped: Running in chroot.
(3/5) Arming ConditionNeedsUpdate…
(4/5) Running kernel-install…
/usr/share/libalpm/scripts/kernel-install-hook: line 29: /dev/fd/63: No such file or directory
stat: cannot statx ‘/proc/1/root/.’: No such file or directory
Running in a chroot, skipping cmdline generation
(5/5) Checking which packages need to be rebuilt
join: /dev/fd/63: No such file or directory
comm: /dev/fd/62: No such file or directory
Error, do this: mount -t proc proc /proc
lscpu: failed to determine number of CPUs: /sys/devices/system/cpu/possible: No such file or directory
comm: /dev/fd/62: No such file or directory
tee: /tmp/tmp.y2UEQNM3z6/21374: No such file or directory
tee: /tmp/tmp.y2UEQNM3z6/25607: No such file or directory
comm: /dev/fd/62: No such file or directory

And when tried reinstall-kernels :

/usr/bin/reinstall-kernels: line 10: /dev/fd/63: No such file or directory

I have only dracut installed.

Did you chroot correctly? What is your file system and how are you chrooting?

Read this and choose the method for your filesystem:

https://discovery.endeavouros.com/system-rescue/arch-chroot/2022/12/

I fail to install LTS kernel. On several steps of install there is “No such file or directory” problems. For example:

stat: cannot statx ‘/proc/1/root/.’: No such file or directory
Running in a chroot, skipping cmdline generation
(4/5) Check if user should be informed about rebooting after certain system package upgrades.
stat: cannot statx ‘/proc/1/root/.’: No such file or directory
(5/5) Checking which packages need to be rebuilt
join: /dev/fd/63: No such file or directory
comm: /dev/fd/62: No such file or directory
Error, do this: mount -t proc proc /proc
lscpu: failed to determine number of CPUs: /sys/devices/system/cpu/possible: No such file or directory
tee: /tmp/tmp.nxqZR4J3Fp/10365: No such file or directory
comm: /dev/fd/62: No such file or directory
tee: /tmp/tmp.nxqZR4J3Fp/21626: No such file or directory
comm: /dev/fd/62: No such file or directory

Or when I do grub-mkconfig:

/usr/bin/grub-probe: error: cannot find a device for / (is /dev mounted?).

I really staring wonder how it came to this… I’m literally just updated the system through chroot…

It seems you are not chrooting correctly:

Error, do this: mount -t proc proc /proc

Please read the link I posted before.

Then from chroot, give us:

pacman -Q | grep -E "dracut|mkinitcpio|grub|kernel"

Oh, you’re absolutely right.. I’m really not chrooting correctly, dummy me.

From pacman -Q | grep -E "dracut|mkinitcpio|grub|kernel":

composable-kernel 6.3.2-1
dracut 106-1
grub 2:2.12.r226.g56ccc5ed-1
kernel-install-for-dracut 1.11-1

Are you inside chroot correctly now?

Run dracut-rebuild and grub-mkconfig -o /boot/grub/grub.cfg

Yes, sorry for the slow response. I just tried reinstall kernels in correct chroot and reboot to my system. It works! There is not a single problem left. Even the problem with login disappeared :thinking:
Thanks for your guidance!

1 Like

I am glad to hear that the problem is solved!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.