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).
Launch a shell and change to the ESP.
Type sudo rm -rf EFI/ubuntu. (You can omit sudo on some systems.)
If you ever used Boot Repair on the disk, undo its damage:
Change to EFI/Microsoft/Boot on the ESP.
Move bootmgfw.efi.bkp to bootmgfw.efi, overwriting the existing file.
Change to EFI/BOOT on the ESP.
Move bootx64.efi.bkp to bootx64.efi, overwriting the existing file.
Launch GParted, parted, gdisk, or cgdisk on the disk.
Delete the Linux partition(s).
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.
Reboot into Windows to test that it still works. This will probably also clear out the EFI's NVRAM entries for Ubuntu.
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.
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.
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.)
Simply use this tool from a live disc: OS-Uninstaller
I recommend the following:
/dev/sda1
. It's always a FAT32 partition that has its "boot flag" set (inparted
terminology) or a partition type code of EF00 (ingdisk
terminology).sudo rm -rf EFI/ubuntu
. (You can omitsudo
on some systems.)EFI/Microsoft/Boot
on the ESP.bootmgfw.efi.bkp
tobootmgfw.efi
, overwriting the existing file.EFI/BOOT
on the ESP.bootx64.efi.bkp
tobootx64.efi
, overwriting the existing file.parted
,gdisk
, orcgdisk
on the disk.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.
here is a better way if under windows 8.
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.
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.
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:
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.)