Changing grub boot-order

I was trying to change the default boot kernel from zen to cacule. I was able to add a kernel option and timer without any issues. It is just not allowing me to change which is the default kernel. I was hoping I could change the order in /boot/grub/grub.cfg and run sudo update-grub but that doesn't work either. Here is the output:

 ╭─xxxx@xxxx in ~
 ╰─λ sudo garuda-boot-options
[sudo] password for xxxx:
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
garuda-boot-options version: 0.1
Exec #1: "logname"
Exit #1: 0 QProcess::NormalExit
Exec #2: "mountpoint -q /live/aufs"
Exit #2: 1 QProcess::NormalExit
Exec #3: "plymouth-set-default-theme -l"
Exit #3: 0 QProcess::NormalExit
Exec #4: "plymouth-set-default-theme"
Exit #4: 0 QProcess::NormalExit
Exec #5: "pacman -Qq plymouth"
Exit #5: 0 QProcess::NormalExit
Exec #6: "pacman -Qq plymouth"
Exit #6: 0 QProcess::NormalExit
Exec #7: "test -z \"$(lspci -d 80ee:beef)\""
Exit #7: 0 QProcess::NormalExit
Exec #8: "df -T / |tail -n1 |awk '{print $2}'"
Exit #8: 0 QProcess::NormalExit
Exec #9: "update-grub"
SErr #9: "Generating grub configuration file ...\nFound theme: /usr/share/grub/themes/garuda-dr460nized/theme.txt\nFound linux image: /boot/vmlinuz-linux-zen\nFound initrd image: /boot/intel-ucode.img /boot/initramfs-linux-zen.img\nFound fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-zen-fallback.img\nFound linux image: /boot/vmlinuz-linux-lts\nFound initrd image: /boot/intel-ucode.img /boot/initramfs-linux-lts.img\nFound fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-lts-fallback.img\nFound linux image: /boot/vmlinuz-linux-cacule\nFound initrd image: /boot/intel-ucode.img /boot/initramfs-linux-cacule.img\nFound fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-cacule-fallback.img\nFound linux image: /boot/vmlinuz-linux\nFound initrd image: /boot/intel-ucode.img /boot/initramfs-linux.img\nFound fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-fallback.img\nWarning: os-prober will be executed to detect other bootable partitions.\nIts output will be used to detect bootable binaries on them and create new boot entries.\nAdding boot menu entry for UEFI Firmware Settings ...\nDetecting snapshots ...\nInfo: Separate boot partition not detected \nFound snapshot: 2021-09-25 22:15:29 | timeshift-btrfs/snapshots/2021-09-25_22-15-29/@\nFound snapshot: 2021-09-25 20:00:01 | timeshift-btrfs/snapshots/2021-09-25_20-00-01/@\nFound snapshot: 2021-09-24 20:00:01 | timeshift-btrfs/snapshots/2021-09-24_20-00-01/@\nFound snapshot: 2021-09-24 10:35:20 | timeshift-btrfs/snapshots/2021-09-24_10-35-20/@\nFound snapshot: 2021-09-24 08:04:44 | timeshift-btrfs/snapshots/2021-09-24_08-04-44/@\nFound snapshot: 2021-09-23 23:48:19 | timeshift-btrfs/snapshots/2021-09-23_23-48-19/@\nFound snapshot: 2021-09-23 23:45:49 | timeshift-btrfs/snapshots/2021-09-23_23-45-49/@\nFound snapshot: 2021-09-23 20:00:01 | timeshift-btrfs/snapshots/2021-09-23_20-00-01/@\nFound 8 snapshot(s)\nUnmount /tmp/grub-btrfs.yAOfgIhFNQ .. Success\nFound memtest86+ image: /boot/memtest86+/memtest.bin\ndone\n"
Exit #9: 0 QProcess::NormalExit
Exec #10: "grub-editenv /boot/grub/grubenv unset next_entry"
Exit #10: 0 QProcess::NormalExit
Exec #11: "update-grub"
SErr #11: "Generating grub configuration file ...\nFound theme: /usr/share/grub/themes/garuda-dr460nized/theme.txt\nFound linux image: /boot/vmlinuz-linux-zen\nFound initrd image: /boot/intel-ucode.img /boot/initramfs-linux-zen.img\nFound fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-zen-fallback.img\nFound linux image: /boot/vmlinuz-linux-lts\nFound initrd image: /boot/intel-ucode.img /boot/initramfs-linux-lts.img\nFound fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-lts-fallback.img\nFound linux image: /boot/vmlinuz-linux-cacule\nFound initrd image: /boot/intel-ucode.img /boot/initramfs-linux-cacule.img\nFound fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-cacule-fallback.img\nFound linux image: /boot/vmlinuz-linux\nFound initrd image: /boot/intel-ucode.img /boot/initramfs-linux.img\nFound fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-fallback.img\nWarning: os-prober will be executed to detect other bootable partitions.\nIts output will be used to detect bootable binaries on them and create new boot entries.\nAdding boot menu entry for UEFI Firmware Settings ...\nDetecting snapshots ...\nInfo: Separate boot partition not detected \nFound snapshot: 2021-09-25 22:15:29 | timeshift-btrfs/snapshots/2021-09-25_22-15-29/@\nFound snapshot: 2021-09-25 20:00:01 | timeshift-btrfs/snapshots/2021-09-25_20-00-01/@\nFound snapshot: 2021-09-24 20:00:01 | timeshift-btrfs/snapshots/2021-09-24_20-00-01/@\nFound snapshot: 2021-09-24 10:35:20 | timeshift-btrfs/snapshots/2021-09-24_10-35-20/@\nFound snapshot: 2021-09-24 08:04:44 | timeshift-btrfs/snapshots/2021-09-24_08-04-44/@\nFound snapshot: 2021-09-23 23:48:19 | timeshift-btrfs/snapshots/2021-09-23_23-48-19/@\nFound snapshot: 2021-09-23 23:45:49 | timeshift-btrfs/snapshots/2021-09-23_23-45-49/@\nFound snapshot: 2021-09-23 20:00:01 | timeshift-btrfs/snapshots/2021-09-23_20-00-01/@\nFound 8 snapshot(s)\nUnmount /tmp/grub-btrfs.7klMvGsPJP .. Success\nFound memtest86+ image: /boot/memtest86+/memtest.bin\ndone\n"
Exit #11: 0 QProcess::NormalExit
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 1594, resource id: 12583854, major code: 40 (TranslateCoords), minor code: 0
Running GarudaBO cleanup code

 ╭─xxxx@xxxx in ~ took 1s
 ╰─λ sudo -E garuda-boot-options
[sudo] password for xxxx:
QStandardPaths: runtime directory '/run/user/1000' is not owned by UID 0, but a directory permissions 0700 owned by UID 1000 GID 1000
QStandardPaths: runtime directory '/run/user/1000' is not owned by UID 0, but a directory permissions 0700 owned by UID 1000 GID 1000
QStandardPaths: runtime directory '/run/user/1000' is not owned by UID 0, but a directory permissions 0700 owned by UID 1000 GID 1000
garuda-boot-options version: 0.1
Exec #1: "logname"
Exit #1: 0 QProcess::NormalExit
Exec #2: "mountpoint -q /live/aufs"
Exit #2: 1 QProcess::NormalExit
Exec #3: "plymouth-set-default-theme -l"
Exit #3: 0 QProcess::NormalExit
Exec #4: "plymouth-set-default-theme"
Exit #4: 0 QProcess::NormalExit
Exec #5: "pacman -Qq plymouth"
Exit #5: 0 QProcess::NormalExit
Exec #6: "pacman -Qq plymouth"
Exit #6: 0 QProcess::NormalExit
Exec #7: "test -z \"$(lspci -d 80ee:beef)\""
Exit #7: 0 QProcess::NormalExit
Exec #8: "df -T / |tail -n1 |awk '{print $2}'"
Exit #8: 0 QProcess::NormalExit
Exec #9: "grub-editenv /boot/grub/grubenv unset next_entry"
Exit #9: 0 QProcess::NormalExit
Exec #10: "update-grub"
SErr #10: "Generating grub configuration file ...\nFound theme: /usr/share/grub/themes/garuda-dr460nized/theme.txt\nFound linux image: /boot/vmlinuz-linux-zen\nFound initrd image: /boot/intel-ucode.img /boot/initramfs-linux-zen.img\nFound fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-zen-fallback.img\nFound linux image: /boot/vmlinuz-linux-lts\nFound initrd image: /boot/intel-ucode.img /boot/initramfs-linux-lts.img\nFound fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-lts-fallback.img\nFound linux image: /boot/vmlinuz-linux-cacule\nFound initrd image: /boot/intel-ucode.img /boot/initramfs-linux-cacule.img\nFound fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-cacule-fallback.img\nFound linux image: /boot/vmlinuz-linux\nFound initrd image: /boot/intel-ucode.img /boot/initramfs-linux.img\nFound fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-fallback.img\nWarning: os-prober will be executed to detect other bootable partitions.\nIts output will be used to detect bootable binaries on them and create new boot entries.\nAdding boot menu entry for UEFI Firmware Settings ...\nDetecting snapshots ...\nInfo: Separate boot partition not detected \nFound snapshot: 2021-09-25 22:15:29 | timeshift-btrfs/snapshots/2021-09-25_22-15-29/@\nFound snapshot: 2021-09-25 20:00:01 | timeshift-btrfs/snapshots/2021-09-25_20-00-01/@\nFound snapshot: 2021-09-24 20:00:01 | timeshift-btrfs/snapshots/2021-09-24_20-00-01/@\nFound snapshot: 2021-09-24 10:35:20 | timeshift-btrfs/snapshots/2021-09-24_10-35-20/@\nFound snapshot: 2021-09-24 08:04:44 | timeshift-btrfs/snapshots/2021-09-24_08-04-44/@\nFound snapshot: 2021-09-23 23:48:19 | timeshift-btrfs/snapshots/2021-09-23_23-48-19/@\nFound snapshot: 2021-09-23 23:45:49 | timeshift-btrfs/snapshots/2021-09-23_23-45-49/@\nFound snapshot: 2021-09-23 20:00:01 | timeshift-btrfs/snapshots/2021-09-23_20-00-01/@\nFound 8 snapshot(s)\nUnmount /tmp/grub-btrfs.piRL3Wf9vo .. Success\nFound memtest86+ image: /boot/memtest86+/memtest.bin\ndone\n"
Exit #10: 0 QProcess::NormalExit
Running GarudaBO cleanup code
 ╰─λ inxi -Fxzd
System:    Kernel: 5.14.7-zen1-1-zen x86_64 bits: 64 compiler: gcc v: 11.1.0 Desktop: KDE Plasma 5.22.5 Distro: Garuda Linux
           base: Arch Linux
Machine:   Type: Desktop System: Micro-Star product: MS-7C75 v: 2.0 serial: <filter>
           Mobo: Micro-Star model: MPG Z490 GAMING PLUS (MS-7C75) v: 2.0 serial: <filter> UEFI: American Megatrends v: A.70
           date: 04/20/2021
Battery:   Device-1: hidpp_battery_0 model: Logitech K850 Performance Wireless Keyboard charge: 100% (should be ignored)
           status: Discharging
           Device-2: hidpp_battery_1 model: Logitech M585/M590 Multi-Device Mouse charge: 55% (should be ignored)
           status: Discharging
CPU:       Info: 6-Core model: Intel Core i5-10600K bits: 64 type: MT MCP arch: Comet Lake rev: 5 cache: L2: 12 MiB
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 98397
           Speed: 4593 MHz min/max: 800/4800 MHz Core speeds (MHz): 1: 4593 2: 4706 3: 4556 4: 4789 5: 4688 6: 4556 7: 4593
           8: 4747 9: 4789 10: 4803 11: 4749 12: 4757
Graphics:  Device-1: NVIDIA GP108 [GeForce GT 1030] vendor: Micro-Star MSI driver: nvidia v: 470.74 bus-ID: 01:00.0
           Device-2: Microsoft LifeCam Cinema type: USB driver: snd-usb-audio,uvcvideo bus-ID: 1-2.1.4:8
           Display: x11 server: X.Org 1.20.13 driver: loaded: nvidia resolution: 2560x1080~60Hz
           OpenGL: renderer: NVIDIA GeForce GT 1030/PCIe/SSE2 v: 4.6.0 NVIDIA 470.74 direct render: Yes
Audio:     Device-1: Intel Comet Lake PCH cAVS vendor: Micro-Star MSI driver: snd_hda_intel v: kernel bus-ID: 00:1f.3
           Device-2: NVIDIA GP108 High Definition Audio vendor: Micro-Star MSI driver: snd_hda_intel v: kernel bus-ID: 01:00.1
           Device-3: Microsoft LifeCam Cinema type: USB driver: snd-usb-audio,uvcvideo bus-ID: 1-2.1.4:8
           Device-4: Pyle USB Sound Card Pyle USB Sound Card type: USB driver: hid-generic,snd-usb-audio,usbhid
           bus-ID: 1-2.2:6
           Sound Server-1: ALSA v: k5.14.7-zen1-1-zen running: yes
           Sound Server-2: JACK v: 1.9.19 running: no
           Sound Server-3: PulseAudio v: 15.0 running: no
           Sound Server-4: PipeWire v: 0.3.37 running: yes
Network:   Device-1: Realtek RTL8125 2.5GbE vendor: Micro-Star MSI driver: r8169 v: kernel port: 3000 bus-ID: 03:00.0
           IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives:    Local Storage: total: 931.51 GiB used: 24.36 GiB (2.6%)
           ID-1: /dev/sda vendor: Western Digital model: WDS100T2B0B-00YS70 size: 931.51 GiB
           Message: No optical or floppy data found.
Partition: ID-1: / size: 931.26 GiB used: 24.36 GiB (2.6%) fs: btrfs dev: /dev/sda2
           ID-2: /boot/efi size: 256 MiB used: 562 KiB (0.2%) fs: vfat dev: /dev/sda1
           ID-3: /home size: 931.26 GiB used: 24.36 GiB (2.6%) fs: btrfs dev: /dev/sda2
           ID-4: /var/log size: 931.26 GiB used: 24.36 GiB (2.6%) fs: btrfs dev: /dev/sda2
           ID-5: /var/tmp size: 931.26 GiB used: 24.36 GiB (2.6%) fs: btrfs dev: /dev/sda2
Swap:      ID-1: swap-1 type: zram size: 15.55 GiB used: 0 KiB (0.0%) dev: /dev/zram0
Sensors:   System Temperatures: cpu: 34.0 C mobo: N/A gpu: nvidia temp: 48 C
           Fan Speeds (RPM): N/A gpu: nvidia fan: 38%
Info:      Processes: 355 Uptime: 17m Memory: 15.55 GiB used: 3.38 GiB (21.7%) Init: systemd Compilers: gcc: 11.1.0
           Packages: 2010 Shell: fish v: 3.3.1 inxi: 3.3.06

PS bonus question, is the default shell bash now? This is a fresh install and I think the previous install was fish default. Thanks!

I think that messing around with kernel orders or define new defaults has some known bugs (if you search in the forum you'll find several topics about it).
I think you should edit /etc/default/grub and change GRUB_DEFAULT=0 (first line) to e.g. GRUB_DEFAULT=1 (second line) or whatever else, also in sub-menu, I think you can use e.g. GRUB_DEFAULT="1>2" (third line in second line submenu).
You sohuld also comment out GRUB_SAVEDEFAULT, e.g.

#GRUB_SAVEDEFAULT=true

You just have to try.
Then update-grub of course.
In my opinion (and for my experience) if you want to cut it short, you should boot with the one you want as default, uninstall all the others and update-grub. Then, if you want other kernels ready, you can re-install them and the sequence will be adjusted accordingly.
Reinstalling in the future would only take a few minutes anyway....

5 Likes

Thanks for quick response.
1st try:
I liked the idea of booting to cacule and removing zen and lts, then adding them back in so I tried that first. I booted to cacule, removed zen/lts, reboot, installed just zen back, reboot, zen boots up default. It looks like zen is always prioritized regardless the installation order.

2nd try:
Edited /etc/grub/grub.cfg to this:

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="3"
fi

I didn't find any GRUB_DEFAULT so I changed the set default="3" (flat menu) then ran sudo update-grub, reboot, still boots to first option which is zen.

I didn't see anything for GRUB_SAVEDEFAULT=true but there is the savedefault function:

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

I'm not sure what to change there so I left it alone.

3rd try:
Removed zen and lts, cacule and linux are the two left. cacule is first on the list so it boots by default.

I guess it's not a huge deal, think I'll leave it like this for now but I'll be living on the wild side without a zen or lts. I'll keep my eye on the changelogs and add zen/lts back in when the bug is fixed. Unless you have any other ideas.
Thanks again!

It's edit /etc/default/grub for GRUB_DEFAULT not /etc/grub/grub.cfg

2 Likes

ah ok my mistake I'll take a look.

1 Like

Ok after much trial and error I got it:

1st try:
Wanted to go back to the adding the kernels in the right order again just in case I missed something. Booted lts and installed zen, reboot. zen booted up. Installed cacule, reboot, zen booted up. Later I found that I missed adding the cacule-headers so I don't know if this had anything to do with this method not working but I moved on to 2nd try.

2nd try:
Modified /etc/default/grub and that booted up cacule but it got stuck on bootup screen. Alt+F4 to get out to terminal, installed the cacule-headers, reboot and now it selects the cacule kernel and boots fine.

Note: I guess the only tricky part is that the list starts from 0 so if you count as a human, cacule is the 5th choice down but in the GRUB_DEFAULT option, 4 works fine. Just making a note of it in case someone else reads this and tries to update their grub but it boots to the wrong one. I know that's just the way computers 'think' so no biggie.
Thanks, we can call it Solved/Work around for now :sweat_smile:

1 Like

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