By: Manuel
Date: 2020-Jan-03
Updated: 2020-Mar-21
Updated: 2022-Nov-09
Fixing a grub & os-prober issue
This article deals with the situation where there are other Arch based operating systems already installed onto a machine, and EndeavourOS is then installed to that machine.
There is a long-standing and annoying issue with co-operation between packages grub
and os-prober
. The generated /boot/grub/grub.cfg
file fails to boot some Arch based operating systems!
The reason for the issue is how grub-mkconfig
command generates the initrd
lines into /boot/grub/grub.cfg. On Arch based systems there may be more parameters for the initrd line than simply the initramfs image: especially the microcode image. And that is not generated properly along with the initramfs image.
For example, when using a microcode image, this kind of initrd line should be generated by grub-mkconfig
:
initrd /boot/intel-ucode.img /boot/initramfs-linux.img
but instead, this is generated:
initrd /boot/intel-ucode.img
And that particular boot menu entry, or course, fails to boot.
This problem can be fixed manually by adding the missing entry or entries to the initrd
line, as shown above.
At next reboot the menu entries should work as expected.
A more permanent workaround for the problematic menu entries is to manually copy them from file /boot/grub/grub.cfg
into file /boot/grub/custom.cfg
after fixing them like above. Note that a menu entry consists of one or more lines. A menu entry starts with a word menuentry
and stops with the closing }
character for that menu entry.
Entries in custom.cfg
will not be overwritten by a later call to grub-mkconfig
.
More info about grub menu entries: https://www.gnu.org/software/grub/manual/grub/grub.html