1

So I had issues with Ubuntu and reinstalled it a few times. Now I have two Ubuntu options in the BIOS that I don't want because they aren't installed.

Now I would like to delete these options from the BIOS before I install Ubuntu cleanly.

My question is: How do I remove these options while using Ubuntu from a flash drive?

I tried sudo efibootmgr but that gives me the error EFI variables are not supported on this system.. Tried to find a solution on the internet but without any success.

Thanks for reading

  • 1
    boot/grub/grub.cfg says right at the top "DO NOT EDIT THIS FILE" Personally. I would delete the menuentries I do not want by hand. How dangerous will it be make a backup copy and If you are planning on reinstalling Ubuntu anyway? – C.S.Cameron Dec 02 '20 at 08:59
  • Where can I find a guide for editing this file? I don't know what to do there. –  Dec 02 '20 at 09:08
  • 1
    You need to boot your flash drive in efi-mode. Only then you'll be able to use efibootmgr. – mook765 Dec 02 '20 at 14:32

1 Answers1

0

Edit boot/grub/grub.cfg by Hand

  • Assuming that you have everything valuable backed up.

  • Boot Live USB.

  • Open Gnome-Disks.

  • Select the disk you want to modify on the left panel.

  • Select the partition with the filesystem on it on the right panel.

  • If there is a little triangle lower left click it. If there is a little square leave it.

  • Note the link in blue at the bottom of Disk's window.

  • Open Terminal and type sudo -H nautilus.

  • Navigate to the destination shown in the blue link: it should be similar to Filesystem root/media/ubuntu/xxxxxxxxxxxx

  • Open /boot/grub/grub.cfg

  • The menuentries you want to delete look similar to:

      menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-84562320-e49d-4d53-af05-793a1a8ac86c' {
          recordfail
          load_video
          gfxmode $linux_gfx_mode
          insmod gzio
          if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
          insmod part_gpt
          insmod ext2
          set root='hd0,gpt3'
          if [ x$feature_platform_search_hint = xy ]; then
            search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3  84562320-e49d-4d53-af05-793a1a8ac86c
          else
            search --no-floppy --fs-uuid --set=root 84562320-e49d-4d53-af05-793a1a8ac86c
          fi
          linux   /boot/vmlinuz-5.4.0-53-generic root=UUID=84562320-e49d-4d53-af05-793a1a8ac86c ro  quiet splash $vt_handoff
          initrd  /boot/initrd.img-5.4.0-53-generic
      }
    
  • Delete only the menuentry, do not leave any spaces between the line above and the line below it.

  • If you have any doubts or questions please ask before proceeding.

EDIT

After reading your first post here: Boot partition missing? Can't boot into Ubuntu anymore. Does it have to do with GRUB or Boot partition or similar?

It looks like you just need to Format your HDD and install Ubuntu in UEFI mode.

To ensure that you are installing in UEFI mode follow the instructions for Rufus in this post:

Unable to access Ubuntu from UEFI

C.S.Cameron
  • 19,519
  • Sounds like OP talks about efi-boot menu entries, not grub menu entries. – mook765 Dec 02 '20 at 12:28
  • @mook765 You may be right but he says "BIOS" and EFI variables are not supported on this system. Sounded like a GRUB thing to me but I am not confident about it. He posted another question here: https://askubuntu.com/questions/1296877/is-boot-grub-grub-cfg-used-to-edit-boot-options-i-would-like-to-remove-2-non-e – C.S.Cameron Dec 02 '20 at 13:21
  • OP reinstalled a few times and now obviously installed in legacy mode thus cannot use efibootmgr. In both question OP talks about boot options in the "BIOS", not boot options in the grub menu. I think solution for OP is to either instal again in EFI-mode or run a live session in efi-mode to be able to use efibootmgr. – mook765 Dec 02 '20 at 13:30
  • @@mook765 There is more to the story here, Looks like he is using a boot partition scheme that should boot either BIOS or UEFI, (like mkusb).: https://askubuntu.com/questions/1296817/boot-partition-missing-cant-boot-into-ubuntu-anymore-does-it-have-to-do-with – C.S.Cameron Dec 02 '20 at 13:42
  • All what OP writes in that question is pretty unclear. For me this looks like a normal install. I think OP reinstalled several times not taking care of the boot-mode. Now OP has grub in ESP and in bios_grub, one of them may be obsolete. – mook765 Dec 02 '20 at 14:06
  • @mook765 I edited the answer to suggest formatting the hard drive and reinstalling in UEFI mode. Thank you. – C.S.Cameron Dec 02 '20 at 14:09