To help you (and perhaps others) avoid the problem in the future, you should first understand what happened. With that information in hand, you can recover your system and remove Ubuntu properly in the future (should the need arise again)....
What Happened?
Most Ubuntu installations, on both BIOS-based and EFI-based systems, split GRUB across two or more locations:
- The main GRUB binary -- This code is run by the firmware. Importantly, it does not reside in the Ubuntu root (
/
) or /boot
partition. On BIOS-based computers, it resides in the first few sectors of the hard disk (or if the disk uses GPT, in the first sector of the disk and in the BIOS Boot Partition). On EFI-based computers, it resides in the EFI System Partition (ESP). This means that the main GRUB binary will not be erased when you delete an Ubuntu partition, and the firmware will continue to boot it; however....
- GRUB support files -- In most cases, GRUB loads its configuration file and other support files from the Ubuntu
/boot/grub
directory. This directory is deleted when you delete an Ubuntu installation.
The result is that when you delete an Ubuntu partition, GRUB can launch, but it can't do anything, because it's been figuratively lobotomized.
That said, one thing about your story is puzzling: You say that you're no longer able to boot from a USB drive. An Ubuntu installer image is designed to be self-contained; it does not rely on the contents of your hard disk, and should not be affected by the state of GRUB (or anything else) on that disk. You must be running into some unrelated problem -- maybe some RAM has gone bad since you did your initial installation; or you're trying to boot a different version of Ubuntu that doesn't like your video card; or you prepared the USB drive incorrectly. These are just wild guesses, though; there are about a million possible reasons why a boot from a USB drive might fail. In any event, I recommend you try other Linux distributions or prepare your medium using another program to work around this problem. If necessary, post a new question with more details about that aspect of the problem if you can't get it to work.
How to Recover
Recovering your system involves installing a working boot loader on your computer. It sounds like yours is BIOS-based, so this means modifying the MBR. If you want to make your Windows bootable again, the best approach is probably to use a Windows recovery tool. There are Windows procedures for restoring an MBR, but I don't recall the details. A Google search turned up this tutorial, but there are 658,000 others in my search, so try your own search if that procedure doesn't work for you.
Another option is to re-install Ubuntu (or any other OS, really). As part of the OS installation process, a new boot loader will be installed. If you re-install Ubuntu, that boot loader will be GRUB, and the installer should detect Windows and make it an option in the GRUB menu.
One caveat is to watch your boot mode (BIOS vs. EFI); you don't want to mix them. It sounds like you've got a BIOS-mode Windows installation, so you do not want to install Ubuntu in EFI mode. If your computer is from before 2011, chances are this won't happen, since EFIs started to become common only in mid-to-late 2011. If you've got a more recent computer, though, you may need to be careful. After booting your installation medium but before installing, drop to a shell and look for a directory called /sys/firmware/efi
. If it's present, you've booted in EFI mode; if it's absent, you've booted in BIOS mode. If you've booted in the wrong mode, try again, but pay attention to boot menu options. Typically, external media have two options, one with the string "UEFI" and one without it. The one with the "UEFI" identifier boots in EFI mode and the one without boots in BIOS mode.
How to Not Do This Again
If you need to remove Ubuntu again on a BIOS-based computer, it's best to restore a non-Ubuntu boot loader to the MBR before you delete the Ubuntu partition(s). You can use a Windows recovery disc to do this, or there are ways to do this from Ubuntu, as described here (among other places).
On an EFI-based computer, you can use efibootmgr
to change the boot order before you delete the Ubuntu partition(s). Type sudo efibootmgr
alone to see the options, then identify the Windows (or other OS's) boot entry number from the list, and use the -o
option to set it first in the list, as in sudo efibootmgr -o 2,7
to boot Boot0002
first and to boot Boot0007
as a fallback. Another option is to delete the /boot/efi/EFI/ubuntu
directory from Ubuntu immediately before you wipe out the Ubuntu partition(s).
On either type of computer, another option is to set your boot loader up in a way that can survive the removal of Ubuntu. One way to do this is to use a separate Ubuntu /boot
partition, but to not delete it along with the main Ubuntu partition. Then GRUB will continue to operate, although it will present non-functional Ubuntu options and, in the absence of a Linux installation, it will be difficult to change its boot options. There are ways to set GRUB up on a FAT partition in an OS-independent way. The GRUB4DOS boot loader can be used on a BIOS-based computer, for instance. On an EFI-based system, alternatives like gummiboot or my own rEFInd don't rely on Ubuntu partitions, and can be used instead of or in addition to GRUB.
I have no problems booting from a USB in my bios screen. However; my machine never makes it past "Loading operating system". I know that my grub is dead, but it seems that it's also preventing me loading anything else from BIOS. Is my hard drive broken for good?
– Chris Jun 13 '15 at 03:47