Discussion:
changing default grub entry??
robert
2018-10-12 06:48:37 UTC
Permalink
Hi sisters & brothers in unbuntu

I swaped my motherboard in a 16.04 box with 5 disks.

Now the boot sequence has changed.

I would like to have the 9th entry of the list that is displayed when I boot, to
be default.

this is what I tried (and failed):

1. in /etc/default/grub

    GRUB_DEFAULT=9
    #GRUB_HIDDEN_TIMEOUT=0
    GRUB_HIDDEN_TIMEOUT_QUIET=true
    GRUB_TIMEOUT=10
    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
    GRUB_CMDLINE_LINUX=""
2. update-grub

however, the default entry does not change.

thanks for your help

robert


--
ubuntu-users mailing list
ubuntu-***@lists.ubuntu.com
Modify settings or unsubscribe at: http
Ralf Mardorf via ubuntu-users
2018-10-12 07:22:01 UTC
Permalink
On Fri, 12 Oct 2018 08:48:37 +0200, robert wrote:
>I would like to have the 9th entry of the list that is displayed when
>I boot, to be default.
>
>this is what I tried (and failed):
>
>1. in /etc/default/grub
>
>     GRUB_DEFAULT=9

There might be an additional issue, however, to make the 9th entry the
default, the number must be

GRUB_DEFAULT=8

since the 1st entry gets the number 0 and _not_ 1.

Take a look at the GRUB manual:

"Valid keys in /etc/default/grub are as follows:

‘GRUB_DEFAULT’

The default menu entry. This may be a number, in which case it
identifies the Nth entry in the generated menu counted from zero,
or the title of a menu entry, or the special string ‘saved’. Using
the id may be useful if you want to set a menu entry as the default
even though there may be a variable number of entries before it.

For example, if you have:

menuentry 'Example GNU/Linux distribution' --class gnu-linux --id
example-gnu-linux { ...
}

then you can make this the default using:

GRUB_DEFAULT=example-gnu-linux

Previously it was documented the way to use entry title. While this
still works it’s not recommended since titles often contain
unstable device names and may be translated

If you set this to ‘saved’, then the default menu entry will be
that saved by ‘GRUB_SAVEDEFAULT’ or grub-set-default. This relies
on the environment block, which may not be available in all
situations (see Environment block).

The default is ‘0’." -
https://www.gnu.org/software/grub/manual/grub/grub.html


--
ubuntu-users mailing list
ubuntu-***@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-user
Tom H
2018-10-12 09:53:34 UTC
Permalink
On Fri, Oct 12, 2018 at 8:50 AM robert <***@redcor.ch> wrote:
>
> I swaped my motherboard in a 16.04 box with 5 disks.
>
> Now the boot sequence has changed.
>
> I would like to have the 9th entry of the list that is displayed when
> I boot, to be default.
>
> this is what I tried (and failed):
>
> 1. in /etc/default/grub
>
> GRUB_DEFAULT=9
> #GRUB_HIDDEN_TIMEOUT=0
> GRUB_HIDDEN_TIMEOUT_QUIET=true
> GRUB_TIMEOUT=10
> GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
> GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
> GRUB_CMDLINE_LINUX=""
>
> 2. update-grub
>
> however, the default entry does not change.

How are you counting the entries? Is the 9th, the 10th listed in "grub.cfg"?

That's not how it works, unless you set "GRUB_DISABLE_SUBMENU=y".

But by default, your grub menu'll be

linux_1
advanced_options_for_linux_1
linux_2
advanced_options_for_linux_2
...

If you want to boot the 3rd kernel in the
"advanced_options_for_linux_2" submenu, you have to set
"GRUB_DEFAULT=3>2" IIRC.

--
ubuntu-users mailing list
ubuntu-***@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/l
Grizzly via ubuntu-users
2018-10-12 11:10:19 UTC
Permalink
12 October 2018 at 8:48, robert wrote:
changing default grub entry?? (at least in part)

>I would like to have the 9th entry of the list that is displayed when I boot, to
>be default.

Try add/or edit to

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true

Then whatever you "last" used will be default next time

>this is what I tried (and failed):

>1. in /etc/default/grub
>
>     GRUB_DEFAULT=9
>     #GRUB_HIDDEN_TIMEOUT=0
>     GRUB_HIDDEN_TIMEOUT_QUIET=true
>     GRUB_TIMEOUT=10
>     GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
>     GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
>     GRUB_CMDLINE_LINUX=""
>2. update-grub
>
>however, the default entry does not change.
>
>thanks for your help
>
>robert
>
>
>--
>ubuntu-users mailing list
>ubuntu-***@lists.ubuntu.com
>Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



--
ubuntu-users mailing list
ubuntu-***@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/m
Tom H
2018-10-12 13:45:19 UTC
Permalink
On Fri, Oct 12, 2018 at 1:12 PM Grizzly via ubuntu-users
<ubuntu-***@lists.ubuntu.com> wrote:
> 12 October 2018 at 8:48, robert wrote:
>>
>> I would like to have the 9th entry of the list that is displayed when
>> I boot, to be default.
>
> Try add/or edit to
>
> GRUB_DEFAULT=saved
> GRUB_SAVEDEFAULT=true
>
> Then whatever you "last" used will be default next time

You can use "GRUB_DEFAULT=saved" in two ways.

1) You set "GRUB_DEFAULT=saved" and "GRUB_SAVEDEFAULT=true", then
whichever kernel that you're booted from becomes the default after you
run "update-grub" or equivalent.

2) You set "GRUB_DEFAULT=saved" and run "grub-set-default
<kernel_entry_in_grub.cfg>".

kernel_entry_in_grub.cfg can be the entry number ("9") or the menu
name ("Ubuntu, with Linux 4.18.0-8-generic").

I think that you can also use the "$menuentry_id_option"
("gnulinux-4.18.0-8-generic-advanced-2653b879-3c02-4d05-a678-315259e0e11f").

In addition to the weird counting that I showed in my first reply, you
can also avoid "saved" and set GRUB_DEFAULT using the title or the
menuentry_id_option:

GRUB_DEFAULT="Ubuntu, with Linux 4.18.0-8-generic"
or
GRUB_DEFAULT="gnulinux-4.18.0-8-generic-advanced-2653b879-3c02-4d05-a678-315259e0e11f"


>> this is what I tried (and failed):
>
>> 1. in /etc/default/grub
>>
>> GRUB_DEFAULT=9
>> #GRUB_HIDDEN_TIMEOUT=0
>> GRUB_HIDDEN_TIMEOUT_QUIET=true
>> GRUB_TIMEOUT=10
>> GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
>> GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
>> GRUB_CMDLINE_LINUX=""
>> 2. update-grub

--
ubuntu-users mailing list
ubuntu-***@lists.ubuntu.com
Modify settings or unsubscribe at: https:
Grizzly via ubuntu-users
2018-10-12 14:57:58 UTC
Permalink
12 October 2018 at 15:45, Tom H wrote:
Re: changing default grub entry?? (at least in part)

>On Fri, Oct 12, 2018 at 1:12 PM Grizzly via ubuntu-users
><ubuntu-***@lists.ubuntu.com> wrote:
>> 12 October 2018 at 8:48, robert wrote:
>>>
>>> I would like to have the 9th entry of the list that is displayed when
>>> I boot, to be default.
>>
>> Try add/or edit to
>>
>> GRUB_DEFAULT=saved
>> GRUB_SAVEDEFAULT=true
>>
>> Then whatever you "last" used will be default next time
>
>You can use "GRUB_DEFAULT=saved" in two ways.
>
>1) You set "GRUB_DEFAULT=saved" and "GRUB_SAVEDEFAULT=true", then
>whichever kernel that you're booted from becomes the default after you
>run "update-grub" or equivalent.

IME the last entry used is default next boot (update-grub only needed after
initial grub edit)

I'm not totally sure "if" a recovery mode was the last choice it would be
default next time (not tested)

--
ubuntu-users mailing list
ubuntu-***@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com
Tom H
2018-10-31 10:10:26 UTC
Permalink
On Fri, Oct 12, 2018 at 4:59 PM Grizzly via ubuntu-users
<ubuntu-***@lists.ubuntu.com> wrote:
> 12 October 2018 at 15:45, Tom H wrote:
> Re: changing default grub entry?? (at least in part)
>> On Fri, Oct 12, 2018 at 1:12 PM Grizzly via ubuntu-users
>> <ubuntu-***@lists.ubuntu.com> wrote:
>>> 12 October 2018 at 8:48, robert wrote:
>>>>
>>>> I would like to have the 9th entry of the list that is displayed when
>>>> I boot, to be default.
>>>
>>> Try add/or edit to
>>>
>>> GRUB_DEFAULT=saved
>>> GRUB_SAVEDEFAULT=true
>>>
>>> Then whatever you "last" used will be default next time
>>
>> You can use "GRUB_DEFAULT=saved" in two ways.
>>
>> 1) You set "GRUB_DEFAULT=saved" and "GRUB_SAVEDEFAULT=true", then
>> whichever kernel that you're booted from becomes the default after you
>> run "update-grub" or equivalent.
>
> IME the last entry used is default next boot (update-grub only needed after
> initial grub edit)
>
> I'm not totally sure "if" a recovery mode was the last choice it would be
> default next time (not tested)

If you say so; I might be misremembering. I'd have to check the
manpage but I don't have the time now.

--
ubuntu-users mailing list
ubuntu-***@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubunt
Ralf Mardorf via ubuntu-users
2018-10-12 23:49:13 UTC
Permalink
On Fri, 12 Oct 2018 15:45:19 +0200, Tom H wrote:
>In addition to the weird counting that I showed in my first reply, you
>can also avoid "saved" and set GRUB_DEFAULT using the title or the
>menuentry_id_option:

https://lists.ubuntu.com/archives/ubuntu-users/2018-October/295498.html

https://www.gnu.org/software/grub/manual/grub/grub.html


--
ubuntu-users mailing list
ubuntu-***@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubun
Tom H
2018-10-31 10:13:18 UTC
Permalink
On Sat, Oct 13, 2018 at 1:51 AM Ralf Mardorf via ubuntu-users
<ubuntu-***@lists.ubuntu.com> wrote:
> On Fri, 12 Oct 2018 15:45:19 +0200, Tom H wrote:
>>
>> In addition to the weird counting that I showed in my first reply, you
>> can also avoid "saved" and set GRUB_DEFAULT using the title or the
>> menuentry_id_option:
>
> https://lists.ubuntu.com/archives/ubuntu-users/2018-October/295498.html
>
> https://www.gnu.org/software/grub/manual/grub/grub.html

Thanks

--
ubuntu-users mailing list
ubuntu-***@lists.ubuntu.com
Modify settings or unsubscribe at: https:/
Loading...