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

Thread: Disabling countdown bar in GRUB2

  1. #1

    Default Disabling countdown bar in GRUB2

    Hi,

    OpenSUSE is nice, speedy distro, I like it. But, I dont like when grub2 displays its countdown bar, Id like to disable it. Ive read many articles on that, none of them were accurate. And Id like to ask you if there is a way to disable this bar?

    Waikting for help,

    Cheers,

  2. #2

    Default Re: Disabling countdown bar in GRUB2

    You need to edit the file /etc/default/grub

    You need to be root. Enter the root's password.

    Code:
    Msi:~ # su -
    Password:
    Now you can check-out /etc/default/grub

    Code:
    Msi:~ # cat /etc/default/grub
    # Modified by YaST2. Last modification on
    # THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
    # For the new kernel it try to figure out old parameters. In case we are not able to recognize it (e.g. change of flavor or strange install order ) it it use as fallback installation parameters from /etc/sysconfig/bootloader
    
    # If you change this file, run 'grub2-mkconfig -o /boot/grub2/grub.cfg' afterwards to update
    # /boot/grub2/grub.cfg.
    GRUB_DISTRIBUTOR="openSUSE 13.1"
    GRUB_DEFAULT=saved
    GRUB_HIDDEN_TIMEOUT=0
    GRUB_HIDDEN_TIMEOUT_QUIET=true
    GRUB_TIMEOUT=8
    GRUB_CMDLINE_LINUX_DEFAULT=" resume=/dev/disk/by-label/Msi_Swap splash=verbose quiet showopts"
    # kernel command line options for failsafe mode
    GRUB_CMDLINE_LINUX_RECOVERY="showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe"
    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=gfxterm
    # 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=auto
    # 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_LINUX_RECOVERY=true
    # Uncomment to get a beep at grub start
    #GRUB_INIT_TUNE="480 440 1"
    # Skip 30_os-prober if you experienced very slow in probing them
    # WARNING foregin OS menu entries will be lost if set true here
    GRUB_DISABLE_OS_PROBER=true
    GRUB_THEME=/boot/grub2/themes/openSUSE/theme.txt
    GRUB_BACKGROUND=/boot/grub2/themes/openSUSE/background.png
    To be more specific about what your are looking for use grep.
    Code:
    Msi:~ # grep -i grub_timeout /etc/default/grub
    GRUB_TIMEOUT=8
    You need to change that 8 into a negative integer but first backup that file.

    Code:
    cp -v /etc/default/grub /etc/default/grub.old
    8 is the default value if change that already make sure to just copy paste that entry in this ex code.
    The first GRUB_TIMEOUT inside the slash is the default value (colored blue) the second entry (colored red) is the value you want to replace GRUB_TIMEOUT with so don't mix them up.
    Code:
    ex -sc '%s/GRUB_TIMEOUT=8/GRUB_TIMEOUT=-1/ge|x' /etc/default/grub
    Now check again it should be -1.
    Code:
    Msi:~ # grep -i grub_timeout /etc/default/grub
    GRUB_TIMEOUT=-1
    For that to take effect invoke grub2-mkconfig ang point it to grub.cfg
    Code:
    grub2-mkconfig -o /boot/grub2/grub.cfg
    That will disable the grub timer. If in case you bork your /etc/default/grub you can always copy from the .old which you have done before editing the original file.
    Good luck.

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    30,496

    Default Re: Disabling countdown bar in GRUB2

    That is a nice and extensive description and I have no doubt it works.

    But what about YasT > System > Bootloader and then click on Bootloader Options and there it is: Time out in Seconds. Change to 0 and off you go.

    After all YaST is the system management tool of openSUSE and one of the main reasons to prefer openSUSE above other distros. Thus why not use it? It is so obvious.
    Henk van Velden

  4. #4

    Default Re: Disabling countdown bar in GRUB2

    Unfortunately 0 will just make you boot directly and no option/time to choose which os to boot and from experience you cannot enter a negative number to disable timeout in grub when using yast2 bootloader .

  5. #5

    Default Re: Disabling countdown bar in GRUB2

    Thank you all for replies.... I did quick edit to /etc/default/grub and it works well for me. Thanks jetchisel

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    30,496

    Default Re: Disabling countdown bar in GRUB2

    Quote Originally Posted by jetchisel View Post
    Unfortunately 0 will just make you boot directly and no option/time to choose which os to boot and from experience you cannot enter a negative number to disable timeout in grub when using yast2 bootloader .
    I admit that I read the OP's question as: how can I disable it so that it boots directly and thus save 8 secs of time. Of course that means that you can not intervene amymore, but I assumed that the OP has meditated about this before he asked.

    But your idea to make the GRUB screen stay there until eternity or until manual action (which one comes first) might also be an interpretation.

    This is how things go when people ask for help with the step without explaining their goal: http://www.catb.org/~esr/faqs/smart-questions.html#goal
    Henk van Velden

  7. #7
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    16,313

    Default Re: Disabling countdown bar in GRUB2

    I'd like to point out it is dangerous to do a zero wait. If for some reason a kernel update or other change causes a boot problem you are stuck no way to drop back a kernel version and boot from there. You can also bypass the wait by hitting enter and still have the ability to recover from disaster

  8. #8
    Join Date
    Nov 2013
    Location
    Kamloops, BC, Canada
    Posts
    4,029

    Default Re: Disabling countdown bar in GRUB2

    Quote Originally Posted by gogalthorp View Post
    I'd like to point out it is dangerous to do a zero wait. If for some reason a kernel update or other change causes a boot problem you are stuck no way to drop back a kernel version and boot from there. You can also bypass the wait by hitting enter and still have the ability to recover from disaster
    Hide GRUB unless the Shift key is held down

    In order to achieve the fastest possible boot, instead of having GRUB wait for a timeout, it is possible for GRUB to hide the menu, unless the Shift key is held down during GRUB's start-up.

    In order to achieve this, you should add the following line to /etc/default/grub:
    Code:
    GRUB_FORCE_HIDDEN_MENU="true"
    And the following file should be created:
    /etc/grub.d/31_hold_shift

    Contents of the file are:

    Code:
    #! /bin/sh
    set -e
    
    
    # grub-mkconfig helper script.
    # Copyright (C) 2006,2007,2008,2009  Free Software Foundation, Inc.
    #
    # GRUB is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    #
    # GRUB is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
    
    
    prefix="/usr"
    exec_prefix="${prefix}"
    datarootdir="${prefix}/share"
    
    
    export TEXTDOMAIN=grub
    export TEXTDOMAINDIR="${datarootdir}/locale"
    source "${datarootdir}/grub2/grub-mkconfig_lib"
    
    
    found_other_os=
    
    
    make_timeout () {
    
    
      if [ "x${GRUB_FORCE_HIDDEN_MENU}" = "xtrue" ] ; then 
        if [ "x${1}" != "x" ] ; then
          if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
        verbose=
          else
        verbose=" --verbose"
          fi
    
    
          if [ "x${1}" = "x0" ] ; then
        cat <<EOF
    if [ "x\${timeout}" != "x-1" ]; then
      if keystatus; then
        if keystatus --shift; then
          set timeout=-1
        else
          set timeout=0
        fi
      else
        if sleep$verbose --interruptible 3 ; then
          set timeout=0
        fi
      fi
    fi
    EOF
          else
        cat << EOF
    if [ "x\${timeout}" != "x-1" ]; then
      if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
        set timeout=0
      fi
    fi
    EOF
          fi
        fi
      fi
    }
    
    
    adjust_timeout () {
      if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
        cat <<EOF
    if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
    EOF
        make_timeout "${GRUB_HIDDEN_TIMEOUT_BUTTON}" "${GRUB_TIMEOUT_BUTTON}"
        echo else
        make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}"
        echo fi
      else
        make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}"
      fi
    }
    
    
      adjust_timeout
    
    
        cat <<EOF
    if [ "x\${timeout}" != "x-1" ]; then
      if keystatus; then
        if keystatus --shift; then
          set timeout=-1
        else
          set timeout=0
        fi
      else
        if sleep$verbose --interruptible 3 ; then
          set timeout=0
        fi
      fi
    fi
    EOF
    "Take a Walk on a Sunny Day, Greet everyone along the way, and Make Somebody Smile, Today"
    Gerry Jack Macks"Walk On A Sunny Day" GerryJackMacks.net

  9. #9

    Default Re: Disabling countdown bar in GRUB2

    Quote Originally Posted by hcvv View Post
    I admit that I read the OP's question as: how can I disable it so that it boots directly and thus save 8 secs of time. Of course that means that you can not intervene amymore, but I assumed that the OP has meditated about this before he asked.

    But your idea to make the GRUB screen stay there until eternity or until manual action (which one comes first) might also be an interpretation.

    This is how things go when people ask for help with the step without explaining their goal: http://www.catb.org/~esr/faqs/smart-questions.html#goal
    Well i guess we have a different interpretation of disable. Since 0 will not disable that timer but make it faster so i opted for the -1 which of course would be nice if only yast2 bootloader can do it. Eternity is just a figure of speech for mortals but if you have ascended into a higher plane of existence then you might be able to understand what eternity means .

    Quote Originally Posted by hcvv View Post
    That is a nice and extensive description and I have no doubt it works.

    But what about YasT > System > Bootloader and then click on Bootloader Options and there it is: Time out in Seconds. Change to 0 and off you go.

    After all YaST is the system management tool of openSUSE and one of the main reasons to prefer openSUSE above other distros. Thus why not use it? It is so obvious.
    Speaking of extensive i would like to add the diff trick too.

    Code:
    # diff /etc/default/grub /etc/default/grub.old
    11c11
    < GRUB_TIMEOUT=-1
    ---
    > GRUB_TIMEOUT=8
    the first entry would be the would be the new edited grub file and the lower one is the old grub file which has 8.

  10. #10

    Default Re: Disabling countdown bar in GRUB2

    Quote Originally Posted by developerek View Post
    Thank you all for replies.... I did quick edit to /etc/default/grub and it works well for me. Thanks jetchisel
    You are welcome, also that ex code can be done better but i suck at ex so you can just learn it and when you have found a better solution you can just post it here. Probably you would think that "Silly jetchisel from the forum does not know how to use ex" thats why he asked me to improved it!

Page 1 of 2 12 LastLast

Posting Permissions

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