Announcement

Collapse
No announcement yet.

Grub default settings of hidden menu with timeout of 0 prevent system recovery

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Grub default settings of hidden menu with timeout of 0 prevent system recovery

    I recently installed Kubuntu 24.04 as the sole OS on a UEFI system. The default settings in /etc/default/grub resulted in the inability to bring up the grub menu in case of emergency (since the same config was in /boot/grub/grub.cfg):
    Code:
    GRUB_TIMEOUT_STYLE=hidden
    GRUB_TIMEOUT=0
    About a week after installing Kubuntu, a package install went bad and left me with an unbootable system. Due to these default grub settings I was unable to bring up the grub menu and access the recovery options therein.

    I can understand the desire in a single-boot environment to hide the grub menu, but why is the timeout also set to 0? Wouldn't it be easier for users to have the Kubuntu grub installation default be to hide the menu, but have a 2-3 second timeout, so users can access grub if needed (essentially one of the recommendations from the recommended post-install list)?

    #2
    Use the <esc> key during boot to bring up grub. It will be <shift> if your computer is very old and booting using MBR instead of EFI.
    Do this during the bios POST/logo splash, and the menu will appear. There is (probably?) no need for adding a timeout for the hidden menu, and save the 3-5 seconds for those who will complain about the useless added boot time.


    Originally posted by jklubuntu View Post
    (essentially one of the recommendations from the recommended post-install list)?
    Remember, this is one person's suggestions.
    Last edited by claydoh; Jul 13, 2024, 07:04 AM.

    Comment


      #3
      Originally posted by claydoh View Post
      Use the <esc> key during boot to bring up grub. It will be <shift> if your computer is very old and booting using MBR instead of EFI. Do this during the bios POST/logo splash, and the menu will appear
      At least for me this did not work - I tried esc, left shift, right shift, and a number of other options at a variety of times, and none brought up grub on the default setup with hidden menu and 0 timeout (though I could of course bring up the UEFI menu). But once I booted into a LiveUSB and edited my /boot/grub/grub.cfg to include a timeout, the keys functioned as expected and I was able to bring up the grub menu to carry out recovery operations.

      I certainly could have timed the key presses wrong, but I think my experience aligns with the grub documentation (bolding my addition)

      ‘GRUB_TIMEOUT’ Boot the default entry this many seconds after the menu is displayed, unless a key is pressed. The default is ‘5’. Set to ‘0’ to boot immediately without displaying the menu, or to ‘-1’ to wait indefinitely.

      If ‘GRUB_TIMEOUT_STYLE’ is set to ‘countdown’ or ‘hidden’, the timeout is instead counted before the menu is displayed. ‘GRUB_TIMEOUT_STYLE’ If this option is unset or set to ‘menu’, then GRUB will display the menu and then wait for the timeout set by ‘GRUB_TIMEOUT’ to expire before booting the default entry. Pressing a key interrupts the timeout.

      If this option is set to ‘countdown’ or ‘hidden’, then, before displaying the menu, GRUB will wait for the timeout set by ‘GRUB_TIMEOUT’ to expire. If ESC or F4 are pressed, or SHIFT is held down during that time, it will display the menu and wait for input. If a hotkey associated with a menu entry is pressed, it will boot the associated menu entry immediately. If the timeout expires before either of these happens, it will boot the default entry. In the ‘countdown’ case, it will show a one-line indication of the remaining time.​
      So, if I am reading this right, even with a hidden menu grub will listen for ESC/F4/SHIFT, but only until the timeout expires; since the timeout was set to 0, grub booted immediately (without a timeout countdown) and thus never listened for the hotkey. Maybe?

      Comment


        #4
        What is the make and model of your PC?
        Windows no longer obstructs my view.
        Using Kubuntu Linux since March 23, 2007.
        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

        Comment


          #5
          Originally posted by Snowhog View Post
          What is the make and model of your PC?
          HP ProDesk 600 G1.

          Of possible relevance is that ESC is the key that pulls up the UEFI boot/settings menu for the machine during boot.

          Comment


            #6
            Originally posted by claydoh View Post
            ...if your computer is very old and booting using MBR instead of EFI...
            Splitting hairs here, but in the interest of keeping things technically correct to prevent confusion for newer users:

            Non-UEFI booting is usually called "Legacy" or "BIOS" booting, not "MBR". MBR - Master Boot Record - refers to the partitioning scheme used on a storage device. The alternative the MBR is GPT - GUID Partition Table.

            While UEFI booting requires GPT partitioning, BIOS booting via GRUB can boot from either MBR or GPT partitioned devices.

            Whether to use ESC or Shift to un-hide the GRUB boot menu is solely dependent on the boot method - UEFI or BIOS - not the partition scheme.
            Last edited by oshunluvr; Jul 13, 2024, 02:21 PM.

            Please Read Me

            Comment


              #7
              Originally posted by jklubuntu View Post

              HP ProDesk 600 G1.

              Of possible relevance is that ESC is the key that pulls up the UEFI boot/settings menu for the machine during boot.
              I would guess that's why the ESC key didn't bring up the GRUB menu.

              My advise would be to set the GRUB timeout to 2 or 3 seconds. That way if you need the GRUB menu, it will be there. If you don't, simply pressing the Enter key will immediately boot the default menu entry or allow the timer to expire. If you do need to use the GRUB menu, pressing the down arrow key will stop the timer and wait for you to select a menu entry.

              Please Read Me

              Comment


                #8
                Originally posted by oshunluvr View Post
                My advise would be to set the GRUB timeout to 2 or 3 seconds. That way if you need the GRUB menu, it will be there.
                I have indeed already done this ... after I needed it.

                My thought here is that I am likely not alone in having a UEFI computer that captures ESC for another purpose at boot (or otherwise fails to allow access to grub with the Kubuntu default settings). Thus it would seem to be more user friendly / reliable to have the default Kubuntu grub (single-boot) configuration have even a 1- or 2-second hidden menu timeout set, as that would allow users with this computer configuration to boot into grub's rescue if needed (without having to figure this all out in advance). And then if someone was obsessed with boot speed and knew what they were doing, they could drop this to 0 themselves (and face the consequences of their actions).

                Comment


                  #9
                  Originally posted by jklubuntu View Post

                  I have indeed already done this ... after I needed it.

                  My thought here is that I am likely not alone in having a UEFI computer that captures ESC for another purpose at boot (or otherwise fails to allow access to grub with the Kubuntu default settings). Thus it would seem to be more user friendly / reliable to have the default Kubuntu grub (single-boot) configuration have even a 1- or 2-second hidden menu timeout set, as that would allow users with this computer configuration to boot into grub's rescue if needed (without having to figure this all out in advance). And then if someone was obsessed with boot speed and knew what they were doing, they could drop this to 0 themselves (and face the consequences of their actions).
                  Agreed, except the number of people that complain about seeing text on their screens is staggering.

                  My thought would be to set the default to the safest option which is having the menu enabled. The user can always change it to hidden if they choose.

                  Please Read Me

                  Comment


                    #10
                    Originally posted by jklubuntu View Post

                    At least for me this did not work - I tried esc, left shift, right shift, and a number of other options at a variety of times, and none brought up grub on the default setup with hidden menu and 0 timeout (though I could of course bring up the UEFI menu). But once I booted into a LiveUSB and edited my /boot/grub/grub.cfg to include a timeout, the keys functioned as expected and I was able to bring up the grub menu to carry out recovery operations.

                    I certainly could have timed the key presses wrong, but I think my experience aligns with the grub documentation (bolding my addition)



                    So, if I am reading this right, even with a hidden menu grub will listen for ESC/F4/SHIFT, but only until the timeout expires; since the timeout was set to 0, grub booted immediately (without a timeout countdown) and thus never listened for the hotkey. Maybe?
                    Tapping esc during the brand logo screen, where you'd hit a key to enter bios setup or boot order options. The grub timeouts are of course for grub itself, after this stage.

                    On my PC, I tap esc when I see the HP logo. Similar on my laptop. Once the monitor goes dark, it's too late. On some machines I've had, the window to tap it was sort of narrow, especially if esc is used by the computer for boot/bios menus.

                    I keep forgetting if holding the key does this more reliably. I'll need to check.

                    Checking my HP, using F4 as noted in grub docs does work. I held it when rebooting. Tapping it too early at the logo splash doesn't do anything.

                    I do admit this makes it confusing.
                    Last edited by claydoh; Jul 13, 2024, 10:14 PM.

                    Comment


                      #11
                      Originally posted by jklubuntu View Post

                      HP ProDesk 600 G1.

                      Of possible relevance is that ESC is the key that pulls up the UEFI boot/settings menu for the machine during boot.
                      Yes, my EliteDesk 800 Mini G3 has that, but esc after a vey short moment in the logo splash makes grub open as I expect. The normal bios hotkeys are f8,9, and 10

                      Comment


                        #12
                        Originally posted by oshunluvr View Post

                        Agreed, except the number of people that complain about seeing text on their screens is staggering.

                        My thought would be to set the default to the safest option which is having the menu enabled. The user can always change it to hidden if they choose.
                        Ubuntu used to show the menu even in single boot systems, up till 20.04, maybe earlier.

                        I'd probably be one of those whingers, though not about the text.

                        My Fedora laptop and it's 5+ second blank spot for grub hidden timeout with a black screen is annoying. Not as annoying as the as the spurious and meaningless warnings and errors we sometimes see during boot on some systems that someone forgot to set to be hidden, or something.
                        Last edited by claydoh; Jul 14, 2024, 08:31 PM. Reason: Not a spelling error :)

                        Comment


                          #13
                          Originally posted by claydoh View Post
                          Tapping esc during the brand logo screen, where you'd hit a key to enter bios setup or boot order options. The grub timeouts are of course for grub itself, after this stage.

                          On my PC, I tap esc when I see the HP logo. Similar on my laptop. Once the monitor goes dark, it's too late. On some machines I've had, the window to tap it was sort of narrow, especially if esc is used by the computer for boot/bios menus.

                          I keep forgetting if holding the key does this more reliably. I'll need to check.

                          Checking my HP, using F4 as noted in grub docs does work. I held it when rebooting. Tapping it too early at the logo splash doesn't do anything.
                          Thanks for all this. I'll do some testing on my box here and figure out how it works when there is 0 timeout and no menu. More later!

                          And I definitely agree that a 5-second blank screen where the computer does nothing but wait for a hidden timeout counter to run down seems a bit suboptimal, too.

                          Comment


                            #14
                            I have played around and found that, as far as I can tell, there is no time window wherein the ESC key brings up the grub menu if grub is set to a timeout of 0 with the menu hidden on this machine. This is because the HP splash screen continually displays "press ESC to show boot menu" all the way until the screen goes to black, so pressing ESC anytime in that time window just brings up the boot menu, and once that splash screen goes away, it is too late.

                            However, pressing F4 (at least twice) while the HP splash screen was displayed reliably worked to bring up the grub menu even with a timeout of 0 and hidden grub menu. The only odd thing was that I had to press it at least twice - after one press it changed the splash screen, but didn't load grub; hitting it again after the splash-screen change ended up loading grub.

                            I also played around with the grub menu / countdown / hidden options, and must say I love the idea of the countdown option, but it needs a bit more text than just a ticking-down number (e.g., "Press ESC to load the boot menu. Otherwise boot will continue in ..."). But that's not Kubuntu's issue and it doesn't look like there is an easy way to change it, even in the grub theme files.

                            I haven't seen F4 mentioned much regarding loading grub in this case (though it is in the official grub docs). Seems like it could be nice to have a little entry in the Kubuntu manual explaining how to get to the grub boot menu

                            Comment


                              #15
                              Originally posted by jklubuntu View Post
                              Seems like it could be nice to have a little entry in the Kubuntu manual
                              Any linux distro's docs, I think, may be lacking. I don't even see it mentioned on some Arch wiki pages.

                              I do seem to have to hold my f4 key down on my Elitedesk mini.

                              On my laptop - which is an HP Chromebook, so it is running a custom coreboot firmware - it is a bit different. This has a mostly permanent prompt for using the <esc> key to enter its firmware settings, but it disappears for a moment before moving on, so I can hit esc well enough for get to grub. I haven't tested if f4 works, because being a Chromebook, it doesn't have F-keys, and I don't think that <search>+<fullscreen> works there. ----nope.

                              Comment

                              Working...
                              X