update-grub brings back manually removed menu entries












1















There are two menu entries that I want to remove from my GRUB boot menu, so I commented them out of the /boot/grub/grub.cfg file:



menuentry 'Windows Boot Manager (on /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-efi-FCD5-F73E' {
...
}
# menuentry 'Ubuntu 16.04.3 LTS (16.04) (on /dev/sdb1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-844ea196-bb78-4f18-b7fd-58be4c491e92' {
# ...
# }
# submenu 'Advanced options for Ubuntu 16.04.3 LTS (16.04) (on /dev/sdb1)' $menuentry_id_option 'osprober-gnulinux-advanced-844ea196-bb78-4f18-b7fd-58be4c491e92' {
# menuentry 'Ubuntu (on /dev/sdb1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.10.0-37-generic.efi.signed--844ea196-bb78-4f18-b7fd-58be4c491e92' {
# ...
# }
# ...
# }


I then run sudo update-grub as usual. However, doing so brings back the menu entries, which get uncommented from the grub.cfg file.



How can I get the menu entries to stay commented out after running update-grub so that they don't show up in the boot options? I realize that not running update-grub will keep out the menu entries, but I'd like to get rid of this unwanted behaviour from update-grub so that I don't have to manually comment out the menu entries each time I run this command.



Notes:




  • Both update-grub and update-grub2 bring back the unwanted menu entries.

  • The unwanted menu entries are duplicates. I already have menu entries for Ubuntu.










share|improve this question














bumped to the homepage by Community 3 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    1















    There are two menu entries that I want to remove from my GRUB boot menu, so I commented them out of the /boot/grub/grub.cfg file:



    menuentry 'Windows Boot Manager (on /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-efi-FCD5-F73E' {
    ...
    }
    # menuentry 'Ubuntu 16.04.3 LTS (16.04) (on /dev/sdb1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-844ea196-bb78-4f18-b7fd-58be4c491e92' {
    # ...
    # }
    # submenu 'Advanced options for Ubuntu 16.04.3 LTS (16.04) (on /dev/sdb1)' $menuentry_id_option 'osprober-gnulinux-advanced-844ea196-bb78-4f18-b7fd-58be4c491e92' {
    # menuentry 'Ubuntu (on /dev/sdb1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.10.0-37-generic.efi.signed--844ea196-bb78-4f18-b7fd-58be4c491e92' {
    # ...
    # }
    # ...
    # }


    I then run sudo update-grub as usual. However, doing so brings back the menu entries, which get uncommented from the grub.cfg file.



    How can I get the menu entries to stay commented out after running update-grub so that they don't show up in the boot options? I realize that not running update-grub will keep out the menu entries, but I'd like to get rid of this unwanted behaviour from update-grub so that I don't have to manually comment out the menu entries each time I run this command.



    Notes:




    • Both update-grub and update-grub2 bring back the unwanted menu entries.

    • The unwanted menu entries are duplicates. I already have menu entries for Ubuntu.










    share|improve this question














    bumped to the homepage by Community 3 hours ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      1












      1








      1








      There are two menu entries that I want to remove from my GRUB boot menu, so I commented them out of the /boot/grub/grub.cfg file:



      menuentry 'Windows Boot Manager (on /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-efi-FCD5-F73E' {
      ...
      }
      # menuentry 'Ubuntu 16.04.3 LTS (16.04) (on /dev/sdb1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-844ea196-bb78-4f18-b7fd-58be4c491e92' {
      # ...
      # }
      # submenu 'Advanced options for Ubuntu 16.04.3 LTS (16.04) (on /dev/sdb1)' $menuentry_id_option 'osprober-gnulinux-advanced-844ea196-bb78-4f18-b7fd-58be4c491e92' {
      # menuentry 'Ubuntu (on /dev/sdb1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.10.0-37-generic.efi.signed--844ea196-bb78-4f18-b7fd-58be4c491e92' {
      # ...
      # }
      # ...
      # }


      I then run sudo update-grub as usual. However, doing so brings back the menu entries, which get uncommented from the grub.cfg file.



      How can I get the menu entries to stay commented out after running update-grub so that they don't show up in the boot options? I realize that not running update-grub will keep out the menu entries, but I'd like to get rid of this unwanted behaviour from update-grub so that I don't have to manually comment out the menu entries each time I run this command.



      Notes:




      • Both update-grub and update-grub2 bring back the unwanted menu entries.

      • The unwanted menu entries are duplicates. I already have menu entries for Ubuntu.










      share|improve this question














      There are two menu entries that I want to remove from my GRUB boot menu, so I commented them out of the /boot/grub/grub.cfg file:



      menuentry 'Windows Boot Manager (on /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-efi-FCD5-F73E' {
      ...
      }
      # menuentry 'Ubuntu 16.04.3 LTS (16.04) (on /dev/sdb1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-844ea196-bb78-4f18-b7fd-58be4c491e92' {
      # ...
      # }
      # submenu 'Advanced options for Ubuntu 16.04.3 LTS (16.04) (on /dev/sdb1)' $menuentry_id_option 'osprober-gnulinux-advanced-844ea196-bb78-4f18-b7fd-58be4c491e92' {
      # menuentry 'Ubuntu (on /dev/sdb1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.10.0-37-generic.efi.signed--844ea196-bb78-4f18-b7fd-58be4c491e92' {
      # ...
      # }
      # ...
      # }


      I then run sudo update-grub as usual. However, doing so brings back the menu entries, which get uncommented from the grub.cfg file.



      How can I get the menu entries to stay commented out after running update-grub so that they don't show up in the boot options? I realize that not running update-grub will keep out the menu entries, but I'd like to get rid of this unwanted behaviour from update-grub so that I don't have to manually comment out the menu entries each time I run this command.



      Notes:




      • Both update-grub and update-grub2 bring back the unwanted menu entries.

      • The unwanted menu entries are duplicates. I already have menu entries for Ubuntu.







      grub2






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 3 '17 at 0:42









      GreatHamGreatHam

      1061




      1061





      bumped to the homepage by Community 3 hours ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 3 hours ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          3 Answers
          3






          active

          oldest

          votes


















          0














          /boot/grub/grub.cfg



          #



          DO NOT EDIT THIS FILE



          #



          It is automatically generated by grub-mkconfig using templates



          from /etc/grub.d and settings from /etc/default/grub



          #



          The proper way to edit grub entries is via /etc/default/grub and the files in /etc/grub.d/.






          share|improve this answer































            0














            This entries are generated from os-prober. Os-prober:




            Description: utility to detect other OSes on a set of drives This
            package detects other OSes available on a system and outputs the
            results in a generic machine-readable format.




            Take a look in /usr/bin there is a shell-skript from package os-prober.



            You can remove the executable flag from the skript, Or deinstall os-prober.



            Edit: Wrong place I mean /usr/bin/os-prober. Nott in /etc/grub.d






            share|improve this answer

































              0














              I was able to remove entries generated by os-prober using following Grub configuration:



              1.Check UUIDs for the disks using the command:



              sudo blkid


              2.Update /etc/default/grub file by adding the line:



              GRUB_OS_PROBER_SKIP_LIST="UUID_OF_DISK_YOU_DONT_WANT_SCAN1 UUID_OF_DISK_YOU_DONT_WANT_SCAN2"


              3.Regenerate Grub configuration:



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


              NOTE: grub2-mkconfig due to some reasons still displays information about the ignored disk, but it wasn't generated to final /boot/grub2/grub.cfg file.






              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%2f408464%2fupdate-grub-brings-back-manually-removed-menu-entries%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                0














                /boot/grub/grub.cfg



                #



                DO NOT EDIT THIS FILE



                #



                It is automatically generated by grub-mkconfig using templates



                from /etc/grub.d and settings from /etc/default/grub



                #



                The proper way to edit grub entries is via /etc/default/grub and the files in /etc/grub.d/.






                share|improve this answer




























                  0














                  /boot/grub/grub.cfg



                  #



                  DO NOT EDIT THIS FILE



                  #



                  It is automatically generated by grub-mkconfig using templates



                  from /etc/grub.d and settings from /etc/default/grub



                  #



                  The proper way to edit grub entries is via /etc/default/grub and the files in /etc/grub.d/.






                  share|improve this answer


























                    0












                    0








                    0







                    /boot/grub/grub.cfg



                    #



                    DO NOT EDIT THIS FILE



                    #



                    It is automatically generated by grub-mkconfig using templates



                    from /etc/grub.d and settings from /etc/default/grub



                    #



                    The proper way to edit grub entries is via /etc/default/grub and the files in /etc/grub.d/.






                    share|improve this answer













                    /boot/grub/grub.cfg



                    #



                    DO NOT EDIT THIS FILE



                    #



                    It is automatically generated by grub-mkconfig using templates



                    from /etc/grub.d and settings from /etc/default/grub



                    #



                    The proper way to edit grub entries is via /etc/default/grub and the files in /etc/grub.d/.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Dec 3 '17 at 0:59









                    Lucas RamageLucas Ramage

                    31615




                    31615

























                        0














                        This entries are generated from os-prober. Os-prober:




                        Description: utility to detect other OSes on a set of drives This
                        package detects other OSes available on a system and outputs the
                        results in a generic machine-readable format.




                        Take a look in /usr/bin there is a shell-skript from package os-prober.



                        You can remove the executable flag from the skript, Or deinstall os-prober.



                        Edit: Wrong place I mean /usr/bin/os-prober. Nott in /etc/grub.d






                        share|improve this answer






























                          0














                          This entries are generated from os-prober. Os-prober:




                          Description: utility to detect other OSes on a set of drives This
                          package detects other OSes available on a system and outputs the
                          results in a generic machine-readable format.




                          Take a look in /usr/bin there is a shell-skript from package os-prober.



                          You can remove the executable flag from the skript, Or deinstall os-prober.



                          Edit: Wrong place I mean /usr/bin/os-prober. Nott in /etc/grub.d






                          share|improve this answer




























                            0












                            0








                            0







                            This entries are generated from os-prober. Os-prober:




                            Description: utility to detect other OSes on a set of drives This
                            package detects other OSes available on a system and outputs the
                            results in a generic machine-readable format.




                            Take a look in /usr/bin there is a shell-skript from package os-prober.



                            You can remove the executable flag from the skript, Or deinstall os-prober.



                            Edit: Wrong place I mean /usr/bin/os-prober. Nott in /etc/grub.d






                            share|improve this answer















                            This entries are generated from os-prober. Os-prober:




                            Description: utility to detect other OSes on a set of drives This
                            package detects other OSes available on a system and outputs the
                            results in a generic machine-readable format.




                            Take a look in /usr/bin there is a shell-skript from package os-prober.



                            You can remove the executable flag from the skript, Or deinstall os-prober.



                            Edit: Wrong place I mean /usr/bin/os-prober. Nott in /etc/grub.d







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Dec 3 '17 at 10:13

























                            answered Dec 3 '17 at 9:19







                            user192526






























                                0














                                I was able to remove entries generated by os-prober using following Grub configuration:



                                1.Check UUIDs for the disks using the command:



                                sudo blkid


                                2.Update /etc/default/grub file by adding the line:



                                GRUB_OS_PROBER_SKIP_LIST="UUID_OF_DISK_YOU_DONT_WANT_SCAN1 UUID_OF_DISK_YOU_DONT_WANT_SCAN2"


                                3.Regenerate Grub configuration:



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


                                NOTE: grub2-mkconfig due to some reasons still displays information about the ignored disk, but it wasn't generated to final /boot/grub2/grub.cfg file.






                                share|improve this answer




























                                  0














                                  I was able to remove entries generated by os-prober using following Grub configuration:



                                  1.Check UUIDs for the disks using the command:



                                  sudo blkid


                                  2.Update /etc/default/grub file by adding the line:



                                  GRUB_OS_PROBER_SKIP_LIST="UUID_OF_DISK_YOU_DONT_WANT_SCAN1 UUID_OF_DISK_YOU_DONT_WANT_SCAN2"


                                  3.Regenerate Grub configuration:



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


                                  NOTE: grub2-mkconfig due to some reasons still displays information about the ignored disk, but it wasn't generated to final /boot/grub2/grub.cfg file.






                                  share|improve this answer


























                                    0












                                    0








                                    0







                                    I was able to remove entries generated by os-prober using following Grub configuration:



                                    1.Check UUIDs for the disks using the command:



                                    sudo blkid


                                    2.Update /etc/default/grub file by adding the line:



                                    GRUB_OS_PROBER_SKIP_LIST="UUID_OF_DISK_YOU_DONT_WANT_SCAN1 UUID_OF_DISK_YOU_DONT_WANT_SCAN2"


                                    3.Regenerate Grub configuration:



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


                                    NOTE: grub2-mkconfig due to some reasons still displays information about the ignored disk, but it wasn't generated to final /boot/grub2/grub.cfg file.






                                    share|improve this answer













                                    I was able to remove entries generated by os-prober using following Grub configuration:



                                    1.Check UUIDs for the disks using the command:



                                    sudo blkid


                                    2.Update /etc/default/grub file by adding the line:



                                    GRUB_OS_PROBER_SKIP_LIST="UUID_OF_DISK_YOU_DONT_WANT_SCAN1 UUID_OF_DISK_YOU_DONT_WANT_SCAN2"


                                    3.Regenerate Grub configuration:



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


                                    NOTE: grub2-mkconfig due to some reasons still displays information about the ignored disk, but it wasn't generated to final /boot/grub2/grub.cfg file.







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Sep 2 '18 at 8:13









                                    SathOkhSathOkh

                                    1013




                                    1013






























                                        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.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f408464%2fupdate-grub-brings-back-manually-removed-menu-entries%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

                                        Entries order in /etc/network/interfaces

                                        新発田市

                                        Grub takes very long (several minutes) to open Menu (in Multi-Boot-System)