How to get to the GRUB menu at boot-time using serial console?












1















It is always a struggle to show the grub menu, and a lot of answered questions on that.
The answer seems to be holding shift, but that doesn't work on serial console (actually serial over lan)



I have tried spamming space and escape to no avail.



This is a server which takes quite a long time to pass bios, and it makes it even more difficult and time consuming.



Is there a good solution to enter grub reliably?



Obviously editing /etc/default/grub would help, but now it is too late.










share|improve this question























  • what do you mean it's too late? you can't boot the system at all?

    – Zanna
    Jun 13 '17 at 11:42











  • Due to some messed up grub parameters the disk controller is no longer detected, so i can't boot. It drops to the initrd prompt, but there isn't much I can do to edit grub without access to the disk.

    – feitingen
    Jun 13 '17 at 12:22













  • Sorry if this is a dumb question, but do you not have physical access? If you do, you can edit /etc/default/grub using a live session... otherwise, I have no idea

    – Zanna
    Jun 13 '17 at 12:45











  • I gave up and had to do just that. Physically boot with a live USB and edit /boot/grub/grub.cfg to get into the OS and i was able to edit /etc/default/grub after that.

    – feitingen
    Jun 15 '17 at 9:31











  • Maybe you could post an answer? Or should we close the question as not reproducible?

    – Zanna
    Jun 15 '17 at 10:27
















1















It is always a struggle to show the grub menu, and a lot of answered questions on that.
The answer seems to be holding shift, but that doesn't work on serial console (actually serial over lan)



I have tried spamming space and escape to no avail.



This is a server which takes quite a long time to pass bios, and it makes it even more difficult and time consuming.



Is there a good solution to enter grub reliably?



Obviously editing /etc/default/grub would help, but now it is too late.










share|improve this question























  • what do you mean it's too late? you can't boot the system at all?

    – Zanna
    Jun 13 '17 at 11:42











  • Due to some messed up grub parameters the disk controller is no longer detected, so i can't boot. It drops to the initrd prompt, but there isn't much I can do to edit grub without access to the disk.

    – feitingen
    Jun 13 '17 at 12:22













  • Sorry if this is a dumb question, but do you not have physical access? If you do, you can edit /etc/default/grub using a live session... otherwise, I have no idea

    – Zanna
    Jun 13 '17 at 12:45











  • I gave up and had to do just that. Physically boot with a live USB and edit /boot/grub/grub.cfg to get into the OS and i was able to edit /etc/default/grub after that.

    – feitingen
    Jun 15 '17 at 9:31











  • Maybe you could post an answer? Or should we close the question as not reproducible?

    – Zanna
    Jun 15 '17 at 10:27














1












1








1


2






It is always a struggle to show the grub menu, and a lot of answered questions on that.
The answer seems to be holding shift, but that doesn't work on serial console (actually serial over lan)



I have tried spamming space and escape to no avail.



This is a server which takes quite a long time to pass bios, and it makes it even more difficult and time consuming.



Is there a good solution to enter grub reliably?



Obviously editing /etc/default/grub would help, but now it is too late.










share|improve this question














It is always a struggle to show the grub menu, and a lot of answered questions on that.
The answer seems to be holding shift, but that doesn't work on serial console (actually serial over lan)



I have tried spamming space and escape to no avail.



This is a server which takes quite a long time to pass bios, and it makes it even more difficult and time consuming.



Is there a good solution to enter grub reliably?



Obviously editing /etc/default/grub would help, but now it is too late.







boot 16.04 grub2 console






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jun 13 '17 at 11:24









feitingenfeitingen

5115




5115













  • what do you mean it's too late? you can't boot the system at all?

    – Zanna
    Jun 13 '17 at 11:42











  • Due to some messed up grub parameters the disk controller is no longer detected, so i can't boot. It drops to the initrd prompt, but there isn't much I can do to edit grub without access to the disk.

    – feitingen
    Jun 13 '17 at 12:22













  • Sorry if this is a dumb question, but do you not have physical access? If you do, you can edit /etc/default/grub using a live session... otherwise, I have no idea

    – Zanna
    Jun 13 '17 at 12:45











  • I gave up and had to do just that. Physically boot with a live USB and edit /boot/grub/grub.cfg to get into the OS and i was able to edit /etc/default/grub after that.

    – feitingen
    Jun 15 '17 at 9:31











  • Maybe you could post an answer? Or should we close the question as not reproducible?

    – Zanna
    Jun 15 '17 at 10:27



















  • what do you mean it's too late? you can't boot the system at all?

    – Zanna
    Jun 13 '17 at 11:42











  • Due to some messed up grub parameters the disk controller is no longer detected, so i can't boot. It drops to the initrd prompt, but there isn't much I can do to edit grub without access to the disk.

    – feitingen
    Jun 13 '17 at 12:22













  • Sorry if this is a dumb question, but do you not have physical access? If you do, you can edit /etc/default/grub using a live session... otherwise, I have no idea

    – Zanna
    Jun 13 '17 at 12:45











  • I gave up and had to do just that. Physically boot with a live USB and edit /boot/grub/grub.cfg to get into the OS and i was able to edit /etc/default/grub after that.

    – feitingen
    Jun 15 '17 at 9:31











  • Maybe you could post an answer? Or should we close the question as not reproducible?

    – Zanna
    Jun 15 '17 at 10:27

















what do you mean it's too late? you can't boot the system at all?

– Zanna
Jun 13 '17 at 11:42





what do you mean it's too late? you can't boot the system at all?

– Zanna
Jun 13 '17 at 11:42













Due to some messed up grub parameters the disk controller is no longer detected, so i can't boot. It drops to the initrd prompt, but there isn't much I can do to edit grub without access to the disk.

– feitingen
Jun 13 '17 at 12:22







Due to some messed up grub parameters the disk controller is no longer detected, so i can't boot. It drops to the initrd prompt, but there isn't much I can do to edit grub without access to the disk.

– feitingen
Jun 13 '17 at 12:22















Sorry if this is a dumb question, but do you not have physical access? If you do, you can edit /etc/default/grub using a live session... otherwise, I have no idea

– Zanna
Jun 13 '17 at 12:45





Sorry if this is a dumb question, but do you not have physical access? If you do, you can edit /etc/default/grub using a live session... otherwise, I have no idea

– Zanna
Jun 13 '17 at 12:45













I gave up and had to do just that. Physically boot with a live USB and edit /boot/grub/grub.cfg to get into the OS and i was able to edit /etc/default/grub after that.

– feitingen
Jun 15 '17 at 9:31





I gave up and had to do just that. Physically boot with a live USB and edit /boot/grub/grub.cfg to get into the OS and i was able to edit /etc/default/grub after that.

– feitingen
Jun 15 '17 at 9:31













Maybe you could post an answer? Or should we close the question as not reproducible?

– Zanna
Jun 15 '17 at 10:27





Maybe you could post an answer? Or should we close the question as not reproducible?

– Zanna
Jun 15 '17 at 10:27










2 Answers
2






active

oldest

votes


















1














Not a perfect solution, but editing the configuration using a live USB fixed the problem.



To avoid this problem in the future, the grub configuration is fixed to display the boot menu.



The boot time for servers are so long anyways, so adding 10 seconds of grub menu is worth it when things are not working.



Here is the fixed /etc/default/grub config:



GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

GRUB_CMDLINE_LINUX_DEFAULT="splash quiet"
# Kernel console on both serial and kvm/local console
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8 rootdelay=60"
# Show grub menu on both serial and kvm/local console
GRUB_TERMINAL="console serial"
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"





share|improve this answer































    0














    Ubuntu 18.04 desktop minimal change



    Here is the minimal change to /etc/default/grub I needed to do on Ubuntu 18.04 desktop image to get things working nicely:



    # Show the menu by default. Otherwise, you have to press ESC to see GRUB:
    # https://askubuntu.com/questions/16042/how-to-get-to-the-grub-menu-at-boot-time/1091821#1091821
    -GRUB_TIMEOUT_STYLE=hidden
    +#GRUB_TIMEOUT_STYLE=hidden

    # Optional kernel options that you very likely want. Don't affect GRUB itself.
    # Remove quiet to show the boot logs on terminal. Otherwise, you see just init onwards.
    # Add console=ttyS0, or else kernel does not output anything to terminal.
    -GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
    -GRUB_CMDLINE_LINUX=""
    +GRUB_CMDLINE_LINUX_DEFAULT=""
    +GRUB_CMDLINE_LINUX="console=ttyS0"

    # Show grub on both serial and on display.
    -#GRUB_TERMINAL=console
    +GRUB_TERMINAL="console serial"


    and then:



    sudo update-grub


    Tested with this QEMU setup: https://askubuntu.com/revisions/1046792/24



    First I logged in once with the GUI, edited those configs, and then re-booted the VM.



    Ubuntu 18.04 cloud image



    Keep in mind that this image also has a file:



    /etc/default/grub.d/50-cloudimg-settings.cfg


    which overrides settings from /etc/default/grub.



    Besides the desktop settings, you also need to set:



    GRUB_TIMEOUT=10


    since the default is 0 and gives you no time to access the GRUB menu.



    Tested with this setup: Is there any prebuilt QEMU Ubuntu image(32bit) online?






    share|improve this answer

























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f924913%2fhow-to-get-to-the-grub-menu-at-boot-time-using-serial-console%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      Not a perfect solution, but editing the configuration using a live USB fixed the problem.



      To avoid this problem in the future, the grub configuration is fixed to display the boot menu.



      The boot time for servers are so long anyways, so adding 10 seconds of grub menu is worth it when things are not working.



      Here is the fixed /etc/default/grub config:



      GRUB_DEFAULT=0
      GRUB_HIDDEN_TIMEOUT_QUIET=false
      GRUB_TIMEOUT=10
      GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

      GRUB_CMDLINE_LINUX_DEFAULT="splash quiet"
      # Kernel console on both serial and kvm/local console
      GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8 rootdelay=60"
      # Show grub menu on both serial and kvm/local console
      GRUB_TERMINAL="console serial"
      GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"





      share|improve this answer




























        1














        Not a perfect solution, but editing the configuration using a live USB fixed the problem.



        To avoid this problem in the future, the grub configuration is fixed to display the boot menu.



        The boot time for servers are so long anyways, so adding 10 seconds of grub menu is worth it when things are not working.



        Here is the fixed /etc/default/grub config:



        GRUB_DEFAULT=0
        GRUB_HIDDEN_TIMEOUT_QUIET=false
        GRUB_TIMEOUT=10
        GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

        GRUB_CMDLINE_LINUX_DEFAULT="splash quiet"
        # Kernel console on both serial and kvm/local console
        GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8 rootdelay=60"
        # Show grub menu on both serial and kvm/local console
        GRUB_TERMINAL="console serial"
        GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"





        share|improve this answer


























          1












          1








          1







          Not a perfect solution, but editing the configuration using a live USB fixed the problem.



          To avoid this problem in the future, the grub configuration is fixed to display the boot menu.



          The boot time for servers are so long anyways, so adding 10 seconds of grub menu is worth it when things are not working.



          Here is the fixed /etc/default/grub config:



          GRUB_DEFAULT=0
          GRUB_HIDDEN_TIMEOUT_QUIET=false
          GRUB_TIMEOUT=10
          GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

          GRUB_CMDLINE_LINUX_DEFAULT="splash quiet"
          # Kernel console on both serial and kvm/local console
          GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8 rootdelay=60"
          # Show grub menu on both serial and kvm/local console
          GRUB_TERMINAL="console serial"
          GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"





          share|improve this answer













          Not a perfect solution, but editing the configuration using a live USB fixed the problem.



          To avoid this problem in the future, the grub configuration is fixed to display the boot menu.



          The boot time for servers are so long anyways, so adding 10 seconds of grub menu is worth it when things are not working.



          Here is the fixed /etc/default/grub config:



          GRUB_DEFAULT=0
          GRUB_HIDDEN_TIMEOUT_QUIET=false
          GRUB_TIMEOUT=10
          GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

          GRUB_CMDLINE_LINUX_DEFAULT="splash quiet"
          # Kernel console on both serial and kvm/local console
          GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8 rootdelay=60"
          # Show grub menu on both serial and kvm/local console
          GRUB_TERMINAL="console serial"
          GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jun 20 '17 at 8:51









          feitingenfeitingen

          5115




          5115

























              0














              Ubuntu 18.04 desktop minimal change



              Here is the minimal change to /etc/default/grub I needed to do on Ubuntu 18.04 desktop image to get things working nicely:



              # Show the menu by default. Otherwise, you have to press ESC to see GRUB:
              # https://askubuntu.com/questions/16042/how-to-get-to-the-grub-menu-at-boot-time/1091821#1091821
              -GRUB_TIMEOUT_STYLE=hidden
              +#GRUB_TIMEOUT_STYLE=hidden

              # Optional kernel options that you very likely want. Don't affect GRUB itself.
              # Remove quiet to show the boot logs on terminal. Otherwise, you see just init onwards.
              # Add console=ttyS0, or else kernel does not output anything to terminal.
              -GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
              -GRUB_CMDLINE_LINUX=""
              +GRUB_CMDLINE_LINUX_DEFAULT=""
              +GRUB_CMDLINE_LINUX="console=ttyS0"

              # Show grub on both serial and on display.
              -#GRUB_TERMINAL=console
              +GRUB_TERMINAL="console serial"


              and then:



              sudo update-grub


              Tested with this QEMU setup: https://askubuntu.com/revisions/1046792/24



              First I logged in once with the GUI, edited those configs, and then re-booted the VM.



              Ubuntu 18.04 cloud image



              Keep in mind that this image also has a file:



              /etc/default/grub.d/50-cloudimg-settings.cfg


              which overrides settings from /etc/default/grub.



              Besides the desktop settings, you also need to set:



              GRUB_TIMEOUT=10


              since the default is 0 and gives you no time to access the GRUB menu.



              Tested with this setup: Is there any prebuilt QEMU Ubuntu image(32bit) online?






              share|improve this answer






























                0














                Ubuntu 18.04 desktop minimal change



                Here is the minimal change to /etc/default/grub I needed to do on Ubuntu 18.04 desktop image to get things working nicely:



                # Show the menu by default. Otherwise, you have to press ESC to see GRUB:
                # https://askubuntu.com/questions/16042/how-to-get-to-the-grub-menu-at-boot-time/1091821#1091821
                -GRUB_TIMEOUT_STYLE=hidden
                +#GRUB_TIMEOUT_STYLE=hidden

                # Optional kernel options that you very likely want. Don't affect GRUB itself.
                # Remove quiet to show the boot logs on terminal. Otherwise, you see just init onwards.
                # Add console=ttyS0, or else kernel does not output anything to terminal.
                -GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
                -GRUB_CMDLINE_LINUX=""
                +GRUB_CMDLINE_LINUX_DEFAULT=""
                +GRUB_CMDLINE_LINUX="console=ttyS0"

                # Show grub on both serial and on display.
                -#GRUB_TERMINAL=console
                +GRUB_TERMINAL="console serial"


                and then:



                sudo update-grub


                Tested with this QEMU setup: https://askubuntu.com/revisions/1046792/24



                First I logged in once with the GUI, edited those configs, and then re-booted the VM.



                Ubuntu 18.04 cloud image



                Keep in mind that this image also has a file:



                /etc/default/grub.d/50-cloudimg-settings.cfg


                which overrides settings from /etc/default/grub.



                Besides the desktop settings, you also need to set:



                GRUB_TIMEOUT=10


                since the default is 0 and gives you no time to access the GRUB menu.



                Tested with this setup: Is there any prebuilt QEMU Ubuntu image(32bit) online?






                share|improve this answer




























                  0












                  0








                  0







                  Ubuntu 18.04 desktop minimal change



                  Here is the minimal change to /etc/default/grub I needed to do on Ubuntu 18.04 desktop image to get things working nicely:



                  # Show the menu by default. Otherwise, you have to press ESC to see GRUB:
                  # https://askubuntu.com/questions/16042/how-to-get-to-the-grub-menu-at-boot-time/1091821#1091821
                  -GRUB_TIMEOUT_STYLE=hidden
                  +#GRUB_TIMEOUT_STYLE=hidden

                  # Optional kernel options that you very likely want. Don't affect GRUB itself.
                  # Remove quiet to show the boot logs on terminal. Otherwise, you see just init onwards.
                  # Add console=ttyS0, or else kernel does not output anything to terminal.
                  -GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
                  -GRUB_CMDLINE_LINUX=""
                  +GRUB_CMDLINE_LINUX_DEFAULT=""
                  +GRUB_CMDLINE_LINUX="console=ttyS0"

                  # Show grub on both serial and on display.
                  -#GRUB_TERMINAL=console
                  +GRUB_TERMINAL="console serial"


                  and then:



                  sudo update-grub


                  Tested with this QEMU setup: https://askubuntu.com/revisions/1046792/24



                  First I logged in once with the GUI, edited those configs, and then re-booted the VM.



                  Ubuntu 18.04 cloud image



                  Keep in mind that this image also has a file:



                  /etc/default/grub.d/50-cloudimg-settings.cfg


                  which overrides settings from /etc/default/grub.



                  Besides the desktop settings, you also need to set:



                  GRUB_TIMEOUT=10


                  since the default is 0 and gives you no time to access the GRUB menu.



                  Tested with this setup: Is there any prebuilt QEMU Ubuntu image(32bit) online?






                  share|improve this answer















                  Ubuntu 18.04 desktop minimal change



                  Here is the minimal change to /etc/default/grub I needed to do on Ubuntu 18.04 desktop image to get things working nicely:



                  # Show the menu by default. Otherwise, you have to press ESC to see GRUB:
                  # https://askubuntu.com/questions/16042/how-to-get-to-the-grub-menu-at-boot-time/1091821#1091821
                  -GRUB_TIMEOUT_STYLE=hidden
                  +#GRUB_TIMEOUT_STYLE=hidden

                  # Optional kernel options that you very likely want. Don't affect GRUB itself.
                  # Remove quiet to show the boot logs on terminal. Otherwise, you see just init onwards.
                  # Add console=ttyS0, or else kernel does not output anything to terminal.
                  -GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
                  -GRUB_CMDLINE_LINUX=""
                  +GRUB_CMDLINE_LINUX_DEFAULT=""
                  +GRUB_CMDLINE_LINUX="console=ttyS0"

                  # Show grub on both serial and on display.
                  -#GRUB_TERMINAL=console
                  +GRUB_TERMINAL="console serial"


                  and then:



                  sudo update-grub


                  Tested with this QEMU setup: https://askubuntu.com/revisions/1046792/24



                  First I logged in once with the GUI, edited those configs, and then re-booted the VM.



                  Ubuntu 18.04 cloud image



                  Keep in mind that this image also has a file:



                  /etc/default/grub.d/50-cloudimg-settings.cfg


                  which overrides settings from /etc/default/grub.



                  Besides the desktop settings, you also need to set:



                  GRUB_TIMEOUT=10


                  since the default is 0 and gives you no time to access the GRUB menu.



                  Tested with this setup: Is there any prebuilt QEMU Ubuntu image(32bit) online?







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jan 16 at 12:13

























                  answered Jan 16 at 9:53









                  Ciro Santilli 新疆改造中心 六四事件 法轮功Ciro Santilli 新疆改造中心 六四事件 法轮功

                  9,53944348




                  9,53944348






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f924913%2fhow-to-get-to-the-grub-menu-at-boot-time-using-serial-console%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      How to make a Squid Proxy server?

                      Is this a new Fibonacci Identity?

                      19世紀