Grub ignores TIMEOUT options on /etc/default/grub

Bug #1273764 reported by Edwin Pujols on 2014-01-28
142
This bug affects 32 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Medium
Unassigned
Vivid
Medium
Unassigned

Bug Description

This is a fresh install of trusty (amd64), without proposed (since this grub package has reached the regular repos).

I have attached my `/etc/default/grub` file. After modifying it, I make sure to run update-grub, but the changes won't take effect on next reboot: the menu is shown with a timeout of 10 seconds even when GRUB_TIMEOUT_STYLE is set to countdown.

After reading grub.cfg and googling a bit I found this:

https://gist.github.com/LeahCim/9332432

(30_os-prober is overriding the values of GRUB_TIMEOUT and GRUB_TIMEOUT_STYLE.)

Description: Ubuntu Trusty Tahr (development branch)
Release: 14.04

grub-pc:
  Installed: 2.02~beta2-7
  Candidate: 2.02~beta2-7
  Version table:
 *** 2.02~beta2-7 0
        500 http://do.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status

Edwin Pujols (edwinpm5) wrote :
description: updated
Colin Watson (cjwatson) wrote :

You have misspelled "countdown" as "countdowm". Try fixing that?

Fixed the typo, then ran update-grub and rebooted, but the issue persists.
(BTW, shouldn't I have been warned by grub about the type?)

On Tue, Jan 28, 2014 at 6:48 PM, Colin Watson <email address hidden>wrote:

> You have misspelled "countdown" as "countdowm". Try fixing that?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1273764
>
> Title:
> Grub-pc ignores the options on /etc/default/grub
>
> Status in “grub2” package in Ubuntu:
> New
>
> Bug description:
> On trusty-proposed:
>
> I have attached my `/etc/default/grub` file. After modifying it, I
> make sure to run update-grub, but the changes won't take effect on
> next reboot: the menu is shown with a timeout of 10 seconds.
>
> grub-pc:
> Installed: 2.02~beta2-5
> Candidate: 2.02~beta2-5
> Version table:
> *** 2.02~beta2-5 0
> 500 http://do.archive.ubuntu.com/ubuntu/ trusty/main i386
> Packages
> 100 /var/lib/dpkg/status
>
> ProblemType: Bug
> DistroRelease: Ubuntu 14.04
> Package: grub-pc 2.02~beta2-5
> ProcVersionSignature: Ubuntu 3.13.0-5.20-generic 3.13.0
> Uname: Linux 3.13.0-5-generic i686
> ApportVersion: 2.13.2-0ubuntu2
> Architecture: i386
> CurrentDesktop: Unity
> Date: Tue Jan 28 12:37:46 2014
> InstallationDate: Installed on 2014-01-14 (14 days ago)
> InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Alpha i386 (20140113)
> SourcePackage: grub2
> UpgradeStatus: No upgrade log present (probably fresh install)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1273764/+subscriptions
>

Edwin Pujols (edwinpm5) wrote :

For the sake of completeness, I attached the corrected file.

H. van de Kolk (rikolk-f) wrote :

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

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

Also used style=countdown and GRUB-TIMEOUT=0 etc..

menu still showing up and GRUB_TIMEOUT_STYLE=hidden or countdown not working
changes to GRUB-TIMEOUT=0 etc.. have no effect

Edwin Pujols (edwinpm5) wrote :

I noticed that os-prober overrides the timeout value, I also found this workaround:

https://gist.github.com/LeahCim/9332432

Edwin Pujols (edwinpm5) on 2014-04-01
summary: - Grub-pc ignores the options on /etc/default/grub
+ Grub ignores options on /etc/default/grub

I've done a fresh install of trusty (amd64) without proposed enabled, and the issue persists. I noticed the GRUB_TIMEOUT* is been overridden on 30_os-prober. I've updated the bug description.

description: updated
description: updated
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2 (Ubuntu):
status: New → Confirmed
Koalakoker (koalakoker) wrote :

This issue affects also me. Fresh install of 14.04.
Proposed workaround resolve the issue in my system.

Cloudane (cloudane) wrote :

This appears to be by design, to prevent people setting it to 0 and not knowing that you can hit shift (or escape if that fails) to get the menu back.

On a Mac and possibly other EFI based systems this is undesirable behaviour as I can already choose what OS to boot from the firmware, in my case by holding ALT, so all this does is add more delays and flickering screens to the boot process.

I love Ubuntu for its tendency to "just work" (much like the Mac's native OS) but I do not need to be babysat, and really must object to cases like this where "nanny scripts" actively fight against me making customisations to my system.

I recommend adding a comment to /etc/default/grub warning users of the 'dangers' of setting it to 0, instead of fighting them. Those who want to tinker with things and not understand what they're doing will always find ways to hose their systems, but most of them are grown adults (if not they are poorly supervised kids) and can take responsibility for their own actions and even learn something from their mistakes. All this does is cause confusion for those who do know what they're doing and work with GRUB in other distros.

I've determined the cause of this bug in my case: I have a small /boot partition outside of the root filesystem (btrfs).
Turns out that that boot partition was not added to the /etc/fstab, so all the kernel upgrading and upgrade-grub operations I was doing were in fact affecting the /boot directory inside the root (btrfs) filesystem, not the actual boop (ext2) partition.

Added the partition to /etc/fstab, cleaned the /boot mountpoint and now all is good in the world. :-)

Liz W (no-name) wrote :

+1 for Cloudane's post #12 - I am using Ubuntu because I want to be able to take my own decisions, and do not want to be "protected" by features somebody else thinks are good for me. Otherwise I could just use Windows instead....

Workaround worked for me, thanks for this!

Øyvind Stegard (oyvinst) wrote :

+1 for fixing this. The current situation is broken, since timeout settings in /etc/default/grub do not work as expected.

alfa (alfa42) wrote :

Same thing here. Fresh install on v14.04.1 LTS (amd64) and there is no way to make the changes in /etc/default/grub to work.

Phillip Susi (psusi) wrote :

I'm not seeing any references to any kind of TIMEOUT in os-prober. Can you be more specific?

Changed in grub2 (Ubuntu):
status: Confirmed → Incomplete
Edwin Pujols (edwinpm5) wrote :

@psusi, Please look in /etc/grub.d/30_os-prober. In particular, the last line reads:

> adjust_timeout

And the definition of `adjust_timeout` is:

> adjust_timeout () {
> if [ "$quick_boot" = 1 ] && [ "x${found_other_os}" != "x" ]; then
> cat << EOF
> set timeout_style=menu
> if [ "\${timeout}" = 0 ]; then
> set timeout=10
> fi
> EOF
> fi
> }

As you can see the `timeout` variable is set/reset to 10 (seconds).

Edwin Pujols (edwinpm5) on 2015-01-06
Changed in grub2 (Ubuntu):
status: Incomplete → Confirmed
Phillip Susi (psusi) wrote :

That is very odd.. this "timeout" variable appears to be local to that script and not used for anything. 00_header uses GRUB_TIMEOUT.

Phillip Susi (psusi) wrote :

gah! nevermind... all the darn HERE documents these scripts use keep confusing my eyes... that part is being echoed to the grub cfg.

Phillip Susi (psusi) wrote :

Yep... that code seems to be ubuntu specific and comes from quick_boot.patch.

Changed in grub2 (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Medium
tags: added: vivid
tags: added: rls-v-incoming
tags: removed: rls-v-incoming
tags: added: rls-w-incoming
summary: - Grub ignores options on /etc/default/grub
+ Grub ignores TIMEOUT options on /etc/default/grub
tags: added: rls-w-notfixng
removed: rls-w-incoming

A workaround without editing any scripts or binaries:
GRUB_TIMEOUT=0.1

Works for me.

GRUB_TIMEOUT=0.1 gives me Peppermint Linux 7 unless I hit <Esc> when booting to go to Windows 7 again, which is what I very much want until 2020.

Thanks.

"
Kirils Solovjovs (linux-kirils) wrote on 2015-11-02: #22

A workaround without editing any scripts or binaries:
GRUB_TIMEOUT=0.1

Works for me.
"

Niora (naumovvladislav) wrote :

This bug is also present in Ubuntu 16.04 Xenial LTS (if to be straight - I use Linux Mint 18.1, based on it).

Can we correct it and backport to 16.04 LTS?
This bug is absent in current Debian unstable.

Thank you.

Niora (naumovvladislav) wrote :

os-proper breaks logic, set by /etc/default/grub in case, when GRUB_TIMEOUT=0, because he adds to /boot/grub/grub.cfg such lines: < http://pastebin.com/Py2VD3Qt >

Full text of my /boot/grub/grub.cfg: http://pastebin.com/QzcCfV2q

Justo (jtorres1825) wrote :

Workaround in #8 worked for me.

Ubuntu Gnome 16.04 LTS - UEFI boot

Xebozone (markdavidoff) wrote :

Workaround in #8 works for me too
Work-around created 3 years ago! Wow... I can't believe this simple fix is not fixed...

M Griffin (mgriffin3390) wrote :

I'm dual-booting Windows 10 and Kubuntu 16.10 and I had the issue with the grub2 config file having a 10 second timeout then defaulting to 30 seconds upon boot.

I tried the workaround in post #8 which then caused my boot menu to be completely hidden. I then removed both files described in the workaround and removed the GRUB_HIDDEN_TIMEOUT value and ran sudo update-grub which seemed to have fixed my problem.
I have also had hibernation enabled for some time as noted in the GRUB_CMDLINE_LINUX_DEFAULT "resume=UUID=xxxxx" (swap partition) argument. I find hibernation extremely useful with laptops (I've removed the UUID for security reasons)

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=
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 resume=UUID=xxxxx"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

Eugene (egnk) wrote :

After 7 years of not using Linux, I just installed Ubuntu 16.04.03 and it looks like grub2 completely ignores TIME_OUT settings, so I can't hide the grub menu. Any plans to fix this? I remember this used to work in the past. Grub had no problems with TIME_OUT=0 but now it does. I already spent 4 hours searching over the Internet how to fix this.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers