Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: GRUB_TIMEOUT=0 not working as expected

  1. #1
    Join Date
    Apr 2009
    Beans
    279
    Distro
    Xubuntu 18.04 Bionic Beaver

    GRUB_TIMEOUT=0 not working as expected

    WindowsXP E0L is next month and I would like to keep the partition active for a while yet boot directly into Linux without the Grub2 menu and the timeout. If I set GRUB_TIMEOUT=0, Grub will still default to waiting 10 seconds. But if I set GRUB_TIMEOUT=1 it works as expected and displays the menu only 1 second. Why won't it work for GRUB_TIMEOUT=0? I make sure to run 'sudo update-grub' after every update. Here is my complete /etc/default/grub file:
    Code:
    # 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=0
    GRUB_HIDDEN_TIMEOUT_QUIET=true
    GRUB_TIMEOUT=0
    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"

  2. #2
    Join Date
    Mar 2010
    Location
    India
    Beans
    8,149
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: GRUB_TIMEOUT=0 not working as expected

    Setting "GRUB_TIMEOUT" value to 0 is not a good idea. If it is defaulting to 10 seconds, I think it is in fact an 'Improvement' in Grub2 to avoid some troubles users used to get in after setting it to 0.

    As far as I remember, setting it to 0 used to do what you expect it to do - boot immediately into the default selection. However, think of the situation when you set windows as the "Default" selection and set the GRUB_TIMEOUT" to 0. What will happen? A trouble - you will NEVER get a chance to boot into Ubuntu again and change this setting back. Booting with a Live CD was the only option left to fix it.

    That's why I think it is actually an Improvement if now it is defaulting to 10 seconds.

    The Recommended Way to do what you want is to RESET the GRUB_TIMEOUT value to 10 (at least 3) seconds, THEN uncomment this line -
    Code:
    #GRUB_HIDDEN_TIMEOUT=0
    As soon as it is uncommented, with its value being 0, Grub will start to boot right away into the default selection, without waiting for any timeout (unless you interrupt the booting by pressing 'Shift' at boot time).

    The GRUB_TIMEOUT becomes effective only when the menu is displayed. With the above change, it won't display, as if it were a single OS system (actually it is uncommented by default if there is no other OS on the system).

    So.. the recommended file would look like this -
    Code:
    # 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=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=""
    
    # 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"
    Make it look like above, then do a "sudo update-grub". Then come back and let us know if it did what you wanted.

    For a detailed information about what each provided option does and when, please refer to this awesome post by drs305 : http://ubuntuforums.org/showthread.php?t=1195275

    The same (updated) information is also available on the community wiki page, but is scattered across multiple pages : https://help.ubuntu.com/community/Grub2
    Last edited by varunendra; March 8th, 2014 at 09:54 PM.
    Varun
    Help others by marking threads as [SOLVED], if they are. (See how)
    Wireless Script | Use Code Tags

  3. #3
    Join Date
    Apr 2009
    Beans
    279
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: GRUB_TIMEOUT=0 not working as expected

    It looks like I may have to delete the Windows partition for it to work, and even then I'm not so sure.
    Code:
    ~$ sudo update-grub
    Generating grub.cfg ...
    Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
    Found linux image: /boot/vmlinuz-3.2.0-60-generic
    Found initrd image: /boot/initrd.img-3.2.0-60-generic
    Found linux image: /boot/vmlinuz-3.2.0-59-generic
    Found initrd image: /boot/initrd.img-3.2.0-59-generic
    Found linux image: /boot/vmlinuz-3.2.0-58-generic
    Found initrd image: /boot/initrd.img-3.2.0-58-generic
    Found memtest86+ image: /boot/memtest86+.bin
    Found Microsoft Windows XP Home Edition on /dev/sda1
    done

  4. #4
    Join Date
    Mar 2010
    Location
    India
    Beans
    8,149
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: GRUB_TIMEOUT=0 not working as expected

    Quote Originally Posted by donsy View Post
    It looks like I may have to delete the Windows partition for it to work, and even then I'm not so sure.
    If you are worried about the warning, I believe you can ignore it, it may be just a notification (can't test here, since I still have an older version of Grub2). Reboot to test if the change took effect.

    Also, since it is complaining about non-zero value, and a zero-value is already defaulting to 10 seconds, I think it is (with the new changes in newer version) safe now to set it to zero like you were doing. What I wrote was applicable to the version I am using (and the older ones), maybe it is zero by default for new versions. In any case, it shouldn't hurt if Ubuntu is set as the default OS.

    And if you are worried about it detecting XP, I think that can be (should be) ignored as well, since it doesn't matter when the menu is going to bypassed anyway.

    However, IF you want (or really need) to disable the detection of XP, just disable the "os-prober" script temporarily -
    Code:
    sudo chmod -x /usr/bin/os-prober
    Then run an "update-grub" again. The os-prober part won't work this time, so XP won't get detected.

    To enable the os-prober again -
    Code:
    sudo chmod +x /usr/bin/os-prober
    Varun
    Help others by marking threads as [SOLVED], if they are. (See how)
    Wireless Script | Use Code Tags

  5. #5
    Join Date
    Apr 2009
    Beans
    279
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: GRUB_TIMEOUT=0 not working as expected

    Quote Originally Posted by varunendra View Post
    If you are worried about the warning, I believe you can ignore it, it may be just a notification (can't test here, since I still have an older version of Grub2). Reboot to test if the change took effect.

    Also, since it is complaining about non-zero value, and a zero-value is already defaulting to 10 seconds, I think it is (with the new changes in newer version) safe now to set it to zero like you were doing. What I wrote was applicable to the version I am using (and the older ones), maybe it is zero by default for new versions. In any case, it shouldn't hurt if Ubuntu is set as the default OS.

    And if you are worried about it detecting XP, I think that can be (should be) ignored as well, since it doesn't matter when the menu is going to bypassed anyway.

    However, IF you want (or really need) to disable the detection of XP, just disable the "os-prober" script temporarily -
    Code:
    sudo chmod -x /usr/bin/os-prober
    Then run an "update-grub" again. The os-prober part won't work this time, so XP won't get detected.

    To enable the os-prober again -
    Code:
    sudo chmod +x /usr/bin/os-prober
    Yes I tried both re-booting and and also setting both values to zero with no effect. As for os-prober, I think I'll just wait until 14.04 is released next month and then delete the Windows partition and resize my Linux root and home partitions before installing. Thank you so much for your help.

  6. #6
    Join Date
    Jul 2010
    Location
    ozarks, Arkansas, USA
    Beans
    12,873
    Distro
    Xubuntu Development Release

    Re: GRUB_TIMEOUT=0 not working as expected

    donsy; Hi !

    My 2 pounds worth - if it helps:
    My grub control file version 13.10 install, multi-booting - with the prescribed alterations not to get those errors !
    I do want to see my grub menu at boot.
    Code:
    GRUB_DEFAULT=0
    #GRUB_HIDDEN_TIMEOUT=0#as per https://help.ubuntu.com/community/Grub2/Setup#Configuring_GRUB_2 ##
    GRUB_HIDDEN_TIMEOUT_QUIET=false #changed to false from true##
    GRUB_TIMEOUT=10
    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
    GRUB_CMDLINE_LINUX=""
    hope this helps
    THE current(cy) in Documentation:
    https://help.ubuntu.com/community/PopularPages

    Happy ubuntu'n !

  7. #7
    Join Date
    Apr 2009
    Beans
    279
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: GRUB_TIMEOUT=0 not working as expected

    That didn't work either. Thanks for your help.

  8. #8
    Join Date
    Jul 2010
    Location
    ozarks, Arkansas, USA
    Beans
    12,873
    Distro
    Xubuntu Development Release

    Re: GRUB_TIMEOUT=0 not working as expected

    donsy; Hello,

    My understanding: to adjust which menu entry boots as 1st by default;
    a) find the menu entry number ( numbering starts at 0)
    Code:
    sudo grep menuentry /boot/grub/grub.cfg
    b)grub-set-default - Script to set a default boot entry for GRUB.
    Code:
    sudo grub-set-default 2
    change '2' to your desired menu entry number.
    c)Before that will work, the top line in the /etc/default/grub file that looks like 'GRUB_DEFAULT=0' needs to be changed to 'GRUB_DEFAULT=saved'. See Editing /etc/default/grub. Make sure you remember to run 'sudo update-grub' after editing your /etc/default/grub file, for the changes to take effect.

    https://help.ubuntu.com/community/Grub2
    http://ubuntuforums.org/showthread.php?t=1195275

    just a bit more
    to try and help
    THE current(cy) in Documentation:
    https://help.ubuntu.com/community/PopularPages

    Happy ubuntu'n !

  9. #9
    Join Date
    Mar 2010
    Location
    India
    Beans
    8,149
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: GRUB_TIMEOUT=0 not working as expected

    Bashing-om,

    I think your suggestion is for making Windows the default option, while the OP wants to boot directly into Linux -
    I would like to keep the partition active for a while yet boot directly into Linux without the Grub2 menu and the timeout.
    So I think everything is already set as should be, just the timeout or the grub screen is what they wish to avoid.

    I believe disabling the os-prober script + update-grub should do the job. Just tried here (on my 12.04.2) and it indeed does that.

    However, to get the windows entry back, the os-prober must be enabled again -
    Code:
    sudo chmod +x /usr/bin/os-prober
    ..followed by an "update-grub".

    I think what they actually want is to keep the entry, just avoid the grub menu, which is doable here on my system, not sure what may be the problem with 13.10.
    Varun
    Help others by marking threads as [SOLVED], if they are. (See how)
    Wireless Script | Use Code Tags

  10. #10
    Join Date
    Jul 2010
    Location
    ozarks, Arkansas, USA
    Beans
    12,873
    Distro
    Xubuntu Development Release

    Re: GRUB_TIMEOUT=0 not working as expected

    varunendra;

    I am often taken-a-back by what I do not know and what I am trying to learn. However, I would think this procedure will work to make any menu entry the default and setting the "timeout" as '0' would boot that entry with no display of the grub menu (??).

    Bunches I still do not know ->
    I remain
    open to learn better
    THE current(cy) in Documentation:
    https://help.ubuntu.com/community/PopularPages

    Happy ubuntu'n !

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •