Can't get rid of grub and ubuntu options in BIOS

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
User avatar
8isyellow
Level 1
Level 1
Posts: 34
Joined: Tue Oct 15, 2019 4:34 pm

Can't get rid of grub and ubuntu options in BIOS

Post by 8isyellow »

I used to boot Mint from a USB on my Windows laptop, but I royally screwed up Mint by altering the partitions, so I'm trying to get my laptop back to a clean slate. I've reformatted the USB, deleted the related partitions, expanded the Windows partition into the remaining free space, etc... but none of that has gotten rid of the options for "grub" and "ubuntu" in the BIOS boot configuration. I tried running all the various commands like "bootrec /fixmbr" to no avail, and my most recent attempt was to follow these instructions https://linuxbsdos.com/2015/09/05/how-t ... indows-10/. That didn't work either. I can deselect the options within BIOS, so my laptop does boot directly into Windows like I want, but the options are still there. I really don't want any traces left, because knowing my luck it'll somehow turn out to be a nightmare if/when I reinstall Mint. How do I get rid of these boot options for good?

User avatar
Kadaitcha Man
Level 7
Level 7
Posts: 1973
Joined: Mon Aug 27, 2012 10:17 pm

Re: Can't get rid of grub and ubuntu options in BIOS

Post by Kadaitcha Man »

8isyellow wrote:
Wed Apr 01, 2020 3:05 am
How do I get rid of these boot options for good?
Read the manual for your motherboard. You need to reset the BIOS.
It's pronounced kad-eye-cha, not kada-itcha.

User avatar
8isyellow
Level 1
Level 1
Posts: 34
Joined: Tue Oct 15, 2019 4:34 pm

Re: Can't get rid of grub and ubuntu options in BIOS

Post by 8isyellow »

The service documentation for my laptop doesn't seem to include a motherboard manual, or much information on it at all, but I followed the manual's direction's to reset the BIOS default settings. Sadly, the options are still there.

pbear
Level 14
Level 14
Posts: 5206
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Can't get rid of grub and ubuntu options in BIOS

Post by pbear »

This is UEFI, right? The problem isn't the firmware. It's the NVRAM store. Installing to USB drive causes this problem because of a bug in the installer. Fortunately, I've never had to deal with it (saw an article before making the mistake), but have seen several threads where it was nearly intractable. If you've tried all the regular methods, probably time to escalate.

This article has a method which, though complex, has worked for others. Boot using recovery USB. Select Repair your computer, then Command Prompt. Run diskpart, then sel disk 0 and list vol. EFI will have a volume ID, say 99. Assign a drive designation, sel vol 99, assign letter=z, then exit. To fix boot record, type z: (note colon), then cd EFI/Microsoft/Boot and bootrec /FixBoot. Finally, recreate BCD store: ren BCD BCD.old then bcdboot c:\Windows /l en-us /s z: All. If doesn’t work, try ren BCD BCD.old then bootrec /RebuildBcd. Exit command prompt and shut down.

Worked here, but he had to do it a few times before it stuck.

User avatar
Kadaitcha Man
Level 7
Level 7
Posts: 1973
Joined: Mon Aug 27, 2012 10:17 pm

Re: Can't get rid of grub and ubuntu options in BIOS

Post by Kadaitcha Man »

8isyellow wrote:
Wed Apr 01, 2020 3:22 pm
Sadly, the options are still there.
Ok, sorry about that. It looks like pbear's solution might do the trick but it looks complex.
It's pronounced kad-eye-cha, not kada-itcha.

fabien85
Level 7
Level 7
Posts: 1761
Joined: Tue Mar 11, 2014 4:30 pm

Re: Can't get rid of grub and ubuntu options in BIOS

Post by fabien85 »

If I understand well and unless the firmware is buggy, there is a simpler solution : efibootmgr
This is the Linux utility to manage boot entries in the NVRAM.
Boot any Linux in UEFI mode, then you can see your current boot entries with

Code: Select all

sudo efibootmgr
and you can get more details with sudo efibootmgr --verbose (--verbose can be abbreviated to -v)
Then say you want to delete entry Boot0001, you can do it with (warning: do not apply this command blindly, you have to adapt the number to what you want, else you can delete the windows boot entry)

Code: Select all

sudo efibootmgr --boot-num 0001 --delete-bootnum
or more simply sudo efibootmgr -b 1 -B.
For more info on the command, see man efibootmgr

pbear
Level 14
Level 14
Posts: 5206
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Can't get rid of grub and ubuntu options in BIOS

Post by pbear »

fabien85 wrote:
Thu Apr 02, 2020 5:07 am
If I understand well and unless the firmware is buggy, there is a simpler solution : efibootmgr
Good idea. Certainly, worth a try.

8isyellow, start by posting the output of the second command fabien85 gave: sudo efibootmgr --verbose.

User avatar
8isyellow
Level 1
Level 1
Posts: 34
Joined: Tue Oct 15, 2019 4:34 pm

Re: Can't get rid of grub and ubuntu options in BIOS

Post by 8isyellow »

pbear wrote:
Thu Apr 02, 2020 11:48 am

8isyellow, start by posting the output of the second command fabien85 gave: sudo efibootmgr --verbose.
I wish I could, but I just tried creating a new bootable USB and it went right to the same initramfs prompt that I would get when I was trying to fix my previous Mint bootable in grub. Something about being "unable to mount".

EDIT: Found out that it's probably because I set up the bootable USB with persistence. Going to reformat the USB and try again, will update.

User avatar
8isyellow
Level 1
Level 1
Posts: 34
Joined: Tue Oct 15, 2019 4:34 pm

Re: Can't get rid of grub and ubuntu options in BIOS

Post by 8isyellow »

Finally got the live session going, here's the output of sudo efibootmgr --verbose

Code: Select all

BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0000,0003,0004,0002,0001
Boot0000* UEFI KBG40ZNS512G NVMe TOSHIBA 512GB 995PD2RXPQFN 1	PciRoot(0x0)/Pci(0x1d,0x4)/Pci(0x0,0x0)/NVMe(0x1,8C-E3-8E-04-00-27-2B-E9)/HD(1,GPT,dbf06d82-a1a3-4fe1-934a-c4bfde776103,0x800,0x177000)/File(\EFI\Boot\BootX64.efi)N.....YM....R,Y.
Boot0001* UEFI SanDisk Ultra Fit 4C530001040626111240	PciRoot(0x0)/Pci(0x14,0x0)/USB(12,0)/HD(1,MBR,0xb7d0a,0x800,0x728f800)/File(\EFI\Boot\BootX64.efi)N.....YM....R,Y.
Boot0002  ubuntu	HD(1,GPT,dbf06d82-a1a3-4fe1-934a-c4bfde776103,0x800,0x177000)/File(\EFI\ubuntu\shimx64.efi)
Boot0003* Windows Boot Manager	HD(1,GPT,dbf06d82-a1a3-4fe1-934a-c4bfde776103,0x800,0x177000)/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.}...H................
Boot0004  grub	HD(1,GPT,dbf06d82-a1a3-4fe1-934a-c4bfde776103,0x800,0x177000)/File(\EFI\grub\shimx64.efi)

pbear
Level 14
Level 14
Posts: 5206
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Can't get rid of grub and ubuntu options in BIOS

Post by pbear »

Well done. Looks to me like it's 0002 and 0004 you want to delete, but I'd like to hear from fabien85. I'm only just learning efibootmgr. This isn't an emergency, right? You're still able to boot into Windows the circuitous way, I hope.

Will get them off your boot menu, but not confident it solves the Windows problem. That, I think, is buried in the inscrutable codes of 0003.

By the way, I'm guessing you burned the live USB with Rufus? The persistence option doesn't work with Ubuntu 18.04, and hence not LM19 either. Supposed to work with Ubuntu 20.04 and LM20. In the meantime, if you want persistence, use PenDrive's UUI. Limited to 4 GB persistence, but that's plenty for settings, wifi connection and such.

User avatar
8isyellow
Level 1
Level 1
Posts: 34
Joined: Tue Oct 15, 2019 4:34 pm

Re: Can't get rid of grub and ubuntu options in BIOS

Post by 8isyellow »

pbear wrote:
Fri Apr 03, 2020 9:00 pm
You're still able to boot into Windows the circuitous way, I hope.
Thankfully, booting into Windows is no problem- I'd be really frustrated then lol

pbear wrote:
Fri Apr 03, 2020 9:00 pm
By the way, I'm guessing you burned the live USB with Rufus? The persistence option doesn't work with Ubuntu 18.04, and hence not LM19 either. Supposed to work with Ubuntu 20.04 and LM20. In the meantime, if you want persistence, use PenDrive's UUI. Limited to 4 GB persistence, but that's plenty for settings, wifi connection and such.
Thats exactly what I did, thank you for the tip!

fabien85
Level 7
Level 7
Posts: 1761
Joined: Tue Mar 11, 2014 4:30 pm

Re: Can't get rid of grub and ubuntu options in BIOS

Post by fabien85 »

Indeed it's the entries 2 and 4 that you want to delete, you can do that with

Code: Select all

sudo efibootmgr -b 2 -B
sudo efibootmgr -b 4 -B
and you can check afterwards by redoing

Code: Select all

sudo efibootmgr -v
I did not catch what was the problem with windows.
What I can see is that the Windows Boot Manager (entry 3) is second in the boot order. Entry 0 (which is first in the order) points to the fallback bootloader location, so it could be anything really there : a copy of shim or grub if you used boot-repair, a copy of the windows boot manager if you used some windows repair utility (I dont know, I dont use windows), a copy of the Linux failsafe UEFI utility fbx64.efi, something left on purpose by the manufacturer of the machine...
If your computer boots straight to windows, then it's perfect, nothing to do.
If you have a good reason to want the windows boot manager first in the boot order, you should be able to do this from the firmware interface (/BIOS). Alternatively you can also do it with efibootmgr too. The current order is 0,3,4,2,1. Say you have already gotten rid of entries 2 & 4 and you want the order to become 3,0,1 (or even just 3,0 ; entry 1 is for the live USB and it's an entry automatically created by the firmware when it detected that a bootable USB was plugged in. The entry should disappear next time you boot without the USB plugged in), then do

Code: Select all

sudo efibootmgr --bootorder 0003,0000,0001
or more compactly sudo efibootmgr -o 3,0,1
(I'm always including the command in long format so that you can understand and check what you do. Once you have read the manual and become familiar with the command, it's faster to use the short format)

User avatar
Kadaitcha Man
Level 7
Level 7
Posts: 1973
Joined: Mon Aug 27, 2012 10:17 pm

Re: Can't get rid of grub and ubuntu options in BIOS

Post by Kadaitcha Man »

8isyellow wrote:
Sat Apr 04, 2020 12:33 am
pbear wrote:
Fri Apr 03, 2020 9:00 pm
You're still able to boot into Windows the circuitous way, I hope.
Thankfully, booting into Windows is no problem- I'd be really frustrated then lol
Check your motherboard manual. EFI BIOS usually have an option to delete unwanted entries.
It's pronounced kad-eye-cha, not kada-itcha.

pbear
Level 14
Level 14
Posts: 5206
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Can't get rid of grub and ubuntu options in BIOS

Post by pbear »

fabien85 wrote:
Sat Apr 04, 2020 5:33 am
I did not catch what was the problem with windows.
I've never really understood either what the installer bug does to the Windows boot loader, but I think it's deeper than superfluous entries and scrambled boot order. That said, obviously, the next step is to make the changes you suggest with efibootmgr. Reboot. If it works, hurray. If not, there's really no option besides bcdboot.exe, the solution I posted above, or full reinstall of Windows. Burn that bridge when we get to it.

FWIW, 8isyellow, I've been reading up on bcdboot.exe (and a related one, bcdedit.exe) Tired of having to regard them as black boxes. Might be able to help if the instructions above don't go through as written. Bear in mind, I got those from someone else. They do seem to be standard, though. Just massively non-intuitive for anyone who's not familiar. Like, say, 99.999% of all Windows users.


By the way, this problem is trivial in Linux. If the installer bug bollixes the boot loader, you reinstall it. Standard procedure, takes about a minute.

ETA: My understanding of the Windows utilities finally clicked. Not as difficult as the instructions relayed above suggest. Seems my source was copying someone who was copying someone else and no one went back to the source to see which parts were needed. Pretty sure your case will be simple.
Last edited by pbear on Sat Apr 04, 2020 5:01 pm, edited 2 times in total.

bmc
Level 1
Level 1
Posts: 11
Joined: Sat Apr 04, 2020 12:17 pm

Re: Can't get rid of grub and ubuntu options in BIOS

Post by bmc »

I had Mint installed on a separate SSD. Once I removed that I still had the GNU Grub loader. I followed the instructions in the following using a Win10 install disk.
https://www.howtogeek.com/141818/how-to ... -computer/

pbear
Level 14
Level 14
Posts: 5206
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Can't get rid of grub and ubuntu options in BIOS

Post by pbear »

Thanks, but that's a different problem. In the normal dual boot installation, the Windows boot loader is left alone.
With install to USB drive, there's a bug which messes it up.* That's what we're trying to undo here.

* There are workarounds, but that's a separate topic.

Welcome to the Forums!

pbear
Level 14
Level 14
Posts: 5206
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Can't get rid of grub and ubuntu options in BIOS

Post by pbear »

Rather than play tag, I'm going to post the next step if fabien85's fix to NVRAM doesn't solve the Windows problem. (I fully expect it to solve the how to get rid of ubuntu options aspect of the question.)

Based on my research, it turns out the simple Windows solution is the same as the simple Linux solution: reinstall the boot loader. It’s simple in most cases (if you don’t take into account how difficult it is to find the solution) because Windows saves a backup in the system folder. To install, right-click Start and select Power Shell (as Admin). Type bcdboot C:\Windows and Enter. This should reinstall the boot loader and place it first on NVRAM’s boot order. See BCDBoot Command-Line Options. Reboot and report back.

ETA: Noodling over this, figured out a way to test using VirtualBox. Putting aside nitty-gritty details, installed Windows in EFI mode and installed Mint to a USB flash drive, which blew up the Windows boot loader. Boot Windows from UEFI, get to Command Prompt, run bcdboot C:\Windows. Success.

As an aside, bcdboot didn't kick ubuntu out of NVRAM, only put Windows ahead of it on the list. To remove ubuntu, I rebooted the Mint live session and used efibootmgr as fabien85 suggested. Presumably can be done with bcdedit, but wasn't important enough to me to figure out how.

By the way, if for some reason this doesn’t work for you (I'll be surprised), there are other things to try.

User avatar
8isyellow
Level 1
Level 1
Posts: 34
Joined: Tue Oct 15, 2019 4:34 pm

Re: Can't get rid of grub and ubuntu options in BIOS

Post by 8isyellow »

Sorry for the late response, had a bit of a busy weekend. I did fabien85's fix and it worked perfectly- The boot options are gone, everything looks cleaned up in the BIOS, and my computer boots exactly like it should :D . Thank you!

@pbear Now that I've removed the options, and everything seems to boot OK, are you saying that there might still be underlying problems with the boot loader that just aren't apparent? Or did you just mean I'd have to fix the problem a different way if the boot loader still had problems even after getting rid of the superfluous options? (also, thank you for doing that research)

pbear
Level 14
Level 14
Posts: 5206
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Can't get rid of grub and ubuntu options in BIOS

Post by pbear »

There's no need to do anything unless you find the current arrangement inconvenient.

I'm expecting that you still have to use UEFI to access Windows boot. Is that correct? Or do you boot into Windows automatically now?

You're welcome about the research, but the issue has been on my round tuit list for a while. You just happened to be the person to have the problem (which has come up many times) when I had plenty of time to figure out the answer. More than a little surprised it turned out to be so simple. No one on the internet seems to have noticed.

ETA: So, I went back to the Win10 VM and tested again whether it would boot based just on the efibootmgr repair. (I have three snapshots, preserving each stage of the process.) I'm quite certain I tested that on Saturday and it didn't work, but I'll be darned, it seems to work now. Would be really interested to hear, then, whether you're booting directly into Windows now.

ETA2: Have done some more trials, both Windows and Mint. As far as I can tell, with Oracle's EFI at least, efibootmgr solves the problem by itself for Windows, but does not for Mint. Indeed, I can find no combination of steps that will make it work in Mint. Only reinstalling the boot loader does. And, while that's easy enough, it does have the unfortunate side effect of losing secure boot.

Still would appreciate confirmation (at your convenience) that you're booting directly into Windows.

User avatar
8isyellow
Level 1
Level 1
Posts: 34
Joined: Tue Oct 15, 2019 4:34 pm

Re: Can't get rid of grub and ubuntu options in BIOS

Post by 8isyellow »

pbear wrote:
Mon Apr 06, 2020 5:58 pm
Still would appreciate confirmation (at your convenience) that you're booting directly into Windows.

That's right, I'm booting directly into Windows now. For all appearances, things seem back to normal.

Post Reply

Return to “Installation & Boot”