Centos 7 and Windows 10 Dual Boot Grub Not Saving Last Choice












2














I have a dual boot system with CentOS 7 and Win10. My install was totally vanilla (CentOS then Win10) and went fine. Everything is great except that grub does not appear to save my "last" choice from the boot load menu.



I dug through all the grub configuration files (e.g. /boot/efi/EFI/centos/grub.cfg) and all the code seems there for recording the last choice.



My /etc/default/grub shows:



GRUB_TIMEOUT=5
...
GRUB_DEFAULT=saved
...
GRUB_SAVEDEFAULT=true


Is there anything obvious I am missing or need to do to enable this?



My /etc/efi/EFI/centos/grubenv never apperas to record the latest selection.
It always has:



saved_entry=CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)
##########[...snip...padding to 1k]


I can't see this file from a Windows boot, but I did test via the "rescue Centos entry".



I manually set the value in grubenv to Windows Boot Manager (on /dev/sda2) (the Windows entry) and this works out okay. However, booting back into CentOS fails to change it.



It just seems I am missing something to enable this "save the last choice" behavior. Any ideas?










share|improve this question




















  • 1




    have you ran sudo update-grub after editing these files?
    – Luca D'Amico
    Apr 21 '16 at 18:47










  • I never modified anything. This was all created by the install process? (Or part of the installed image?)
    – Tim
    Apr 22 '16 at 8:50
















2














I have a dual boot system with CentOS 7 and Win10. My install was totally vanilla (CentOS then Win10) and went fine. Everything is great except that grub does not appear to save my "last" choice from the boot load menu.



I dug through all the grub configuration files (e.g. /boot/efi/EFI/centos/grub.cfg) and all the code seems there for recording the last choice.



My /etc/default/grub shows:



GRUB_TIMEOUT=5
...
GRUB_DEFAULT=saved
...
GRUB_SAVEDEFAULT=true


Is there anything obvious I am missing or need to do to enable this?



My /etc/efi/EFI/centos/grubenv never apperas to record the latest selection.
It always has:



saved_entry=CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)
##########[...snip...padding to 1k]


I can't see this file from a Windows boot, but I did test via the "rescue Centos entry".



I manually set the value in grubenv to Windows Boot Manager (on /dev/sda2) (the Windows entry) and this works out okay. However, booting back into CentOS fails to change it.



It just seems I am missing something to enable this "save the last choice" behavior. Any ideas?










share|improve this question




















  • 1




    have you ran sudo update-grub after editing these files?
    – Luca D'Amico
    Apr 21 '16 at 18:47










  • I never modified anything. This was all created by the install process? (Or part of the installed image?)
    – Tim
    Apr 22 '16 at 8:50














2












2








2







I have a dual boot system with CentOS 7 and Win10. My install was totally vanilla (CentOS then Win10) and went fine. Everything is great except that grub does not appear to save my "last" choice from the boot load menu.



I dug through all the grub configuration files (e.g. /boot/efi/EFI/centos/grub.cfg) and all the code seems there for recording the last choice.



My /etc/default/grub shows:



GRUB_TIMEOUT=5
...
GRUB_DEFAULT=saved
...
GRUB_SAVEDEFAULT=true


Is there anything obvious I am missing or need to do to enable this?



My /etc/efi/EFI/centos/grubenv never apperas to record the latest selection.
It always has:



saved_entry=CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)
##########[...snip...padding to 1k]


I can't see this file from a Windows boot, but I did test via the "rescue Centos entry".



I manually set the value in grubenv to Windows Boot Manager (on /dev/sda2) (the Windows entry) and this works out okay. However, booting back into CentOS fails to change it.



It just seems I am missing something to enable this "save the last choice" behavior. Any ideas?










share|improve this question















I have a dual boot system with CentOS 7 and Win10. My install was totally vanilla (CentOS then Win10) and went fine. Everything is great except that grub does not appear to save my "last" choice from the boot load menu.



I dug through all the grub configuration files (e.g. /boot/efi/EFI/centos/grub.cfg) and all the code seems there for recording the last choice.



My /etc/default/grub shows:



GRUB_TIMEOUT=5
...
GRUB_DEFAULT=saved
...
GRUB_SAVEDEFAULT=true


Is there anything obvious I am missing or need to do to enable this?



My /etc/efi/EFI/centos/grubenv never apperas to record the latest selection.
It always has:



saved_entry=CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)
##########[...snip...padding to 1k]


I can't see this file from a Windows boot, but I did test via the "rescue Centos entry".



I manually set the value in grubenv to Windows Boot Manager (on /dev/sda2) (the Windows entry) and this works out okay. However, booting back into CentOS fails to change it.



It just seems I am missing something to enable this "save the last choice" behavior. Any ideas?







centos windows grub2






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 26 '17 at 14:06









njsg

8,61411725




8,61411725










asked Apr 21 '16 at 18:34









Tim

1235




1235








  • 1




    have you ran sudo update-grub after editing these files?
    – Luca D'Amico
    Apr 21 '16 at 18:47










  • I never modified anything. This was all created by the install process? (Or part of the installed image?)
    – Tim
    Apr 22 '16 at 8:50














  • 1




    have you ran sudo update-grub after editing these files?
    – Luca D'Amico
    Apr 21 '16 at 18:47










  • I never modified anything. This was all created by the install process? (Or part of the installed image?)
    – Tim
    Apr 22 '16 at 8:50








1




1




have you ran sudo update-grub after editing these files?
– Luca D'Amico
Apr 21 '16 at 18:47




have you ran sudo update-grub after editing these files?
– Luca D'Amico
Apr 21 '16 at 18:47












I never modified anything. This was all created by the install process? (Or part of the installed image?)
– Tim
Apr 22 '16 at 8:50




I never modified anything. This was all created by the install process? (Or part of the installed image?)
– Tim
Apr 22 '16 at 8:50










4 Answers
4






active

oldest

votes


















0














Alternatively, you can simply specify the number for GRUB_DEFAULT for the OS you want to set as default. Go the grub configuration file located at /boot/grub2/grub.cfg and search for the keyword menuentry. This will have the OS listing that will appear on the boot screen.


Assuming CentOS entry is first and then Windows entry, if you want the default OS to boot as CentOS, simply edit the value for GRUB_DEFAULT in /etc/default/grub as follows



GRUB_DEFAULT=0


If you want Windows 10 to be booted as default, then set



GRUB_DEFAULT=1


Save and reboot. You should be getting your selected OS as default.






share|improve this answer





























    0














    The /etc/default/grub file is used to generate the final grub.cfg file that actually governs the behavior of grub. After editing the grub file you have to run



    sudo update-grub


    to generate a new /boot/grub/grub.cfg (usual location).






    share|improve this answer





























      0














      Realizing this question is almost a year old, I can confirm the following works:



      $ su
      Password:
      # vim /boot/grub/grub.conf


      Within the file, I have the following:



      default=saved
      timeout=5
      ...
      title CentOS (2.6.32-642.13.1.el6.x86_64)
      root ...
      ...
      savedefault
      initrd ...
      title CentOS (<old kernel>...)
      ...
      savedefault
      title Windows (10)
      ...
      savedefault


      I think you might be missing the savedefault keyword(?) in each boot entry - although it also looks like you might be on CentOS 7, and I'm on CentOS 6. IIRC, CentOS 6 uses GRUB (GRUB v1.97), while CentOS 7 uses GRUB2 (GRUB 2.01).



      I'm sure future users/searchers will appreciate any who can confirm/deny that this addresses their problem.






      share|improve this answer





























        0














        I can confirm that savedefault option is necessary in Centos 7.



        What I did was create my custom entries in /etc/grub.d/40_custom making sure that savedefault was present.



        And then updating the menu:



        grub2-mkconfig -o /boot/grub2/grub.cfg



        That's it!






        share|improve this answer























          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          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: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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%2funix.stackexchange.com%2fquestions%2f278177%2fcentos-7-and-windows-10-dual-boot-grub-not-saving-last-choice%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          4 Answers
          4






          active

          oldest

          votes








          4 Answers
          4






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Alternatively, you can simply specify the number for GRUB_DEFAULT for the OS you want to set as default. Go the grub configuration file located at /boot/grub2/grub.cfg and search for the keyword menuentry. This will have the OS listing that will appear on the boot screen.


          Assuming CentOS entry is first and then Windows entry, if you want the default OS to boot as CentOS, simply edit the value for GRUB_DEFAULT in /etc/default/grub as follows



          GRUB_DEFAULT=0


          If you want Windows 10 to be booted as default, then set



          GRUB_DEFAULT=1


          Save and reboot. You should be getting your selected OS as default.






          share|improve this answer


























            0














            Alternatively, you can simply specify the number for GRUB_DEFAULT for the OS you want to set as default. Go the grub configuration file located at /boot/grub2/grub.cfg and search for the keyword menuentry. This will have the OS listing that will appear on the boot screen.


            Assuming CentOS entry is first and then Windows entry, if you want the default OS to boot as CentOS, simply edit the value for GRUB_DEFAULT in /etc/default/grub as follows



            GRUB_DEFAULT=0


            If you want Windows 10 to be booted as default, then set



            GRUB_DEFAULT=1


            Save and reboot. You should be getting your selected OS as default.






            share|improve this answer
























              0












              0








              0






              Alternatively, you can simply specify the number for GRUB_DEFAULT for the OS you want to set as default. Go the grub configuration file located at /boot/grub2/grub.cfg and search for the keyword menuentry. This will have the OS listing that will appear on the boot screen.


              Assuming CentOS entry is first and then Windows entry, if you want the default OS to boot as CentOS, simply edit the value for GRUB_DEFAULT in /etc/default/grub as follows



              GRUB_DEFAULT=0


              If you want Windows 10 to be booted as default, then set



              GRUB_DEFAULT=1


              Save and reboot. You should be getting your selected OS as default.






              share|improve this answer












              Alternatively, you can simply specify the number for GRUB_DEFAULT for the OS you want to set as default. Go the grub configuration file located at /boot/grub2/grub.cfg and search for the keyword menuentry. This will have the OS listing that will appear on the boot screen.


              Assuming CentOS entry is first and then Windows entry, if you want the default OS to boot as CentOS, simply edit the value for GRUB_DEFAULT in /etc/default/grub as follows



              GRUB_DEFAULT=0


              If you want Windows 10 to be booted as default, then set



              GRUB_DEFAULT=1


              Save and reboot. You should be getting your selected OS as default.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Apr 23 '16 at 6:24









              1337ninja

              111




              111

























                  0














                  The /etc/default/grub file is used to generate the final grub.cfg file that actually governs the behavior of grub. After editing the grub file you have to run



                  sudo update-grub


                  to generate a new /boot/grub/grub.cfg (usual location).






                  share|improve this answer


























                    0














                    The /etc/default/grub file is used to generate the final grub.cfg file that actually governs the behavior of grub. After editing the grub file you have to run



                    sudo update-grub


                    to generate a new /boot/grub/grub.cfg (usual location).






                    share|improve this answer
























                      0












                      0








                      0






                      The /etc/default/grub file is used to generate the final grub.cfg file that actually governs the behavior of grub. After editing the grub file you have to run



                      sudo update-grub


                      to generate a new /boot/grub/grub.cfg (usual location).






                      share|improve this answer












                      The /etc/default/grub file is used to generate the final grub.cfg file that actually governs the behavior of grub. After editing the grub file you have to run



                      sudo update-grub


                      to generate a new /boot/grub/grub.cfg (usual location).







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered May 2 '16 at 0:03









                      Three Diag

                      23619




                      23619























                          0














                          Realizing this question is almost a year old, I can confirm the following works:



                          $ su
                          Password:
                          # vim /boot/grub/grub.conf


                          Within the file, I have the following:



                          default=saved
                          timeout=5
                          ...
                          title CentOS (2.6.32-642.13.1.el6.x86_64)
                          root ...
                          ...
                          savedefault
                          initrd ...
                          title CentOS (<old kernel>...)
                          ...
                          savedefault
                          title Windows (10)
                          ...
                          savedefault


                          I think you might be missing the savedefault keyword(?) in each boot entry - although it also looks like you might be on CentOS 7, and I'm on CentOS 6. IIRC, CentOS 6 uses GRUB (GRUB v1.97), while CentOS 7 uses GRUB2 (GRUB 2.01).



                          I'm sure future users/searchers will appreciate any who can confirm/deny that this addresses their problem.






                          share|improve this answer


























                            0














                            Realizing this question is almost a year old, I can confirm the following works:



                            $ su
                            Password:
                            # vim /boot/grub/grub.conf


                            Within the file, I have the following:



                            default=saved
                            timeout=5
                            ...
                            title CentOS (2.6.32-642.13.1.el6.x86_64)
                            root ...
                            ...
                            savedefault
                            initrd ...
                            title CentOS (<old kernel>...)
                            ...
                            savedefault
                            title Windows (10)
                            ...
                            savedefault


                            I think you might be missing the savedefault keyword(?) in each boot entry - although it also looks like you might be on CentOS 7, and I'm on CentOS 6. IIRC, CentOS 6 uses GRUB (GRUB v1.97), while CentOS 7 uses GRUB2 (GRUB 2.01).



                            I'm sure future users/searchers will appreciate any who can confirm/deny that this addresses their problem.






                            share|improve this answer
























                              0












                              0








                              0






                              Realizing this question is almost a year old, I can confirm the following works:



                              $ su
                              Password:
                              # vim /boot/grub/grub.conf


                              Within the file, I have the following:



                              default=saved
                              timeout=5
                              ...
                              title CentOS (2.6.32-642.13.1.el6.x86_64)
                              root ...
                              ...
                              savedefault
                              initrd ...
                              title CentOS (<old kernel>...)
                              ...
                              savedefault
                              title Windows (10)
                              ...
                              savedefault


                              I think you might be missing the savedefault keyword(?) in each boot entry - although it also looks like you might be on CentOS 7, and I'm on CentOS 6. IIRC, CentOS 6 uses GRUB (GRUB v1.97), while CentOS 7 uses GRUB2 (GRUB 2.01).



                              I'm sure future users/searchers will appreciate any who can confirm/deny that this addresses their problem.






                              share|improve this answer












                              Realizing this question is almost a year old, I can confirm the following works:



                              $ su
                              Password:
                              # vim /boot/grub/grub.conf


                              Within the file, I have the following:



                              default=saved
                              timeout=5
                              ...
                              title CentOS (2.6.32-642.13.1.el6.x86_64)
                              root ...
                              ...
                              savedefault
                              initrd ...
                              title CentOS (<old kernel>...)
                              ...
                              savedefault
                              title Windows (10)
                              ...
                              savedefault


                              I think you might be missing the savedefault keyword(?) in each boot entry - although it also looks like you might be on CentOS 7, and I'm on CentOS 6. IIRC, CentOS 6 uses GRUB (GRUB v1.97), while CentOS 7 uses GRUB2 (GRUB 2.01).



                              I'm sure future users/searchers will appreciate any who can confirm/deny that this addresses their problem.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Feb 1 '17 at 2:28









                              user3.1415927

                              53117




                              53117























                                  0














                                  I can confirm that savedefault option is necessary in Centos 7.



                                  What I did was create my custom entries in /etc/grub.d/40_custom making sure that savedefault was present.



                                  And then updating the menu:



                                  grub2-mkconfig -o /boot/grub2/grub.cfg



                                  That's it!






                                  share|improve this answer




























                                    0














                                    I can confirm that savedefault option is necessary in Centos 7.



                                    What I did was create my custom entries in /etc/grub.d/40_custom making sure that savedefault was present.



                                    And then updating the menu:



                                    grub2-mkconfig -o /boot/grub2/grub.cfg



                                    That's it!






                                    share|improve this answer


























                                      0












                                      0








                                      0






                                      I can confirm that savedefault option is necessary in Centos 7.



                                      What I did was create my custom entries in /etc/grub.d/40_custom making sure that savedefault was present.



                                      And then updating the menu:



                                      grub2-mkconfig -o /boot/grub2/grub.cfg



                                      That's it!






                                      share|improve this answer














                                      I can confirm that savedefault option is necessary in Centos 7.



                                      What I did was create my custom entries in /etc/grub.d/40_custom making sure that savedefault was present.



                                      And then updating the menu:



                                      grub2-mkconfig -o /boot/grub2/grub.cfg



                                      That's it!







                                      share|improve this answer














                                      share|improve this answer



                                      share|improve this answer








                                      edited Aug 26 '17 at 13:55









                                      B Layer

                                      4,0141525




                                      4,0141525










                                      answered Aug 26 '17 at 12:34









                                      jesus

                                      1




                                      1






























                                          draft saved

                                          draft discarded




















































                                          Thanks for contributing an answer to Unix & Linux Stack Exchange!


                                          • 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.





                                          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                          Please pay close attention to the following guidance:


                                          • 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%2funix.stackexchange.com%2fquestions%2f278177%2fcentos-7-and-windows-10-dual-boot-grub-not-saving-last-choice%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

                                          Morgemoulin

                                          Scott Moir

                                          Souastre