Rocky Linux changes boot order

Dear All,

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!

Kind Regards!

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.

[root@router ~]# efibootmgr
BootCurrent: 000C
Timeout: 10 seconds
BootOrder: 000C,0000,0001,0002,0005,0006,0007,0008,0009,0004,0003,000A
Boot0000* UiApp
Boot0001* UEFI Misc Device
Boot0002* UEFI Misc Device 2
Boot0003* UEFI 8A3EAF85
Boot0004* UEFI Micron_7450_MTFDKBA480TFR 2423495313F9 1
Boot0005* UEFI PXEv4 (MAC:D063B403DC86)
Boot0006* UEFI PXEv6 (MAC:D063B403DC86)
Boot0007* UEFI HTTPv4 (MAC:D063B403DC86)
Boot0008* UEFI HTTPv6 (MAC:D063B403DC86)
Boot0009* UEFI Shell
Boot000A* UEFI Samsung SSD 840 EVO 1TB S1D9NEAD915052W
Boot000C* Rocky Linux

This might also be because the HP tower detects a new entry and then moves it to the top.

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.

Dear nazunalika,

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?

Best Regards!

Dear all,

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.

best regards!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.