Grub Default Boot OS Numbering

Asked by tomdean

I am attempting to select the default boot by editing /etc/default/grub. The machine is remote.

Looking at /boot/grub/grub.cfg, I think the default I want is
  'Ubuntu, with Linux 4.19.240-rt108'
I think it is numbered "1>7"

In /etc/default/grub, I set
GRUB_DEFAULT="1>7"
then,
sudo update-grub

The first item is what I think the menu entry items are. Are these numbers correct?
From /boot/grub/grub.cfg

0 menuentry 'Ubuntu'
  linux /boot/vmlinuz-5.13.0-41-lowlatency

1 submenu 'Advanced options

1>0 menuentry 'Ubuntu, with Linux 5.13.0-41-lowlatency (recovery mode)'
  linux /boot/vmlinuz-5.13.0-41-lowlatency

1>1 menuentry 'Ubuntu, with Linux 5.13.0-41-generic'
  linux /boot/vmlinuz-5.13.0-41-generic

1>2 menuentry 'Ubuntu, with Linux 5.13.0-41-generic (recovery mode)'
  linux /boot/vmlinuz-5.13.0-41-generic

1>3 menuentry 'Ubuntu, with Linux 5.13.0-40-lowlatency'
  linux /boot/vmlinuz-5.13.0-40-lowlatency

1>4 menuentry 'Ubuntu, with Linux 5.13.0-40-lowlatency (recovery mode)'
  linux /boot/vmlinuz-5.13.0-40-lowlatency

1>5 menuentry 'Ubuntu, with Linux 5.13.0-40-generic'
  linux /boot/vmlinuz-5.13.0-40-generic

1>6 menuentry 'Ubuntu, with Linux 5.13.0-40-generic (recovery mode)'
  linux /boot/vmlinuz-5.13.0-40-generic

1>7 menuentry 'Ubuntu, with Linux 4.19.240-rt108'
  linux /boot/vmlinuz-4.19.240-rt108

1>8 menuentry 'Ubuntu, with Linux 4.19.240-rt108 (recovery mode)'
  linux /boot/vmlinuz-4.19.240-rt108

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Bashing-om (bashing-om) said :
#1

tomdean - Hello

I do not know what command your an to get that output - however the "number" in fact should be a number only - such as 7.

Verify that 7 is the correct menu item:
grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0

-hope this helps-

Revision history for this message
tomdean (tomdean) said :
#2

On 5/16/22 15:50, Bashing-om wrote:
> Your question #701812 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/701812
>
> Status: Open => Answered
>
> Bashing-om proposed the following answer:
> tomdean - Hello
>
> I do not know what command your an to get that output - however the
> "number" in fact should be a number only - such as 7.
>
> Verify that 7 is the correct menu item:
> grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0
>
> -hope this helps-
>

I got the syntax from: https://help.ubuntu.com/community/Grub2/Submenus

Using the "1>7" syntax, the system booted into the selected OS.

The 'output' in my email was from typing...

Where does the syntax you describe come from?

Tom Dean

Revision history for this message
Launchpad Janitor (janitor) said :
#3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.