[SOLVED] Reduce grub timeout in uefi installation (Mint 20

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
argy
Level 1
Level 1
Posts: 6
Joined: Wed Jul 15, 2015 11:36 am

[SOLVED] Reduce grub timeout in uefi installation (Mint 20

Post by argy »

Hi,

I have a dual boot set up with mint mate 20 on one ssd and windows 10 on another ssd, both use the UEFI platform. Everything works fine except that grub times out at 30 seconds despite my /etc/default/grub file looking like this:

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

I read elsewhere that MINT made some changes to how grub works and if you look in /boot/grub/grub.cfg you will find a line which says

if [ $grub_platform = efi ]; then set timeout=30

Because my platform is UEFI then the timeout can't be changed other than by editing /boot/grub/grub.cfg despite the warning not to do so.

So, my question to the mint community is how else can I change the timeout value from 30 seconds to 4 seconds without editing /boot/grub/grub.cfg?

I understand that running sudo update-grub will probably reset the change that I have made to /boot/grub/grub.cfg so i'll just avoid running that command. Is there any particular reason why UEFI should be set to 30 seconds? Other than being reset by sudo update-grub is there any reason to not edit /boot/grub/grub.cfg

Is there a more elegant / acceptable solution?

I look forward to hearing from someone in the know :-)

Thanks in anticipation
Last edited by argy on Wed Oct 28, 2020 7:55 am, edited 6 times in total.
User avatar
antikythera
Level 15
Level 15
Posts: 5725
Joined: Thu Jul 02, 2020 12:52 pm
Location: Cymru

Re: reduce grub timeout in uefi installation

Post by antikythera »

try setting the timeout in /etc/default/grub to 0.1

don't forget to do this afterwards:

sudo update-grub
I’ll tell you a DNS joke but be advised, it could take up to 24 hours for everyone to get it.
User avatar
slipstick
Level 6
Level 6
Posts: 1090
Joined: Sun Oct 21, 2012 9:56 pm
Location: Somewhere on the /LL0 scale

Re: reduce grub timeout in uefi installation

Post by slipstick »

I don't see that particular line in my /boot/grub/grub.cfg on LM18.3 or LM19.3, so assume it must be unique to LM20 which I don't have installed. Anyway, the grub.cfg file is built up from, in addition to the /etc/default/grub file, some files in /etc/grub.d - in particular take a look at /etc/grub.d/00_header. Maybe you can see where that line comes from and change it there.
In theory, theory and practice are the same. In practice, they ain't.
User avatar
Kadaitcha Man
Level 16
Level 16
Posts: 6102
Joined: Mon Aug 27, 2012 10:17 pm

Re: reduce grub timeout in uefi installation

Post by Kadaitcha Man »

slipstick wrote:
Wed Oct 28, 2020 1:36 am
I don't see that particular line in my /boot/grub/grub.cfg
That might be because you were told /etc/default/grub.
[*] All kadaitcha men are liars
User avatar
slipstick
Level 6
Level 6
Posts: 1090
Joined: Sun Oct 21, 2012 9:56 pm
Location: Somewhere on the /LL0 scale

Re: reduce grub timeout in uefi installation

Post by slipstick »

Kadaitcha Man wrote:
Wed Oct 28, 2020 1:57 am
slipstick wrote:
Wed Oct 28, 2020 1:36 am
I don't see that particular line in my /boot/grub/grub.cfg
That might be because you were told /etc/default/grub.
In the OP, the "if [ $grub_platform = efi ]; then set timeout=30" line is said to be in /boot/grub/grub.cfg.
In theory, theory and practice are the same. In practice, they ain't.
User avatar
Kadaitcha Man
Level 16
Level 16
Posts: 6102
Joined: Mon Aug 27, 2012 10:17 pm

Re: reduce grub timeout in uefi installation

Post by Kadaitcha Man »

slipstick wrote:
Wed Oct 28, 2020 2:13 am
Kadaitcha Man wrote:
Wed Oct 28, 2020 1:57 am
slipstick wrote:
Wed Oct 28, 2020 1:36 am
I don't see that particular line in my /boot/grub/grub.cfg
That might be because you were told /etc/default/grub.
In the OP...
In the response from @antikythera: try setting the timeout in /etc/default/grub to 0.1

Most people can't read minds, so it helps if you quote what you are responding to. Since your statement was directly below what you were told, it is reasonable to assume that that is what you were replying to.
[*] All kadaitcha men are liars
User avatar
antikythera
Level 15
Level 15
Posts: 5725
Joined: Thu Jul 02, 2020 12:52 pm
Location: Cymru

Re: reduce grub timeout in uefi installation

Post by antikythera »

Kadaitcha Man wrote:
Wed Oct 28, 2020 2:30 am
slipstick wrote:
Wed Oct 28, 2020 2:13 am
Kadaitcha Man wrote:
Wed Oct 28, 2020 1:57 am


That might be because you were told /etc/default/grub.
In the OP...
In the response from @antikythera: try setting the timeout in /etc/default/grub to 0.1

Most people can't read minds, so it helps if you quote what you are responding to. Since your statement was directly below what you were told, it is reasonable to assume that that is what you were replying to.
Exactly, which is why I didn't quote the post directly above :lol:
I’ll tell you a DNS joke but be advised, it could take up to 24 hours for everyone to get it.
argy
Level 1
Level 1
Posts: 6
Joined: Wed Jul 15, 2015 11:36 am

Re: reduce grub timeout in uefi installation

Post by argy »

Thanks for your responses. I'll feed back in stages after testing each idea.

First I ran sudo update-grub and as expected /boot/grub/grub.cfg reverted to 30 seconds
I then edited /etc/default/grub as shown below, setting timeout to 0.1 and then running sudo update-grub again

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0.1
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

As expected this did nothing, the boot timeout remains at 30 seconds

I do not understand why setting timeout in grub to something other than the number you would expect could be considered to resolve issues but at least I now know that it doesn't. The real answer has to lie somewhere in the components which make up /boot/grub/grub.cfg and that is where I will look next. It's odd that /boot/grub/grub.cfg overrides the default grub

More later...
User avatar
antikythera
Level 15
Level 15
Posts: 5725
Joined: Thu Jul 02, 2020 12:52 pm
Location: Cymru

Re: reduce grub timeout in uefi installation

Post by antikythera »

Very odd, if 0.1 doesn't work then try 1 instead and see if that's any better. Mine is set to 5 seconds and works okay. If you are wondering why it doesn't say splash I uninstalled Plymouth so there was no point keeping that value.

Code: Select all

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="nowatchdog"
I’ll tell you a DNS joke but be advised, it could take up to 24 hours for everyone to get it.
argy
Level 1
Level 1
Posts: 6
Joined: Wed Jul 15, 2015 11:36 am

Re: reduce grub timeout in uefi installation

Post by argy »

slipstick wrote:
Wed Oct 28, 2020 1:36 am
I don't see that particular line in my /boot/grub/grub.cfg on LM18.3 or LM19.3, so assume it must be unique to LM20 which I don't have installed. Anyway, the grub.cfg file is built up from, in addition to the /etc/default/grub file, some files in /etc/grub.d - in particular take a look at /etc/grub.d/00_header. Maybe you can see where that line comes from and change it there.
This next response resolved the timeout issue but doesn't answer the question"why?" I mean, why has MINT seen fit to over ride the default grub settings by forcing uefi platforms to require a 30 second timeout without any simple mechanism for changing it.

So the fix is to follow the direction of @slipstick and to look in /etc/grub.d/00_header

Towards the bottom of that file is a section which goes:

if [ "$recordfail_broken" = 1 ]; then
cat << EOF
if [ \$grub_platform = efi ]; then
set timeout=${GRUB_RECORDFAIL_TIMEOUT:-30}
if [ x\$feature_timeout_style = xy ] ; then
set timeout_style=menu
fi
fi
EOF

Changing the timeout value here will survive sudo update-grub and cause the system to automatically select the default OS after the chosen timeout period.

This problem started after upgrading from 19.3 to 20 which may be why slipstick didn't see the issue in any of the earlier versions. Being a bit of a newb and always assuming it's me that is wrong I went through a complete windows 10 reinstall and a fresh Mint 20 install over a couple of hair tearing days only to discover that the 30 second issue remained. I did a lot of searching and came across the grub.cfg fix and wasn't happy with that. I had also looked in /etc/grub.d/30_uefi-firmware then gave up and asked here.

I will leave this showing as unsolved for a short while in case anyone from MINT wants to comment.

Thanks for now to @slipstick for the great pointer
JeremyB
Level 21
Level 21
Posts: 12561
Joined: Fri Feb 21, 2014 8:17 am

Re: reduce grub timeout in uefi installation

Post by JeremyB »

argy wrote:
Wed Oct 28, 2020 6:07 am
slipstick wrote:
Wed Oct 28, 2020 1:36 am
I don't see that particular line in my /boot/grub/grub.cfg on LM18.3 or LM19.3, so assume it must be unique to LM20 which I don't have installed. Anyway, the grub.cfg file is built up from, in addition to the /etc/default/grub file, some files in /etc/grub.d - in particular take a look at /etc/grub.d/00_header. Maybe you can see where that line comes from and change it there.
This next response resolved the timeout issue but doesn't answer the question"why?" I mean, why has MINT seen fit to over ride the default grub settings by forcing uefi platforms to require a 30 second timeout without any simple mechanism for changing it.

So the fix is to follow the direction of @slipstick and to look in /etc/grub.d/00_header

Towards the bottom of that file is a section which goes:

if [ "$recordfail_broken" = 1 ]; then
cat << EOF
if [ \$grub_platform = efi ]; then
set timeout=${GRUB_RECORDFAIL_TIMEOUT:-30}
if [ x\$feature_timeout_style = xy ] ; then
set timeout_style=menu
fi
fi
EOF

Changing the timeout value here will survive sudo update-grub and cause the system to automatically select the default OS after the chosen timeout period.

This problem started after upgrading from 19.3 to 20 which may be why slipstick didn't see the issue in any of the earlier versions. Being a bit of a newb and always assuming it's me that is wrong I went through a complete windows 10 reinstall and a fresh Mint 20 install over a couple of hair tearing days only to discover that the 30 second issue remained. I did a lot of searching and came across the grub.cfg fix and wasn't happy with that. I had also looked in /etc/grub.d/30_uefi-firmware then gave up and asked here.

I will leave this showing as unsolved for a short while in case anyone from MINT wants to comment.

Thanks for now to @slipstick for the great pointer
The Grub package is not maintained by Mint and any change in /etc/grub.d will likely be removed with an update to the grub package
Post Reply

Return to “Installation & Boot”