How to re-generate the grub menu's Rescue entry?

In new default Fedora installation, there is a grub2 boot entry “Rescue Image”.

I removed /boot/loader/entries/$(cat /etc/machine-id)-0-rescue.conf by mistake.

Is there a way to regenerate this entry automatically?

I don’t use grub but I would guess that either re-installing one of your kernels or calling kernel-install add manually would recreate it.


If creating with kernel-install add . Will the used kernel in “Rescue Image” be removed after many updates as per the installonly_limit=3 in /etc/dnf/dnf.conf ?

kernel-install doesn’t install a kernel in the same sense as dnf does.

It is taking a kernel you have on your system and installing it in the bootloader. So running kernel install should recreate your initrd, recreate the relevant entries, and install it in your bootloader.

That being said, if you would prefer to fix it with dnf, I think reinstalling an existing kernel will also trigger kernerl-install add without you having to figure out the correct syntax for the command.