Grub menu not working

Forum Forums New users New Users and General Questions Grub menu not working

  • This topic has 87 replies, 11 voices, and was last updated Mar 30-7:10 pm by smit.
Viewing 15 posts - 16 through 30 (of 88 total)
  • Author
    Posts
  • #136904
    Member
    mygrove

      $ lsblk
      NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
      nvme0n1 259:0 0 238.5G 0 disk
      ├─nvme0n1p1 259:1 0 100M 0 part /boot/efi
      ├─nvme0n1p2 259:2 0 16M 0 part
      ├─nvme0n1p3 259:3 0 85G 0 part
      ├─nvme0n1p4 259:4 0 25G 0 part /
      ├─nvme0n1p5 259:5 0 127.4G 0 part
      └─nvme0n1p6 259:6 0 1G 0 part

      I ran

      sudo efibootmgr -o 0000,0002,2001,2002,2003

      but the changes are not persistent at the next boot and if I check with efibootmgr it has reverted to the previous boot order.

      Thanks.

      #136907
      Member
      abc-nix

        It’s so strange. There is another topic in the forum with a user who has a very similar issue, but it was never resolved. For some reason efibootmgr changes were not being saved, and I still don’t know why.

        If you run
        sudo efibootmgr -v -n 0000
        to try to set antiX as the first boot option for next reboot, does it boot to antiX or does it still boot to Windows? If it still boots to Windows, then efibootmgr isn’t working at all, even if it says it does.

        #136910
        Member
        mygrove

          If you run
          sudo efibootmgr -v -n 0000
          to try to set antiX as the first boot option for next reboot, does it boot to antiX or does it still boot to Windows? If it still boots to Windows, then efibootmgr isn’t working at all, even if it says it does.

          Now that is interesting as it DID work on the next boot! But of course it reverts to Windows for the following boot.

          #136914
          Moderator
          Brian Masinick

            The only thing that comes to mind here is multi-boot behavior. IF you happen to be setting those EFI parameters on a system that is NOT managing the boot loader, that is the only “logical” reason I can think of for this behavior, but who knows?

            Maybe something else is altering the settings that we have not yet taken into consideration.

            --
            Brian Masinick

            #136915
            Member
            abc-nix

              If you run
              sudo efibootmgr -v -n 0000
              to try to set antiX as the first boot option for next reboot, does it boot to antiX or does it still boot to Windows? If it still boots to Windows, then efibootmgr isn’t working at all, even if it says it does.

              Now that is interesting as it DID work on the next boot! But of course it reverts to Windows for the following boot.

              Let’s try removing the boot order and creating it anew
              To remove the current boot order:
              sudo efibootmgr -O

              Now the same command as before to create it new:
              sudo efibootmgr -o 0000,0002,2001,2002,2003

              #136919
              Member
              mygrove

                Are we sure the Grub menu is on the correct (intended) partition? As it only appears when antiX has already been selected? Or could there be a Windows boot manager being called before Grub?

                #136923
                Member
                mygrove

                  Let’s try removing the boot order and creating it anew
                  To remove the current boot order:
                  sudo efibootmgr -O

                  Now the same command as before to create it new:
                  sudo efibootmgr -o 0000,0002,2001,2002,2003

                  Here’s the response, so I’ll now reboot.

                  $ sudo efibootmgr -O
                  [sudo] password for Graham:
                  BootCurrent: 0000
                  Timeout: 0 seconds
                  No BootOrder is set; firmware will attempt recovery
                  Boot0000* antiX Linux
                  Boot0002* Windows Boot Manager
                  Boot2001* EFI USB Device
                  Boot2002* EFI DVD/CDROM
                  Boot2003* EFI Network

                  $ sudo efibootmgr -o 0000,0002,2001,2002,2003
                  BootCurrent: 0000
                  Timeout: 0 seconds
                  BootOrder: 0000,0002,2001,2002,2003
                  Boot0000* antiX Linux
                  Boot0002* Windows Boot Manager
                  Boot2001* EFI USB Device
                  Boot2002* EFI DVD/CDROM
                  Boot2003* EFI Network

                  #136926
                  Member
                  abc-nix

                    Are we sure the Grub menu is on the correct (intended) partition? As it only appears when antiX has already been selected? Or could there be a Windows boot manager being called before Grub?

                    The Grub files are stored in /boot/grub locally.

                    /boot/efi, that is mounted from the partition /dev/nvme0n1p1, contains EFI config files that point to where the grub bootloader is. efibootmgr is a simple way to manage the EFI folders and configuration. It also adds instructions so that efishell know what to do.

                    If you are able to boot into antiX using the BIOS, what you are actually telling the efishell is to boot following the antiX EFI instruction file/folder. That means the config is there (you can even see the files if you explore the /boot/efi/EFI folder).

                    I don’t like editing these files manually, as I fear I may break something. Better figure out why efibootmgr is failing.

                    #136929
                    Member
                    mygrove

                      Here’s the response, so I’ll now reboot.

                      Unfortunately even after those optimistic responses from efibootmgr it hasn’t fixed the boot order, it has reverted to:

                      $ efibootmgr
                      BootCurrent: 0000
                      Timeout: 0 seconds
                      BootOrder: 0002,0000,2001,2002,2003
                      Boot0000* antiX Linux
                      Boot0002* Windows Boot Manager
                      Boot2001* EFI USB Device
                      Boot2002* EFI DVD/CDROM
                      Boot2003* EFI Network

                      #136932
                      Member
                      abc-nix

                        Unfortunately even after those optimistic responses from efibootmgr it hasn’t fixed the boot order, it has reverted

                        I will try to manually create an entry on my system and report back with the exact steps.

                        #136941
                        Member
                        abc-nix

                          As the “antiX Linux” efi configuration already exists, these are the instructions for creating a new one using this existing configuration and adding it to the efibootmgr list.

                          0. First check the folder names in the EFI folder of the ESP
                          ls -l /boot/efi/EFI
                          Let us imagine that the antiX 23.1 entry is named “antix23.1”.

                          1. Create a new EFI folder copying the original antix23.1 to a new name “antix-test23.1”
                          sudo cp -dr /boot/efi/EFI/antix23.1 /boot/efi/EFI/antix-test23.1

                          2. Check the name of the efi file for the new /boot/efi/EFI/antix-test23.1 folder
                          ls /boot/efi/EFI/antix-test23.1
                          In my case, the file name is “grubx64.efi”. See if yours is the same

                          3. Add a new entry to the efibootmgr with the path to the efi file and a new name. Example:
                          sudo efibootmgr --create --loader '\EFI\antix-test23.1\grubx64.efi' --label 'antiX 23.1 EFI test' --unicode

                          It will automatically add it as the first option to the boot order. Now you only need to reboot to see if it worked.

                          It worked on my system, but the original also worked. I am not sure why the efishell is skipping the order and booting directly to windows. I think you already said that Secure Boot was disabled, so there must be some other boot option in the BIOS that decides to boot windows directly.

                          If it didn’t work or you want to remove the entry, check the new boot number (let us imagine it being 0002), you can run:
                          sudo efibootmgr -b 0002 -B

                          • This reply was modified 3 weeks, 5 days ago by abc-nix.
                          #136944
                          Member
                          mygrove

                            After the last reboot. the Windows entry has disappeared from the Grub menu.

                            In antiX, I went to fix this using “Boot Repair” in the Control Centre but the “Boot Repair” entry is now completely missing.

                            #136945
                            Member
                            abc-nix

                              After the last reboot. the Windows entry has disappeared from the Grub menu.

                              Check to see if the OS Prober is disabled.
                              grep "GRUB_DISABLE_OS_PROBER" /etc/default/grub
                              It should read exactly
                              GRUB_DISABLE_OS_PROBER=false
                              If it isn’t exactly this (it must not contain any # symbols), edit this file
                              sudo geany /etc/default/grub
                              and replace the line to say exactly what I wrote above. After that, save the file and run:
                              sudo update-grub
                              And see if the output says it “found” a Ẃindows entry and added it to grub.

                              #136946
                              Moderator
                              Brian Masinick

                                @mygrove and @abc-nix

                                Based on my own understanding of both the GRUB boot loader and the EFI/UEFI methods,
                                what each of you have done so far seems “correct” to me too.

                                This leads me to highly suspect that SOMETHING isn’t what it “seems” or what
                                we believe it to be.

                                @abc-nix your example and test is excellent.

                                @mygrove please make certain that your EFI settings are what you think they
                                are. One time when I was having problems, I was pretty sure things were a
                                certain way, but when I went back over everything, one or two things were
                                DIFFERENT than what I had thought I had set or reset.

                                Once I discovered the discrepancy, it was, of course, easy to fix.

                                Not sure if your story will be the same or not, but at this point
                                I would double and triple check everything, including whether EFI
                                is enabled or not and if SECURE BOOT is enabled or not. One time
                                the settings were NOT what I believed they were and that naturally
                                changed the behavior, so just to be certain that isn’t your problem,
                                go over every possible parameter, looking for inconsistencies and
                                differences from what you know, planned and believe.

                                It won’t be the first time, and most of us have messed up more than
                                once. Re-checking everything, and trying some of the experiments
                                like abc-nix just may reveal what is actually going on.

                                Best wishes at finding whatever is not what is believed to be
                                your current settings!

                                --
                                Brian Masinick

                                #136950
                                Member
                                mygrove

                                  The last step does not work as expected:

                                  $ ls /boot/efi/EFI/antiX-test
                                  grubx64.efi

                                  $ sudo efibootmgr –create –loader ‘\EFI\antiX-test\grubx64.efi’ –label ‘antiX 23.1 EFI test’ –unicode
                                  Could not prepare Boot variable: No such file or directory

                                Viewing 15 posts - 16 through 30 (of 88 total)
                                • You must be logged in to reply to this topic.