In most cases, grub-install worked on my Dell Inspiron with dual boot. However, it failed twice in the past few months.
The program then doesn’t close, and the desktop becomes unusable. Ctrl-C doesn’t help either. Restarting the computer will cause Windows 11 to start.
Booting into a live system and running grub-install after manjaro-chroot repaires the GRUB boot manager.
I have found indications that updating of the boot entry in the UEFI setup during grub-install may occasionally fail.
Does this only affect the pointer to /boot/efi/EFI/Manjaro/grubx64.efi, which should remain unchanged?
Is it not safe to use the --no-nvram parameter with grub-install?
Would manually creating a boot entry in the UEFI setup by selecting EFI/Manjaro/grubx64.efi be equivalent to the effort of booting with a live system (and chroot, grub-install)?
This suggests that your /boot/efi/EFI/boot/bootx64.efi might be missing or has been overwritten with — in your case — the MS-Windows boot entry. Windows is known to do this sort of thing during a Windows update, and without telling you about it.
grub-install normally only updates that entry, unless the --removable option is specified, in which case it also updates /boot/efi/EFI/boot/bootx64.efi.
The script install-grub — which may or may not be installed on your system, but it’s available from the Manjaro repository — was created specifically so as to make sure that /boot/efi/EFI/boot/bootx64.efi and /boot/efi/EFI/manjaro/grubx64.efi are identical. If they are not, then this could lead to all kinds of problems regarding reinstalling or updating the boot loader.
It is generally advised to not use that option.
In theory, yes. But I would recommend simply installing and running install-grub, which was designed to handle this transparently.
I installed install-grub package and glanced in the bash script with same name.
The script install-grub is called without any parameter and is run regardless of a given --help parameter. After some checks it constructs the parameters for grub-install and calls it and then grub-mkconfig as well. Before calling grub-install it checks if there is a menu item for Manjaro (GRUB_DISTRIBUTOR in /etc/default/grub) in the UEFI setup (using efibootmgr) and if there is already a menu item it calls grub-install with the needed parameters plus --no-nvram and --force.