1

I have a Lenovo Ideapad Y510P. I recently removed Ubuntu 12.04 from it, and did a reset on the Windows 8 Partition. However, I still have the Ubuntu option in the firmware (not bios) boot menu, and I want to get rid of it.

The problems are (I looked this up ahead of time):

  1. In order to boot into the Ubuntu USB I have, I need to be in Legacy Mode.
  2. In order to run sudo efibootmgr in Ubuntu, I need to be in UEFI Mode. Right now, when I run it, I get the:

    couldn't open either sysfs or procfs directories for accessing EFI variables 
    

    error (I tried sudo modprobe efivars before it and after it and it looked like it did nothing).

  3. I can't be in both modes at once.
3

You can do this easily using Visual BCD Editor in Windows 7/8/10.

  • Map EFI System drive to Z: using

    mountvol z: /s

  • Run Visual BCD Editor and select "Store","Backup store".

  • a)Click on browse icon in dialog and using the explorer window select z: drive - now you have full access to EFI System Partition (ESP).

    b)Click on EFI folder to expand - you will see "Boot", "Microsoft" and "ubuntu" folders if you have Windows and Ubuntu installed.

    c) You can delete "ubuntu" directory by selecting it and pressing "Del" key.

  • In Visual BCD Editor click on loader entry "Ubuntu" to select it and then press "Del" key to delete.

After reboot Ubuntu boot option in UEFI boot menu will be completely gone.

Note:

You could alternatively use bcdedit.exe to delete EFI boot entry for Ubuntu and use command prompt to delete "ubuntu" folder from EFI System Partition (drive z:) if you feel more comfortable with commands.

  • Thanks for this. I had already deleted the entry in the partition, but it still showed in my system boot loader. SO i used Visual BCD editor and was able to remove the unneeded 'ubuntu' entry. – Roy Rico Jan 5 '17 at 3:42
  • Thank you for feedback. Always make a backup of current system BCD to be able to restore quickly. When importing BCD use switch /clean on UEFI firmware. – snayob Jan 8 '17 at 22:42
2

Try this:

  1. Download the USB flash drive or CD-R version of rEFInd.
  2. Prepare a medium with rEFInd, as per the instructions in the files you download.
  3. Boot the rEFInd medium you prepare.
  4. Use rEFInd to launch an EFI shell.
  5. Use the bcfg command in the EFI shell to review your boot options. (bcfg boot dump -v should do the trick.)
  6. Once you've identified your Ubuntu boot option, use the bcfg command to remove it, as in bcfg boot rm 3 if the Ubuntu entry is #3 in the list.

The bcfg command is described in more detail several places on the Internet, such as here. That particular page is mostly concerned with adding an entry, but it does cover some other commands.

Note also that you might not need rEFInd. Some EFIs include a built-in shell that you can launch in some other way, such as from the firmware's own built-in boot manager; or you can prepare a boot medium that launches an EFI shell directly. I recommended rEFInd simply because the rEFInd USB flash drive and CD-R images include a shell and a way to control that shell's launch. (Note that you will not get the shell if you install rEFInd to your hard disk, unless you install a shell separately.)

  • I am in Windows, now, and I used netbootin to put the usb img file onto a usb. However, I am not getting the option to boot from usb (in either uefi or legacy mode, the only two modes I have). How else should I go about installing this onto a usb in order to make it bootable? – Steve Dec 24 '13 at 23:32
  • This is great! However, for me, I had to remove the EFI/ubuntu folder on the EFI partition in addition to using bcfg boot rm – Nathan Oct 9 '14 at 0:38
2

If your System's EFI is equipped to do this, then you can actually resolve it without needing any kind of bootable media.

Firstly, some clarification: Your system does not have a BIOS. UEFI is a complete replacement for BIOS. The screen you enter when you hit DEL or ESC or F1 (or whatever your special key is) is called "system setup" or "system configuration" or "firmware configuration". Your system Does have a CSM or Compatibility Support Module more commonly referred to as Legacy Mode.

Lenovo makes some really feature-filled firmware. One of those features is that EFI boot options are stored within the firmware as they are installed. When you or your OEM installed Windows 8, the Windows installer told your UEFI where its boot files are stored and to create an entry pointing to it. When you installed Ubuntu, GRUB did the same thing. It communicated with the UEFI during installation and told it where its boot files were and to add an entry as well.

Now for the irony: Ubuntu, like most other OS's does not have an 'uninstaller'. The usual method of removing an OS is to delete its partition, or format it, or what have you. So when you delete or otherwise remove an OS the UEFI is never notified. It doesn't know that the OS is no longer there. If you boot with F12 or whatever your key is to select your boot device, it still presents you with it's pointer. So when you go and do a system reset ('refresh' works differently) with Windows 8, it literally reinstalls Windows 8 from the recovery partition. During this installation, the Windows installer probes the UEFI and asks it 'what other OS's are installed?' so that it can populate the Windows 8 bootloader with the other OS's. But as you've probably already guessed, your UEFI's list is incorrect.

So here's what you do: If you have this option in your system setup, you can navigate to the boot section and it should list all available boot devices including the EFI boot options. You should be able to select them and remove them. Fixing the Windows 8 boot list then is trivial. You can just do another reset. If you can't remove the boot options, you may have an option under 'Secure Boot' to reinstall security keys. If you select this option, you will need to reinstall windows again, but normally the UEFI will also delete the EFI boot list in the process. Try it and see what works for you.

1

The easiest way to remove "Ubuntu option" from boot menu of your laptop is from within Windows. Install EasyUEFI in Windows and you can remove/edit or change the order of all EFI partition entries.

-2

To manually open an efi partition from windows launch diskpart from the command line, then do the following;

  1. list volume
  2. select volume 5 (volume 5 is the efi partition in my case)
  3. assign

This will mount the EFI partition.Now we have to kill windows explorer and launch it (in admin mode in cmd) from a elevated platform for that

taskkill /im explorer.exe /f 

explorer.exe

now you can open the mounted volume 5 by simply double clicking on it.

  • Please don't use caps, in the Internet that's like shouting. No need to shout! – blade19899 Nov 4 '15 at 15:14
-2

For this you need to install ubuntu again.

  • After installing open terminal and login as root using command:

    sudo -i
    
  • Enter your password, then navigate to root/efi/EFI and delete all directories in it and finally delete the EFI folder and efi.

  • Now ubuntu will be removed from your boot menu.

  • Finally delete the ubuntu partitions from windows partition manager.

  • -1 This is dangerous advice. Deleting the EFI directory may brick the firmware of the main board. – David Foerster Jul 31 '16 at 9:39
  • Deleting /EFI on EFI System partition makes the system unbootable! "/EFI/boot" is where fallback boot loader/manager is placed. "/EFI/<company>/" (where company is for example Ubuntu or Microsoft) is where OS specific boot files are stored. – snayob Jan 8 '17 at 22:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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