# The kernel order cannot be changed on boot with the Rocky 8.10 cloud image

**URL:** <https://forums.rockylinux.org/t/the-kernel-order-cannot-be-changed-on-boot-with-the-rocky-8-10-cloud-image/15790>\
**Category:** Rocky Linux Help & Support\
**Tags:** rocky-linux-8\
**Created:** [September 11, 2024, 1:12am UTC](https://forums.rockylinux.org/t/the-kernel-order-cannot-be-changed-on-boot-with-the-rocky-8-10-cloud-image/15790 "2024-09-11T01:12:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoonsoo.lim](https://avatars.discourse-cdn.com/v4/letter/y/ee59a6/32.png) [@yoonsoo.lim](https://forums.rockylinux.org/u/yoonsoo.lim)\
**Post date:** [September 11, 2024, 1:12am UTC](https://forums.rockylinux.org/t/the-kernel-order-cannot-be-changed-on-boot-with-the-rocky-8-10-cloud-image/15790/1 "2024-09-11T01:12:34Z")

</div>

# info

```auto
used image : https://dl.rockylinux.org/pub/rocky/8/images/x86_64/Rocky-8-GenericCloud-Base.latest.x86_64.qcow2
distro : Rocky 8.10
boot mode : bios(legacy)

```

```auto
cat /etc/default/grub

GRUB_TIMEOUT=1
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=auto"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true

```

  
  
  

# steps to reproduce

```bash
[root@rock810-ori ~]# grubby --info ALL | grep -E "^kernel|^index"
index=0
kernel="/boot/vmlinuz-4.18.0-553.el8_10.x86_64"
index=1
kernel="/boot/vmlinuz-0-rescue-5dedb03890064d12ae33dd13b8e4dc31"
index=2
kernel="/boot/vmlinuz-4.18.0-553.16.1.el8_10.x86_64"
index=3
kernel="/boot/vmlinuz-0-rescue-3dd925f0ad2d4f3a80f6d8c9713b52bf"
...

```

```bash
[root@rock810-ori ~]# grubby --set-default-index 0
The default is /boot/loader/entries/5dedb03890064d12ae33dd13b8e4dc31-4.18.0-553.el8_10.x86_64.conf with index 0 and kernel /boot/vmlinuz-4.18.0-553.el8_10.x86_64

```

```auto

[root@rock810-ori ~]# grubby --default-kernel
/boot/vmlinuz-4.18.0-553.el8_10.x86_64

```

```bash
[root@rock810-ori ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
done

```

```bash
[root@rock810-ori ~]# sync; reboot

```

  

- Problem occurred
  - The version 4.18.0-553.el8\_10.x86\_64 should appear.

```bash
[root@rock810-ori ~]# uname -r
4.18.0-553.16.1.el8_10.x86_64

```

 ![image](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/2X/a/a440d42880bd7d738b8e0175c7244f2a1dc93071.jpeg)

* * *

- And the index value in the command output seems to be different from the actual kernel index value that can be selected during boot.

```bash
[root@rock810-ori ~]# grubby --info ALL | grep -E "^kernel|^index"
index=0
kernel="/boot/vmlinuz-4.18.0-553.el8_10.x86_64"
index=1
kernel="/boot/vmlinuz-0-rescue-5dedb03890064d12ae33dd13b8e4dc31"
index=2
kernel="/boot/vmlinuz-4.18.0-553.16.1.el8_10.x86_64"
index=3
kernel="/boot/vmlinuz-0-rescue-3dd925f0ad2d4f3a80f6d8c9713b52bf"
...

```

---

<div class="post-metadata">

**Author:** ![Ritov](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@Ritov](https://forums.rockylinux.org/u/Ritov)\
**Post date:** [September 11, 2024, 10:06am UTC](https://forums.rockylinux.org/t/the-kernel-order-cannot-be-changed-on-boot-with-the-rocky-8-10-cloud-image/15790/2 "2024-09-11T10:06:43Z")

</div>

Take a look at `/usr/sbin/grub2-set-default`

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [September 11, 2024, 11:22am UTC](https://forums.rockylinux.org/t/the-kernel-order-cannot-be-changed-on-boot-with-the-rocky-8-10-cloud-image/15790/3 "2024-09-11T11:22:24Z")

</div>

You did set default first, before grub2-mkconfig. What if the latter did redefine the default?

```auto
ls -l /boot/loader/entries/

```

The GRUB uses BLS (boot loader specification) module to add those entries to the menu. The entry files do not have index in them.  
Perhaps grubby and BLS enumerate the entries differently?

The “index 0” is “first on list”. If BLS puts “greatest version” first, then that is the “0”. One can refer to entry more explicitly than with index number.

> [@yoonsoo.lim](#):
>
> `GRUB_DEFAULT=saved`

Says to use `saved_entry` from the `grubenv`. Did grubby or grub2-mkconfig touch that? (Install of kernel package does.)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [November 10, 2024, 11:23am UTC](https://forums.rockylinux.org/t/the-kernel-order-cannot-be-changed-on-boot-with-the-rocky-8-10-cloud-image/15790/4 "2024-11-10T11:23:15Z")

</div>

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