we experience the following problem: we successfully installed a couple of machines with latest Rocky Llinux 9. In the BIOS (HP EliteTower 800, G9) we used PXE boot as primary entry, since by default we want to boot a special service from the network, and only in case the user wants to choose local system, he will choose to start Rocky Linux. However, as soon as the user starts the local installation, the boot order in BIOS is changed, such that Rocky Linux is started at the next reboot. Is this something which can be avoided by adapting GRUB? Since we are no experts in GRUB configuration, any help or hint is greatly appreciated!
This sounds like an EFI specific thing rather than grub.
If you want to change the boot order post-install, you can install the efibootmgr package and set the order accordingly using efibootmgr -o. Below, 000C is the default choice for me, since that’s Rocky Linux. But if 000C doesn’t go, the next one 0000 will go, and then continue down.
Are you sure that the Rocky installer does not only add a new entry (it is the last on the list in the example by @nazunalika ), but also update the BootOrder?
That can be tested: add a new entry. If BootOrder automatically gets it as first, then it is HP’s EFI, rather than installer, that auto-modifies the BootOrder. I’d guess that the new entry is appended, not prepended.
@hazel
On that posted example the IPv4 PXEboot is entry number 0005. On your systems it might be something else. Furthermore, if bootloader is chosen on that menu, the users have to press something on powerup in order to get into the menu in order be able to choose the Rocky entry, which then loads GRUB. (That is what I do.)
It is possible to add custom entries into the GRUB menu too. You can write such entries into file /boot/grub2/custom.cfg
The grub.cfg does inculde that file (if present). One can also set such entry as the default (rather than the latest installed kernel).
What is GRUB entry syntax that can start PXEboot? I have no idea.
I am writing on behalf of hazel. Your efibootmgr trick does the job, but only ones, since next time we start Rocky, again local installation is set before PXE. We are wondering WHY or WHAT mechanism is causing this? To make the efibootmgr setting persistent, we thought about using a script that is called during startup or shutdown. However, can you expain, what is causing hte change in boot order?
for your information: We still don’t know why or what mechanism ist causing the boot order change but we found a solution that works for us. We have written a systemd script that changes the boot order in the way we want it everytime the system starts.