Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to uninstall the Grub and restore the Windows 8 system with secure boot and UEFI?

share|improve this question
Well, "Secure Boot" is more like a "Restricted Boot", see this. I don't know why you'd want to restore a feature that threatens your freedom. – jmendeth Jan 11 '13 at 16:34
Also, this could (or not) be seen off-topic here. – jmendeth Jan 11 '13 at 16:34
@jmendeth Im trying to experiment a new way to install Linux with it. So i need to restore the original settings first. – THpubs Jan 11 '13 at 16:39
@jmendeth It's no prblem as Ubuntu has added support of Secure boot. I am using Ubuntu in secure boot now. – Kolappan Nathan Dec 31 '14 at 4:23

Simply use this tool from a live disc: OS-Uninstaller

enter image description here

share|improve this answer
Are you sure that this OS-Uninstaller will work in UEFI mode. – Kolappan Nathan Dec 31 '14 at 4:22
yes, as long as you use it in an UEFI-mode session. (if you are in a Legacy session but need an UEFI session, the tool will warn you anyway). – LovinBuntu Jan 1 '15 at 23:12
Thank you for the info. – Kolappan Nathan Jan 2 '15 at 7:27

I recommend the following:

  1. Boot from an emergency system (Ubuntu in "live CD" mode, PartedMagic, System Rescue CD, or whatever).
  2. Mount your EFI System Partition (ESP). This is often (but not always) /dev/sda1. It's always a FAT32 partition that has its "boot flag" set (in parted terminology) or a partition type code of EF00 (in gdisk terminology).
  3. Launch a shell and change to the ESP.
  4. Type sudo rm -rf EFI/ubuntu. (You can omit sudo on some systems.)
  5. If you ever used Boot Repair on the disk, undo its damage:
    1. Change to EFI/Microsoft/Boot on the ESP.
    2. Move bootmgfw.efi.bkp to bootmgfw.efi, overwriting the existing file.
    3. Change to EFI/BOOT on the ESP.
    4. Move bootx64.efi.bkp to bootx64.efi, overwriting the existing file.
  6. Launch GParted, parted, gdisk, or cgdisk on the disk.
  7. Delete the Linux partition(s).
  8. Optional: Resize the Windows partition(s) to fill the disk. It's probably best to skip this if you intend to do a fresh re-install of Ubuntu, since you'll just undo this change shortly.
  9. Reboot into Windows to test that it still works. This will probably also clear out the EFI's NVRAM entries for Ubuntu.
share|improve this answer

Insert windows repair disk to restore the startup (grub). In Administrative tools in windows, delete the ubuntu partition and extend the windows partition to take up all free space.

share|improve this answer
He was saying about removing GRUB even removing entire linux partition willn not help with it. – Kolappan Nathan Dec 31 '14 at 4:26

here is a better way if under windows 8.

  1. go to disk management by pressing WinKey + X
  2. then choose disk management
  3. delete the ubuntu drives(extended partitions) must be two. make sure you dont delete recovery disks.
  4. then extend your disk.
  5. reboot your computer with your OS DVD OR BOOTABLE USB. under win8 select keyboard then language.
  6. click next, then click on repair
  7. select second option then click next
  8. click cancel then select command
  9. type "bootsect /nt60 /mbr" then press enter. please note this is only under win8. reboot
  10. windows will attempt to repair wait or give it 4 min then reboot it. "simply press and hold power button untill system turns off.
  11. after 5 sec turn it again and you are good to go.

please note bootsec that is being mentioned over the internet works under windows 7 and other previous windows versions not win8.

please correct me if i m wrong.

share|improve this answer

After much stress, and looking everywhere for the answers I managed to do it manually. I removed Ubuntu and all the partitions I created for it. I booted into a Ubuntu Live-USB and opened the LSR partition created by windows which is filled with EFI files. I found and deleted all mentions of grub and a couple of other files and it removed grub from the startup. Hope that helps, it was more of a trial and error, there are a couple of files that don't belong which you need to delete and it will work fine.

share|improve this answer

You can just do it as you would if UEFI and "Secure Boot" were not involved, but re-enable "Secure Boot" in your firmware ("BIOS") before installing Windows. It might be even simpler though, depending on what you have set up right now and what you want to acccomplish.

Ubuntu supports (but does not require) "Secure Boot," so if you are dual-booting Ubuntu and Windows 8, you likely already have "Secure Boot" enabled, especially if it is the stock, OEM-provided Windows 8 installation. If that is the case, then there is no difference at all between the usual procedures for removing Ubuntu and making Windows bootable, and your situation.

If you just have Ubuntu installed now, and you want to remove Ubuntu, enable "Secure Boot," and just have Windows 8 installed (at least for the time being), then it is very simple. Just do one of the following:

  • Wipe your disk (for example, by running GParted from an Ubuntu live CD and telling it to create a new partition table), enable "Secure Boot," and install Windows 8. Or:
  • Skip wiping your disk, enable "Secure Boot," install Windows 8, and tell Windows 8's installer to wipe the disk (or delete all existing partitions). Windows installers have been capable of this for the last several Windows OSes.

If Windows 8 is already installed in a way that does not need "Secure Boot" (for example, a 32-bit Windows 8 installation), then probably it too will not work when Secure Boot is enabled. In that case, you would probably have to remove both Ubuntu and Windows 8, to enable "Secure Boot." So for that situation, you can just wipe your disk, enable "Secure Boot," and install Windows 8.

(Alternatively, if you wanted to try to make a non-"Secure Boot" Windows 8 installation work with "Secure Boot," or a "Secure Boot" Windows 8 installation work without it, you could ask about that somewhere Windows question that don't relate much to Ubuntu is supported. Super User is often good for that. But from your description, it doesn't seem like that's what you're trying to do.)

share|improve this answer

Your Answer


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.