[SOLVED] Too many GRUBs / BootLoaders on Dual Boot

When you run into problems installing MX Linux XFCE
Message
Author
User avatar
fehlix
Developer
Posts: 12877
Joined: Wed Apr 11, 2018 5:09 pm

Re: Too many GRUBs / BootLoaders on Dual Boot

#21 Post by fehlix »

JayM wrote: Mon Nov 18, 2019 6:59 am There's only one bootloader: grub (which stands for GRand Unified Bootloader.)
A normal GRUB install, generates always a grub.cf grub-menu. On MBR/BIOS we have only one active grub-bootloader, so you only see one grub-menu. On UEFI you can list the efi-grub loader with the UEFI-bootmenu, and for different install you would than boot into different grub-menus.
Energy wrote: Mon Nov 18, 2019 6:34 am .. now it boots directly into MX giving the Grub menu!
OK, I assume you have run MX Boot Repair.
Energy wrote: Mon Nov 18, 2019 6:34 am how can i add the Windows loader in that menu?
That's a known "bug" and a fix is already available, awaiting to get released, asap.
Workaround re-run update-grub,either manually or using MX Boot Options.
Energy wrote: Mon Nov 18, 2019 6:34 am /boot/efi/ is Empty
Yes, the reason /boot/efi is empty because that directory is just a mount point.
And as you originally installed within BIOS-mode and not in UEFI-mode no fstab entry has been generated for
the ESP (EFI System Partition).
Your ESP is sda1:

Code: Select all

sda                                                                               
├─sda1      vfat     SYSTEM   72DF-E82C                                           

Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  274MB   273MB   fat32        EFI system partition          boot, esp
To fix-add the missing entry run this from the terminal command line as normal user:
Do copy paste onto command-line terminal ( Paste = Ctrl-Shift-V)
First lets make a backup of fstab just in case:

Code: Select all

sudo cp  /etc/fstab  /etc/fstab.backup 
Now let's add the mssing ESP-entry:

Code: Select all

echo -e "\nUUID=72DF-E82C  /boot/efi vfat defaults,noatime,dmask=0002,fmask=0113 0 0" | sudo tee -a /etc/fstab
Now let's mount the ESP onto /boot/efi

Code: Select all

sudo mount -a
Now, letS' see what efi-loader we have on the ESP:

Code: Select all

find /boot/efi  -iname "*.efi" -ls
In addition:
Let's list the UEFI-boot menu entry from the NVRAM:

Code: Select all

sudo efibootmgr -v
Please post the output of the last two commands to double check what we can remove.
:puppy:

User avatar
Energy
Posts: 18
Joined: Wed Nov 13, 2019 9:18 am

Re: Too many GRUBs / BootLoaders on Dual Boot

#22 Post by Energy »

I'm Happy to have solved the main issues, thanks!, :happy:
fehlix wrote: Mon Nov 18, 2019 7:47 am OK, I assume you have run MX Boot Repair.
Exactly
fehlix wrote: Mon Nov 18, 2019 7:47 am
Energy wrote: Mon Nov 18, 2019 6:34 am how can i add the Windows loader in that menu?
That's a known "bug" and a fix is already available, awaiting to get released, asap.
Workaround re-run update-grub,either manually or using MX Boot Options.
Yes i did it when i did run the Fix ;)


.



find /boot/efi -iname "*.efi" -ls

Code: Select all

   262   1492 -rw-rw-r--   1 root     root      1527608 Oct 11 22:09 /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
      363   1476 -rw-rw-r--   1 root     root      1511224 Oct 11 22:09 /boot/efi/EFI/Microsoft/Boot/bootmgr.efi
      364   1292 -rw-rw-r--   1 root     root      1321784 Sep 11 11:34 /boot/efi/EFI/Microsoft/Boot/memtest.efi
      372   1492 -rw-rw-r--   1 root     root      1527608 Oct 11 22:09 /boot/efi/EFI/Boot/bootx64.efi
      381     64 -rw-rw-r--   1 root     root        62436 Mar 19  2018 /boot/efi/EFI/ubuntu/fwupx64.efi
      382   1108 -rw-rw-r--   1 root     root      1133944 Mar 26  2018 /boot/efi/EFI/ubuntu/grubx64.efi
      383   1144 -rw-rw-r--   1 root     root      1169992 Mar 26  2018 /boot/efi/EFI/ubuntu/shimx64.efi
      384   1144 -rw-rw-r--   1 root     root      1168464 Mar 26  2018 /boot/efi/EFI/ubuntu/mmx64.efi
      387    132 -rw-rw-r--   1 root     root       135168 Nov 18 07:04 /boot/efi/EFI/MX19/grubx64.efi
remember there was Mint (.Ubuntu)

and
sudo efibootmgr -v

Code: Select all

BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002,0000,0005,0001
Boot0000* Windows Boot Manager	HD(1,GPT,30f9d0f4-1f32-4ece-bf15-d667731fecbb,0x800,0x82000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....4...............
Boot0001* X-2019	HD(1,GPT,30f9d0f4-1f32-4ece-bf15-d667731fecbb,0x800,0x82000)/File(\EFI\BOOT\BOOTX64.EFI)
Boot0002* MX19	HD(1,GPT,30f9d0f4-1f32-4ece-bf15-d667731fecbb,0x800,0x82000)/File(\EFI\MX19\GRUBX64.EFI)
Boot0005* ubuntu	HD(1,GPT,30f9d0f4-1f32-4ece-bf15-d667731fecbb,0x800,0x82000)/File(\EFI\UBUNTU\SHIMX64.EFI)..BO
Thanks :hug:

User avatar
fehlix
Developer
Posts: 12877
Joined: Wed Apr 11, 2018 5:09 pm

Re: Too many GRUBs / BootLoaders on Dual Boot

#23 Post by fehlix »

Energy wrote: Fri Nov 22, 2019 6:02 am find /boot/efi -iname "*.efi" -ls

Code: Select all

381     64 -rw-rw-r--   1 root     root        62436 Mar 19  2018 /boot/efi/EFI/ubuntu/fwupx64.efi
382   1108 -rw-rw-r--   1 root     root      1133944 Mar 26  2018 /boot/efi/EFI/ubuntu/grubx64.efi
383   1144 -rw-rw-r--   1 root     root      1169992 Mar 26  2018 /boot/efi/EFI/ubuntu/shimx64.efi
384   1144 -rw-rw-r--   1 root     root      1168464 Mar 26  2018 /boot/efi/EFI/ubuntu/mmx64.efi

Code: Select all

Boot0005* ubuntu	HD(1,GPT,30f9d0f4-1f32-4ece-bf15-d667731fecbb,0x800,0x82000)/File(\EFI\UBUNTU\SHIMX64.EFI)..BO
The no longer used Mint entry, which is using the "ubuntu" entry name, can be cleared by this:
Clear NVRAM-entry # 5 from the UEFI-boot menu:

Code: Select all

sudo efibootmgr --verbose --bootnum 5 --delete-bootnum
remove the unused "ubuntu" subfolder from ESP:

Code: Select all

sudo rm -r /boot/efi/EFI/ubuntu
+++EDIT+++
And perhaps tidy up the bootorder within NVRAM, and remove # 5
From current

Code: Select all

BootOrder: 0002,0000,0005,0001
to

Code: Select all

BootOrder: 0002,0001,0000
using this

Code: Select all

sudo efibootmgr --verbose --bootorder 2,1,0
HTH
:puppy:

User avatar
Energy
Posts: 18
Joined: Wed Nov 13, 2019 9:18 am

Re: Too many GRUBs / BootLoaders on Dual Boot

#24 Post by Energy »

Now it seems so clean! :happy:

find /boot/efi -iname "*.efi" -ls

Code: Select all

 279   1492 -rw-rw-r--   1 root     root      1527608 Oct 11 22:09 /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
      380   1476 -rw-rw-r--   1 root     root      1511224 Oct 11 22:09 /boot/efi/EFI/Microsoft/Boot/bootmgr.efi
      381   1292 -rw-rw-r--   1 root     root      1321784 Sep 11 11:34 /boot/efi/EFI/Microsoft/Boot/memtest.efi
      389   1492 -rw-rw-r--   1 root     root      1527608 Oct 11 22:09 /boot/efi/EFI/Boot/bootx64.efi
      392    132 -rw-rw-r--   1 root     root       135168 Nov 18 07:04 /boot/efi/EFI/MX19/grubx64.efi

sudo efibootmgr -v

Code: Select all

BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002,0001,0000
Boot0000* Windows Boot Manager	HD(1,GPT,30f9d0f4-1f32-4ece-bf15-d667731fecbb,0x800,0x82000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....4...............
Boot0001* X-2019	HD(1,GPT,30f9d0f4-1f32-4ece-bf15-d667731fecbb,0x800,0x82000)/File(\EFI\BOOT\BOOTX64.EFI)
Boot0002* MX19	HD(1,GPT,30f9d0f4-1f32-4ece-bf15-d667731fecbb,0x800,0x82000)/File(\EFI\MX19\GRUBX64.EFI)
It's all right now, isn't it?! :cool:
THANKS!!

User avatar
Energy
Posts: 18
Joined: Wed Nov 13, 2019 9:18 am

Re: Too many GRUBs / BootLoaders on Dual Boot

#25 Post by Energy »

I've modified the first post with [Solved] ;)
Thanks everybody :hug:

User avatar
Eadwine Rose
Administrator
Posts: 15152
Joined: Wed Jul 12, 2006 2:10 am

Re: [SOLVED] Too many GRUBs / BootLoaders on Dual Boot

#26 Post by Eadwine Rose »

Just grabbing back on this.. UEFI BIOS has two entries in it that are gone from the system



I have this jotted down from a while back (thanks Fehlix for letting me know about that back when):
Cleaning up efi folder

An installed linux (or WinOS) will create a new "sub-folder" within the ESP (mounted onto /boot/efi ).
So if you would have installed, Ubuntu or Debian, you might find a sub-folder
/boot/efi/ubuntu, /boot/efi/debian (or whatever name debian has chosen)
After "uninstalling" e.g. ubuntu or debian, by clearing "formating"/re-using or otherwise,
of the installed partition (of ubuntu or debian), the folder within the ESP get not removed.
So tidy up ESP means: manually removing un-used efi-sub-folders of those uninstalled OS's.
So.. I saw them in /boot/efi/EFI/ and got rid of the folders there, however they still show up in the UEFI BIOS menu.


Now.. to remove them the above is not what I keep finding when I google, rather:

To find the number of what you want to remove:

Code: Select all

efibootmgr
Then to remove:

Code: Select all

efibootmgr -b 000x -B
x can be any number, like 0000, 0001 etc, match with the one you want to remove.



Will this not work on MX, considering the different advice above?
MX-23.6_x64 July 31 2023 * 6.1.0-38amd64 ext4 Xfce 4.20.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.247.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030

User avatar
fehlix
Developer
Posts: 12877
Joined: Wed Apr 11, 2018 5:09 pm

Re: [SOLVED] Too many GRUBs / BootLoaders on Dual Boot

#27 Post by fehlix »

Eadwine Rose wrote: Fri Dec 13, 2019 3:50 pm To find the number of what you want to remove:

Code: Select all

efibootmgr
Then to remove:

Code: Select all

efibootmgr -b 000x -B
x can be any number, like 0000, 0001 etc, match with the one you want to remove.

Will this not work on MX, considering the different advice above?
Removing folders on the EFI System Partition will not automiticaly remove corresponding entries with NVRAM which are shown by running

Code: Select all

efibootmgr -v
Usage to delete

Code: Select all

efibootmgr --help
usage: efibootmgr [options]
	-b | --bootnum XXXX   modify BootXXXX (hex)
	-B | --delete-bootnum delete bootnum
With recent efibootmgr you can just write the number without the leading zeros,
e.g.:
efibootmgr -B -b 3
or
efibootmgr --delete-bootnum --bootnum 3

User avatar
Eadwine Rose
Administrator
Posts: 15152
Joined: Wed Jul 12, 2006 2:10 am

Re: [SOLVED] Too many GRUBs / BootLoaders on Dual Boot

#28 Post by Eadwine Rose »

OK so...

Code: Select all

root@eadwineMX19:/home/eadwine# efibootmgr -v
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0003,0004,0002,0000,0005
Boot0000* Windows Boot Manager	HD(1,GPT,d58b1603-0183-4ab9-a119-57f79716dbb8,0x800,0xfa000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...C................
Boot0001* MX19	HD(1,GPT,d58b1603-0183-4ab9-a119-57f79716dbb8,0x800,0xfa000)/File(\EFI\MX19\GRUBX64.EFI)
Boot0002* MX18.3	HD(1,GPT,d58b1603-0183-4ab9-a119-57f79716dbb8,0x800,0xfa000)/File(\EFI\MX18.3\GRUBX64.EFI)
Boot0003* antiX19	HD(1,GPT,d58b1603-0183-4ab9-a119-57f79716dbb8,0x800,0xfa000)/File(\EFI\ANTIX19\GRUBX64.EFI)
Boot0004* MX18.1	HD(1,GPT,d58b1603-0183-4ab9-a119-57f79716dbb8,0x800,0xfa000)/File(\EFI\MX18.1\GRUBX64.EFI)
Boot0005* UEFI: SanDisk Cruzer Glide 1.27, Partition 2	PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x0)/USB(6,0)/HD(2,MBR,0x6041d4,0x1d04000,0x18800)..BO

If I wanted to remove the antix and the 18.1 entry I do this:

Code: Select all

efibootmgr -B -b 3

and then this:

Code: Select all

efibootmgr -B -b 4
MX-23.6_x64 July 31 2023 * 6.1.0-38amd64 ext4 Xfce 4.20.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.247.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030

User avatar
fehlix
Developer
Posts: 12877
Joined: Wed Apr 11, 2018 5:09 pm

Re: [SOLVED] Too many GRUBs / BootLoaders on Dual Boot

#29 Post by fehlix »

OK, after having removed 3 and 4 you shall also better adjust the boot order
which is now this:
BootOrder: 0001,0003,0004,0002,0000,0005
taking out 3 and would be this:
BootOrder: 0001,0002,0000,0005

which you set with

Code: Select all

efibootmgr -o 1,2,0,5
or

Code: Select all

efibootmgr  --bootorder 1,2,0,5

User avatar
Eadwine Rose
Administrator
Posts: 15152
Joined: Wed Jul 12, 2006 2:10 am

Re: [SOLVED] Too many GRUBs / BootLoaders on Dual Boot

#30 Post by Eadwine Rose »

Code: Select all

root@eadwineMX19:/home/eadwine# efibootmgr -v
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0003,0004,0002,0000,0005
Boot0000* Windows Boot Manager	HD(1,GPT,d58b1603-0183-4ab9-a119-57f79716dbb8,0x800,0xfa000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...C................
Boot0001* MX19	HD(1,GPT,d58b1603-0183-4ab9-a119-57f79716dbb8,0x800,0xfa000)/File(\EFI\MX19\GRUBX64.EFI)
Boot0002* MX18.3	HD(1,GPT,d58b1603-0183-4ab9-a119-57f79716dbb8,0x800,0xfa000)/File(\EFI\MX18.3\GRUBX64.EFI)
Boot0003* antiX19	HD(1,GPT,d58b1603-0183-4ab9-a119-57f79716dbb8,0x800,0xfa000)/File(\EFI\ANTIX19\GRUBX64.EFI)
Boot0004* MX18.1	HD(1,GPT,d58b1603-0183-4ab9-a119-57f79716dbb8,0x800,0xfa000)/File(\EFI\MX18.1\GRUBX64.EFI)
Boot0005* UEFI: SanDisk Cruzer Glide 1.27, Partition 2	PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x0)/USB(6,0)/HD(2,MBR,0x6041d4,0x1d04000,0x18800)..BO
root@eadwineMX19:/home/eadwine# efibootmgr -B -b 3
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0004,0002,0000,0005
Boot0000* Windows Boot Manager
Boot0001* MX19
Boot0002* MX18.3
Boot0004* MX18.1
Boot0005* UEFI: SanDisk Cruzer Glide 1.27, Partition 2
root@eadwineMX19:/home/eadwine# efibootmgr -B -b 4
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0002,0000,0005
Boot0000* Windows Boot Manager
Boot0001* MX19
Boot0002* MX18.3
Boot0005* UEFI: SanDisk Cruzer Glide 1.27, Partition 2
root@eadwineMX19:/home/eadwine# efibootmgr -o 1,2,0,5
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0002,0000,0005
Boot0000* Windows Boot Manager
Boot0001* MX19
Boot0002* MX18.3
Boot0005* UEFI: SanDisk Cruzer Glide 1.27, Partition 2
root@eadwineMX19:/home/eadwine# 
That should do it then :) Lessee and reboot. ;)
MX-23.6_x64 July 31 2023 * 6.1.0-38amd64 ext4 Xfce 4.20.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.247.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030

Post Reply

Return to “Installation”