CentOS 7 Stuck at the dracut Emergency Prompt and Would Not Boot

centos7 dracut initqueue timeout and could not boot

* This page contains promotional content

At some point, somewhere around when I updated the CentOS7 kernel, it stopped booting properly.

When it boots, it gets stuck showing this screen and goes no further

Wrning: /dev/centos_web/root does not exist
Warning: /dev/mapper/centos_web-root does not exist
 
Generating "/run/initramfs/sosreport.txt"
 
Entering emergency mode. Exit the shell to continue.
Type "journalctl" to view system logs.
You might want to save "/run/initramfs/sosreport.txt" to a USB stick or /boot
after mounting them and attach it to a bug report.
 
dracut:/#

I figured that something grub-related had probably broken or been misconfigured when the kernel was updated, so I googled it

The symptoms this time matched the article above ↑.

  1. Boot in rescue mode
  2. Mount the disk and CHROOT
  3. Fix fstab and grub.cfg
  4. Confirm booting from the local CD-ROM drive
  5. Boot from the HDD/SSD

In the end, the cause this time was indeed that the grub.cfg settings did not match.

For reference

  • The grub.cfg from when it could not boot (only the relevant part shown)
linux16 /vmlinuz-3.10.0-1160.59.1.el7.x86_64 root=/dev/mapper/centos-root ro rd.lvm.lv=centos/root rd.lvm.lv=centos/swap crashkernel=auto rh
gb quiet  systemd.log_level=debug systemd.log_target=kmsg

On the error screen above, Wrning: /dev/centos_web/root does not exist says centos_web, while the configuration says centos, and that is the cause

The grub.cfg after fixing it

linux16 /vmlinuz-3.10.0-1160.59.1.el7.x86_64 root=/dev/mapper/centos_web-root ro rd.lvm.lv=centos_web/root rd.lvm.lv=centos_web/swap crashkernel=auto rhgb quiet  systemd.log_level=debug systemd.log_target=kmsg

This machine is rarely rebooted, so it took me a while to notice the problem, but boot failures and messing with grub are bad for the heart, so it seems better to reboot and confirm that the machine still boots as soon as possible after a kernel update