Fedora enters dracut emergency mode after upgrading Fedora 29 to 30: error in grub2 file auto generation

After upgrading Fedora 29 to 30, Fedora entered dracut emergenccy mode after the following error:

[ TIME ] Timed out waiting for device /dev/mapper/fedora-swap
[DEPEND] Dependency failed for Resume from hibernation using device /dev/mapper/fedora-swap

While upgrading, the file /boot/efi/EFI/fedora/grubenv was corrupted in this line:

kernelopts=root=/dev/mapper/vgfedora-root ro resume=/dev/mapper/fedora-swap rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rd.lvm.lv=fedora/usr rhgb quiet

The reason is that my volume group is not called fedora but vgfedora. So grub’s auto generation / adjustment of grubenv introduced the error. So correcting the volume group’s name throughout the line solves the issue:

kernelopts=root=/dev/mapper/vgfedora-root ro resume=/dev/mapper/vgfedora-usr rd.lvm.lv=vgfedora/root rd.lvm.lv=vgfedora/usr rhgb quiet

(As I have assumed at first the swap to be corrupted, I have deleted it. So this is why I removed swap from the line)

I do not know why grub’s auto generation has changed vgfedora to fedora (this was not the case in previous versions and was done throughout all files that were updated during the upgrade) while updating the file, but I assume that others can experience this problem as well (no further help needed from my side).

1 Like
  1. If you can’t boot the system, use chroot from a LiveCD/USB.
  2. Validate the /etc/default/grub and fix if required.
  3. Verify that the BootLoaderSpec-style configuration is enabled.
  4. Mount the EFI partition if required.
  5. Regenerate the grubenv:
sudo grub2-editenv create
  1. Reconfigure the boot loader:
if [ -d "/sys/firmware/efi" ]; \
then GRUB_CONF="/etc/grub2-efi.cfg"; \
else GRUB_CONF="/etc/grub2.cfg"; fi
sudo grub2-mkconfig --output="${GRUB_CONF}"
sudo dracut --force --regenerate-all
2 Likes

A bit more complicated, but I assume your solution is the more precise one :slight_smile: Hopefully, one of the solutions will work for all users experiencing the issue.

1 Like