Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a Gigabyte Z77X-D3H and a while back installed Ubuntu 12.10 on my system. Today I decided to switch back to Windows and formatted the disk for the new install.

While I am not asked which operating system I want to boot at startup, there still is a lingering reference to ubuntu when I try to do a 'Boot Override', among other options such as the CD-drive or a USB device.

When I do a 'bcdedit' on my new Windows 7 installation, it only shows the Windows Boot Manager and installation:

Windows-opstartbeheer
---------------------
id                      {bootmgr}
device                  partition=\Device\HarddiskVolume1
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  nl-NL
inherit                 {globalsettings}
default                 {current}
resumeobject            {249db4c9-a44c-11e2-801d-bd1545a63e32}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

Windows-opstartlaadprogramma
----------------------------
id                      {current}
device                  partition=C:
path                    \Windows\system32\winload.efi
description             Windows 7
locale                  nl-NL
inherit                 {bootloadersettings}
recoverysequence        {249db4cb-a44c-11e2-801d-bd1545a63e32}
recoveryenabled         Yes
osdevice                partition=C:
systemroot              \Windows
resumeobject            {249db4c9-a44c-11e2-801d-bd1545a63e32}
nx                      OptIn

This is what my partitions look like (C:\, Ok, Startup, Swapfile, Crashdump, primary, D:\ Ok, primary, F:\ (external), Ok, primary):

Partitions

Is there any way to get rid of the Ubuntu boot option in the BIOS?

share|improve this question
    
You clearly didn't format the entire hdd otherwise this didn't happen. Post a screenshot of your partition information. –  Ramhound Apr 13 '13 at 23:34
    
Thanks for the fast response! I have included a screenshot of my partitions. –  Laurens Apr 14 '13 at 10:43
    
The problem described can happen even after completely wiping the hard disk, although this depends on the EFI implementation. See my full answer for details. –  Rod Smith Apr 14 '13 at 16:43
add comment

1 Answer 1

up vote 3 down vote accepted

Chances are this problem has nothing to do with what's on the hard disk, although it might. Try this:

  1. Boot System Rescue CD or the Ubuntu installer in its "try before installing" mode. Be sure to boot in EFI mode.
  2. Type sudo modprobe efivars in a Terminal window. (You can omit the sudo part if you use System Rescue CD.)
  3. Type sudo efibootmgr -v to see your boot options. One of these options should include a reference to ubuntu, and probably to the grubx64.efi file. Take note of the boot number at the start of the line. For instance, it might be Boot0004.
  4. Type sudo efibootmgr -B -b 0004, changing 0004 to whatever the boot number is, as you discovered it in the previous step.

When you reboot, the Ubuntu reference should disappear. Some EFIs will remove references to boot loaders that have been deleted from the hard disk, so another approach is to delete the boot loader file from the EFI System Partition (ESP). Your screen shot is illegibly small, so I can't tell which it is, but you can probably mount the ESP in Windows by typing mountvol S: /S in an Administrator command prompt window. You can then change to S: and remove the S:\EFI\ubuntu directory tree.

Note that some EFIs seem to be buggy and hang onto EFI boot manager entries even after you delete the files and remove the entries with efibootmgr or similar tools. The only way I've found to cope with this is to delete all the entries and then add back the one(s) that you actually want to keep. It's simpler and safer to just ignore the unwanted entries in this case, since the tools to manipulate the EFI boot loader entries are still primitive command-line utilities that can easily provoke user errors.

share|improve this answer
    
Hello Rod, today I was able to boot into Ubuntu and with your instructions I was able to remove the reference to Ubuntu as a boot option, thanks! –  Laurens Apr 16 '13 at 17:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.