GRUB2 not loading modules












1















I am trying to make my own Multiboot-USB-stick with a custom GRUB2 config. I basically followed instructions from https://wiki.archlinux.org/index.php/Multiboot_USB_drive to install GRUB2 on an USB stick in EFI mode:




  • Format stick, having one EFI partition (100MB) and a EXT4 partition

  • mount partitions to some location

  • Executing grub-install --target=x86_64-efi --recheck --removable --efi-directory=/EFI_MOUNTPOINT --boot-directory=/DATA_MOUNTPOINT/boot


So I have an EFI-partition including a grub.cfg thats like



search.fs_uuid <uuid> root hdX,gptY 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg


and a boot-partition with just one folder /boot/grub containing




  • fonts (folder)

  • locale (folder)

  • x86_64-efi (folder)

  • grubenv (file)


This is working as far as I can write my own grub.cfg into /boot/grub, containing some menuentrys, and I can boot from that entries.
But I cant load any modules. If I enter command-line, e.g. typing



insmod ntfs


does absolutely nothing. There is no sort of error message or something, the module just doesnt get loaded (checked with lsmod). I also tried absolute addressing like



insmod (hdX,gptY)/boot/grub/x86_64-efi/ntfs.mod


with the same result. The path is correct because for example I can cat the .mod-file to standard output.



What I actually can do is to remove modules. E.g.



rmmod btrfs
rmmod btrfs


results in error message just at the second line, so module btrfs gets removed, which is confirmed by lsmod output. But typing (when btrfs already is removed)



insmod btrfs (or absolute addressing like above)
rmmod btrfs


results in an error message at line 2, so the first line obviously had no effect.



Do you have any idea whats going wrong? I even tried to copy the mod-folder to
the EFI-partition, but that didnt do the trick...



Thanks in advance










share|improve this question



























    1















    I am trying to make my own Multiboot-USB-stick with a custom GRUB2 config. I basically followed instructions from https://wiki.archlinux.org/index.php/Multiboot_USB_drive to install GRUB2 on an USB stick in EFI mode:




    • Format stick, having one EFI partition (100MB) and a EXT4 partition

    • mount partitions to some location

    • Executing grub-install --target=x86_64-efi --recheck --removable --efi-directory=/EFI_MOUNTPOINT --boot-directory=/DATA_MOUNTPOINT/boot


    So I have an EFI-partition including a grub.cfg thats like



    search.fs_uuid <uuid> root hdX,gptY 
    set prefix=($root)'/boot/grub'
    configfile $prefix/grub.cfg


    and a boot-partition with just one folder /boot/grub containing




    • fonts (folder)

    • locale (folder)

    • x86_64-efi (folder)

    • grubenv (file)


    This is working as far as I can write my own grub.cfg into /boot/grub, containing some menuentrys, and I can boot from that entries.
    But I cant load any modules. If I enter command-line, e.g. typing



    insmod ntfs


    does absolutely nothing. There is no sort of error message or something, the module just doesnt get loaded (checked with lsmod). I also tried absolute addressing like



    insmod (hdX,gptY)/boot/grub/x86_64-efi/ntfs.mod


    with the same result. The path is correct because for example I can cat the .mod-file to standard output.



    What I actually can do is to remove modules. E.g.



    rmmod btrfs
    rmmod btrfs


    results in error message just at the second line, so module btrfs gets removed, which is confirmed by lsmod output. But typing (when btrfs already is removed)



    insmod btrfs (or absolute addressing like above)
    rmmod btrfs


    results in an error message at line 2, so the first line obviously had no effect.



    Do you have any idea whats going wrong? I even tried to copy the mod-folder to
    the EFI-partition, but that didnt do the trick...



    Thanks in advance










    share|improve this question

























      1












      1








      1








      I am trying to make my own Multiboot-USB-stick with a custom GRUB2 config. I basically followed instructions from https://wiki.archlinux.org/index.php/Multiboot_USB_drive to install GRUB2 on an USB stick in EFI mode:




      • Format stick, having one EFI partition (100MB) and a EXT4 partition

      • mount partitions to some location

      • Executing grub-install --target=x86_64-efi --recheck --removable --efi-directory=/EFI_MOUNTPOINT --boot-directory=/DATA_MOUNTPOINT/boot


      So I have an EFI-partition including a grub.cfg thats like



      search.fs_uuid <uuid> root hdX,gptY 
      set prefix=($root)'/boot/grub'
      configfile $prefix/grub.cfg


      and a boot-partition with just one folder /boot/grub containing




      • fonts (folder)

      • locale (folder)

      • x86_64-efi (folder)

      • grubenv (file)


      This is working as far as I can write my own grub.cfg into /boot/grub, containing some menuentrys, and I can boot from that entries.
      But I cant load any modules. If I enter command-line, e.g. typing



      insmod ntfs


      does absolutely nothing. There is no sort of error message or something, the module just doesnt get loaded (checked with lsmod). I also tried absolute addressing like



      insmod (hdX,gptY)/boot/grub/x86_64-efi/ntfs.mod


      with the same result. The path is correct because for example I can cat the .mod-file to standard output.



      What I actually can do is to remove modules. E.g.



      rmmod btrfs
      rmmod btrfs


      results in error message just at the second line, so module btrfs gets removed, which is confirmed by lsmod output. But typing (when btrfs already is removed)



      insmod btrfs (or absolute addressing like above)
      rmmod btrfs


      results in an error message at line 2, so the first line obviously had no effect.



      Do you have any idea whats going wrong? I even tried to copy the mod-folder to
      the EFI-partition, but that didnt do the trick...



      Thanks in advance










      share|improve this question














      I am trying to make my own Multiboot-USB-stick with a custom GRUB2 config. I basically followed instructions from https://wiki.archlinux.org/index.php/Multiboot_USB_drive to install GRUB2 on an USB stick in EFI mode:




      • Format stick, having one EFI partition (100MB) and a EXT4 partition

      • mount partitions to some location

      • Executing grub-install --target=x86_64-efi --recheck --removable --efi-directory=/EFI_MOUNTPOINT --boot-directory=/DATA_MOUNTPOINT/boot


      So I have an EFI-partition including a grub.cfg thats like



      search.fs_uuid <uuid> root hdX,gptY 
      set prefix=($root)'/boot/grub'
      configfile $prefix/grub.cfg


      and a boot-partition with just one folder /boot/grub containing




      • fonts (folder)

      • locale (folder)

      • x86_64-efi (folder)

      • grubenv (file)


      This is working as far as I can write my own grub.cfg into /boot/grub, containing some menuentrys, and I can boot from that entries.
      But I cant load any modules. If I enter command-line, e.g. typing



      insmod ntfs


      does absolutely nothing. There is no sort of error message or something, the module just doesnt get loaded (checked with lsmod). I also tried absolute addressing like



      insmod (hdX,gptY)/boot/grub/x86_64-efi/ntfs.mod


      with the same result. The path is correct because for example I can cat the .mod-file to standard output.



      What I actually can do is to remove modules. E.g.



      rmmod btrfs
      rmmod btrfs


      results in error message just at the second line, so module btrfs gets removed, which is confirmed by lsmod output. But typing (when btrfs already is removed)



      insmod btrfs (or absolute addressing like above)
      rmmod btrfs


      results in an error message at line 2, so the first line obviously had no effect.



      Do you have any idea whats going wrong? I even tried to copy the mod-folder to
      the EFI-partition, but that didnt do the trick...



      Thanks in advance







      linux boot grub grub2






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 29 at 0:02









      gruber235gruber235

      62




      62






















          2 Answers
          2






          active

          oldest

          votes


















          1














          I have tried several different "multiboot USB" options. I like this one cause it is dynamic, all you have to do is add your ISO files and it will find the new ISO file and add it to the menu. No configuring the GRUB menu. I was have trouble with Linux Mint Debian Edition 3 and but it works with this one. You can always look at his scripts to see how it works.



          Good Luck.



          here is the site:



          https://github.com/mpolitzer/grub-iso-multiboot






          share|improve this answer































            0














            Ok, I just found out this is caused by Secure Boot. According to https://forums.opensuse.org/showthread.php/531587-is-GRUB-deliberately-broken-in-openSUSE




            If secure-boot is enabled, then grub2-efi internally disables "insmod", so as to prevent secure-boot violations. And "grub2" has been loaded from "grub.efi" in your EFI partition, which already has preloaded the modules normally needed.
            Additionally, "linux" is not allowed if secure-boot is enabled -- one must use "linuxefi" (which checks signatures).




            And grub-install --help yields




            --no-uefi-secure-boot:
            do not install an image usable with UEFI Secure Boot, even if the system was currently started using it. This option is only available on EFI.




            So if your current machine was started with Secure Boot, grub-install does install that version of GRUB and you cant insert any modules. Strangely enough in my case GRUB had a module "linux" loaded but no module "linuxefi"
            . Anyway, here is my updated setup:




            • Format stick, having one EFI partition (100MB) and a EXT4 partition (as data partition for everything not related to GRUB)

            • Mount EFI partition

            • Execute grub-install --target=x86_64-efi --recheck --removable --no-uefi-secure-boot --efi-directory=/EFI_MOUNTPOINT --boot-directory=/EFI_MOUNTPOINT/boot


            I cant disable Secure Boot on my machine but mark .efi-files as secure. Using that setup (and marking /EFI/BOOT/BOOTX64.EFI as secure in computers EFI) was working for me and GRUB now is fully functional. Using --boot-directory=/DATA_MOUNTPOINT/boot like in my original setup caused GRUB to crash and enter rescue mode.



            Considering how common Secure Boot nowadays is I find it pretty annoying to see this behavior is mentioned nowhere in the entire GRUB2 manual.






            share|improve this answer























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "3"
              };
              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%2fsuperuser.com%2fquestions%2f1399463%2fgrub2-not-loading-modules%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














              I have tried several different "multiboot USB" options. I like this one cause it is dynamic, all you have to do is add your ISO files and it will find the new ISO file and add it to the menu. No configuring the GRUB menu. I was have trouble with Linux Mint Debian Edition 3 and but it works with this one. You can always look at his scripts to see how it works.



              Good Luck.



              here is the site:



              https://github.com/mpolitzer/grub-iso-multiboot






              share|improve this answer




























                1














                I have tried several different "multiboot USB" options. I like this one cause it is dynamic, all you have to do is add your ISO files and it will find the new ISO file and add it to the menu. No configuring the GRUB menu. I was have trouble with Linux Mint Debian Edition 3 and but it works with this one. You can always look at his scripts to see how it works.



                Good Luck.



                here is the site:



                https://github.com/mpolitzer/grub-iso-multiboot






                share|improve this answer


























                  1












                  1








                  1







                  I have tried several different "multiboot USB" options. I like this one cause it is dynamic, all you have to do is add your ISO files and it will find the new ISO file and add it to the menu. No configuring the GRUB menu. I was have trouble with Linux Mint Debian Edition 3 and but it works with this one. You can always look at his scripts to see how it works.



                  Good Luck.



                  here is the site:



                  https://github.com/mpolitzer/grub-iso-multiboot






                  share|improve this answer













                  I have tried several different "multiboot USB" options. I like this one cause it is dynamic, all you have to do is add your ISO files and it will find the new ISO file and add it to the menu. No configuring the GRUB menu. I was have trouble with Linux Mint Debian Edition 3 and but it works with this one. You can always look at his scripts to see how it works.



                  Good Luck.



                  here is the site:



                  https://github.com/mpolitzer/grub-iso-multiboot







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 1 at 15:34









                  MJCMJC

                  112




                  112

























                      0














                      Ok, I just found out this is caused by Secure Boot. According to https://forums.opensuse.org/showthread.php/531587-is-GRUB-deliberately-broken-in-openSUSE




                      If secure-boot is enabled, then grub2-efi internally disables "insmod", so as to prevent secure-boot violations. And "grub2" has been loaded from "grub.efi" in your EFI partition, which already has preloaded the modules normally needed.
                      Additionally, "linux" is not allowed if secure-boot is enabled -- one must use "linuxefi" (which checks signatures).




                      And grub-install --help yields




                      --no-uefi-secure-boot:
                      do not install an image usable with UEFI Secure Boot, even if the system was currently started using it. This option is only available on EFI.




                      So if your current machine was started with Secure Boot, grub-install does install that version of GRUB and you cant insert any modules. Strangely enough in my case GRUB had a module "linux" loaded but no module "linuxefi"
                      . Anyway, here is my updated setup:




                      • Format stick, having one EFI partition (100MB) and a EXT4 partition (as data partition for everything not related to GRUB)

                      • Mount EFI partition

                      • Execute grub-install --target=x86_64-efi --recheck --removable --no-uefi-secure-boot --efi-directory=/EFI_MOUNTPOINT --boot-directory=/EFI_MOUNTPOINT/boot


                      I cant disable Secure Boot on my machine but mark .efi-files as secure. Using that setup (and marking /EFI/BOOT/BOOTX64.EFI as secure in computers EFI) was working for me and GRUB now is fully functional. Using --boot-directory=/DATA_MOUNTPOINT/boot like in my original setup caused GRUB to crash and enter rescue mode.



                      Considering how common Secure Boot nowadays is I find it pretty annoying to see this behavior is mentioned nowhere in the entire GRUB2 manual.






                      share|improve this answer




























                        0














                        Ok, I just found out this is caused by Secure Boot. According to https://forums.opensuse.org/showthread.php/531587-is-GRUB-deliberately-broken-in-openSUSE




                        If secure-boot is enabled, then grub2-efi internally disables "insmod", so as to prevent secure-boot violations. And "grub2" has been loaded from "grub.efi" in your EFI partition, which already has preloaded the modules normally needed.
                        Additionally, "linux" is not allowed if secure-boot is enabled -- one must use "linuxefi" (which checks signatures).




                        And grub-install --help yields




                        --no-uefi-secure-boot:
                        do not install an image usable with UEFI Secure Boot, even if the system was currently started using it. This option is only available on EFI.




                        So if your current machine was started with Secure Boot, grub-install does install that version of GRUB and you cant insert any modules. Strangely enough in my case GRUB had a module "linux" loaded but no module "linuxefi"
                        . Anyway, here is my updated setup:




                        • Format stick, having one EFI partition (100MB) and a EXT4 partition (as data partition for everything not related to GRUB)

                        • Mount EFI partition

                        • Execute grub-install --target=x86_64-efi --recheck --removable --no-uefi-secure-boot --efi-directory=/EFI_MOUNTPOINT --boot-directory=/EFI_MOUNTPOINT/boot


                        I cant disable Secure Boot on my machine but mark .efi-files as secure. Using that setup (and marking /EFI/BOOT/BOOTX64.EFI as secure in computers EFI) was working for me and GRUB now is fully functional. Using --boot-directory=/DATA_MOUNTPOINT/boot like in my original setup caused GRUB to crash and enter rescue mode.



                        Considering how common Secure Boot nowadays is I find it pretty annoying to see this behavior is mentioned nowhere in the entire GRUB2 manual.






                        share|improve this answer


























                          0












                          0








                          0







                          Ok, I just found out this is caused by Secure Boot. According to https://forums.opensuse.org/showthread.php/531587-is-GRUB-deliberately-broken-in-openSUSE




                          If secure-boot is enabled, then grub2-efi internally disables "insmod", so as to prevent secure-boot violations. And "grub2" has been loaded from "grub.efi" in your EFI partition, which already has preloaded the modules normally needed.
                          Additionally, "linux" is not allowed if secure-boot is enabled -- one must use "linuxefi" (which checks signatures).




                          And grub-install --help yields




                          --no-uefi-secure-boot:
                          do not install an image usable with UEFI Secure Boot, even if the system was currently started using it. This option is only available on EFI.




                          So if your current machine was started with Secure Boot, grub-install does install that version of GRUB and you cant insert any modules. Strangely enough in my case GRUB had a module "linux" loaded but no module "linuxefi"
                          . Anyway, here is my updated setup:




                          • Format stick, having one EFI partition (100MB) and a EXT4 partition (as data partition for everything not related to GRUB)

                          • Mount EFI partition

                          • Execute grub-install --target=x86_64-efi --recheck --removable --no-uefi-secure-boot --efi-directory=/EFI_MOUNTPOINT --boot-directory=/EFI_MOUNTPOINT/boot


                          I cant disable Secure Boot on my machine but mark .efi-files as secure. Using that setup (and marking /EFI/BOOT/BOOTX64.EFI as secure in computers EFI) was working for me and GRUB now is fully functional. Using --boot-directory=/DATA_MOUNTPOINT/boot like in my original setup caused GRUB to crash and enter rescue mode.



                          Considering how common Secure Boot nowadays is I find it pretty annoying to see this behavior is mentioned nowhere in the entire GRUB2 manual.






                          share|improve this answer













                          Ok, I just found out this is caused by Secure Boot. According to https://forums.opensuse.org/showthread.php/531587-is-GRUB-deliberately-broken-in-openSUSE




                          If secure-boot is enabled, then grub2-efi internally disables "insmod", so as to prevent secure-boot violations. And "grub2" has been loaded from "grub.efi" in your EFI partition, which already has preloaded the modules normally needed.
                          Additionally, "linux" is not allowed if secure-boot is enabled -- one must use "linuxefi" (which checks signatures).




                          And grub-install --help yields




                          --no-uefi-secure-boot:
                          do not install an image usable with UEFI Secure Boot, even if the system was currently started using it. This option is only available on EFI.




                          So if your current machine was started with Secure Boot, grub-install does install that version of GRUB and you cant insert any modules. Strangely enough in my case GRUB had a module "linux" loaded but no module "linuxefi"
                          . Anyway, here is my updated setup:




                          • Format stick, having one EFI partition (100MB) and a EXT4 partition (as data partition for everything not related to GRUB)

                          • Mount EFI partition

                          • Execute grub-install --target=x86_64-efi --recheck --removable --no-uefi-secure-boot --efi-directory=/EFI_MOUNTPOINT --boot-directory=/EFI_MOUNTPOINT/boot


                          I cant disable Secure Boot on my machine but mark .efi-files as secure. Using that setup (and marking /EFI/BOOT/BOOTX64.EFI as secure in computers EFI) was working for me and GRUB now is fully functional. Using --boot-directory=/DATA_MOUNTPOINT/boot like in my original setup caused GRUB to crash and enter rescue mode.



                          Considering how common Secure Boot nowadays is I find it pretty annoying to see this behavior is mentioned nowhere in the entire GRUB2 manual.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Jan 29 at 16:22









                          gruber235gruber235

                          62




                          62






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Super User!


                              • 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%2fsuperuser.com%2fquestions%2f1399463%2fgrub2-not-loading-modules%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

                              Plaza Victoria

                              Puebla de Zaragoza

                              Musa