I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.
How do I remove Ubuntu and reinstall Windows?
Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.
717 Answers
If you have a single-boot system with only Ubuntu installed, you can install Windows directly and override Ubuntu completely. To remove Ubuntu from a Ubuntu/Windows dual boot system, you will first need to replace the GRUB bootloader with the Windows bootloader. Then, you would need to remove the Ubuntu partitions.
The first step can be done with a Windows Recovery DVD/Installation DVD or a Ubuntu Live DVD. If you have a newer Dell laptop (such as the Dell Inspiron), you would need to do so by changing the boot sequence in the UEFI settings, which will be discussed later.
Using Windows Recovery or Installation Media
If you don't have a Windows recovery or installation media, you can download official ISO files for Windows 10, Windows 8, or Windows 7 from the Microsoft Download Center and burn them on a DVD or a USB drive. Windows will only install as an evaluation copy for 30 days without a genuine product key.
Grab a Windows recovery or installation media and boot from it. You should see this or a similar screen on a recovery media.
You should see this on an installation media. Click "Repair your computer" and you should see a screen like the first image.
Open the Command Prompt, then type
bootrec /fixmbrinto the Command Prompt.Reboot and boot into Windows. Then follow the steps below to remove the Ubuntu partitions.
Using a Ubuntu Live DVD and Boot Repair
If you don't have a Windows recovery CD or you are constrained to download and burn the ISO files mentioned before, you can use Boot-repair. It is a tool that fixes most boot problems(Windows or Ubuntu). I suggest using a Windows CD if possible.
Boot from a Ubuntu Live DVD or USB
Type these lines in the terminal one line at a time.
sudo add-apt-repository ppa:yannubuntu/boot-repair sudo apt-get update sudo apt-get install boot-repairSearch for Boot-Repair in the Dash and launch it.
To fix your computer with Boot-repair, simply click the "Recommended Repair" button. Then follow the steps below to remove the Ubuntu Partitions.
Changing the Boot Sequence in the UEFI settings of a Dell computer
Newer Dell laptops like the Dell Inspiron requires the bootloader order to be changed directly in the UEFI settings. This can be done with the following steps.
- Pressing F12 when the Dell logo appears.
- Go to
General→Boot Sequence. Under the Boot Sequence section, selectUbuntu, then clickDelete Boot Option. - Reboot your computer.
Deleting Ubuntu Partitions
After the previous steps, your computer should boot directly into Windows.
Go to Start, right click Computer, then select Manage. Then select Disk Management from the sidebar.
Right-click your Ubuntu partitions and select "Delete". Check before you delete!
Then, right-click the partition that is on the Left of the free space. Select "Extend Volume". Go through the Wizard and Finish it.
Done!
Note from Tanner: If you are using an extended partition, you might have to remove the big extended partition to make the space unallocated.
12- Boot a live CD/DVD/USB with Ubuntu
- Choose "Try Ubuntu"
- Download and install OS-Uninstaller.
Start the software and select what operating system you want to uninstall.
- Apply
- When all is over, reboot your computer, and voila, only Windows is on your computer or of course no OS!
First download bootsect.exe into the Download directory.
press the windows key, type cmd.exe and on the result (The command prompt) start it as an "Administrator" by right clicking on the cmd icon, and select Run as Administrator.
In the new cmd.exe window, cd to your download directory. for example cd C:\Users\Lalu Patel\Downloads. _assuming your user name is "Lalu Patel".
Then enter this command. bootsect.exe /nt60 ALL /force /mbr. Restart your system to see that, Windows is automatically loading without grub.
Then in Windows
- Open the Control Panel (All Items view), and click on the Administrative Tools icon. then close the Control Panel window
- Click on Computer Management in
Administrative Tools, then close the Administrative Tools window. - In the left pane under Storage, click on
Disk Management. see this. - Select the the partition with
unknowntype. it is the Ubuntu partition. Right Click -> Delete partition. - Now the former Ubuntu partition becomes an unallocated space.
- Select the left partition of the new
unallocated space. - Right click on the partition -> click on
Extend Volume. - Click on the Next button.
Type in how many MB (1 GB = 1024 MB) you want to use from the unallocated space to extend the selected partition (step 5) into, then click on the Next button.see this.
Note: If you want to use all of the unallocated space to extend into, then type in the maximum available space shown for the unallocated space.
Click on the Finish button. You're done.
Source: bootsect, disk management
8If you don't have a Windows CD and deleted the Ubuntu partition
Scenario:
You want to remove Ubuntu, and deleted the Ubuntu partition from within another OS. Now, your computer wont boot ("no such partition") and you lack a Windows Recovery CD to fix it.
- Create a Ubuntu LiveCD/USB.
- Boot from your Ubuntu LiveCD/USB by selecting it in the BIOS boot options.
Once Ubuntu loads, open a Terminal (Ctrl+Alt+T), and run these commands:
sudo apt-get install lilo sudo lilo -M /dev/sdaNote: you may have to replace
/dev/sdawith the main hard drive you installed Ubuntu and Windows to.- You can then reboot into Windows.
Actually the solution to this is very easy, anyone can do it. First things first. Download something called EasyBCD (there's a free version, you have to download it into Windows as it's a .exe) run through the set-up.
Launch EasyBCD and go to the sixth button down, EasyBCD deployment. Since you're a Windows XP user, select Write the Windows XP Bootloader to the MBR then press the big red button called "Write to MBR"
Next head up to the second button called "Edit boot Menu" and select the first option "Skip the boot menu" and click save settings. Congrats, you now have Windows XP bootloader back, and it will automatically boot into Windows, but we aren't done yet. You still have Ubuntu on your system, we want to change that.
Open up disk management and find your Ubuntu partition and the Ubuntu Swap Partition (I assume you know how big it is, [the swap is about two gigs, should be right next to the Linux partition]). Delete the swap first, and then delete the Ubuntu partition. If done properly you will get Unaccounted space for HD and the swap will become "Free Space" time to also fix that.
Next right click on the Free-Space partition (swap space) and delete it again, it should become part of the unaccounted space. Now you don't want to just leave all that empty space on your HD. Right click on your Windows partition now, and click extend the volume. It should default into the maximum size of your HD, (which you want so XP has all the space.) and click continue. There you go, it'll do it's thing and Windows XP should now have your entire HD, Ubuntu will be gone, and you Will have the XP bootloader back. Hope that helped for you!
(Video tutorial from Tech-Harvest doing basically the same thing but on Windows 7 - )
The way to "delete" Ubuntu is to delete the partition it's using. That will make the partition available for reformatting and use in another OS.
If you can still run Windows, use its disk manager to delete the Ubuntu partition. You could then format it to use in Windows, or expand an existing partition.
You can also boot the Ubuntu LiveCD and choose the "Try Ubuntu" option. After it loads, find and run gparted and remove the partition.
If Windows and Ubuntu are both gone and you want to reinstall Windows, you can repartition and reformat during the installation.
2You need to restore the MBR that was overwritten by grub when you installed ubuntu. In the old days, you ran fdisk /MBR on your system disk. The way to do it in Windows XP is to run the "Windows Recovery Console" which can be run from the installation disk or installed to the hard drive and run from there.
The instructions for installing the Recovery Console are here:
However, since you don't have the CD you'll need to try installing it from what you have already. Open up the run dialogue (win+r, or start->run) and enter this:
%windir%\i386\winnt32.exe /cmdconsThen you will have to reboot into windows and select the recovery console while it's booting. From there you will need to run FIXMBR which is documented here:
Once this is done successfully, your computer will boot straight into windows again.
1If you're into paid software I highly recommend Acronis. Paragon is also good. It has a lot of interesting options. It allows you to do everything you need to in order to do this. The order of operations is:
- Get live media that will let you perform all these operations without an OS or MBR backup. See acronis link.
- Delete the Ubuntu partitions (probably anything that's not NTFS or FAT32)
- Resize your windows partition to fill the disk
- Apply changes and possibly reboot depending on which version of which software you have
- Run the 'fix boot problems' wizard in Acronis. It's magic.
Alternately, you could use supergrubdisk. Directions on their wiki include screenshots and step by step directions.
1You can go into the Disk Management utility and delete the Ubuntu partition. Right click My Computer, select Manage, Disk Utility. Once you delete the partition, right click My Computer, select Properties and go to the Advanced tab. Go into the Start Up and Recovery, set Windows as the default operating system and set the Time to display the list of operating systems to 0 and click Ok.
1If you can boot Ubuntu the Live CD, choose "Try Ubuntu" option. Then try installing it again by choosing manual partitioning, It is the last option in the 'Prepare your disk' step. Reinstall it in the same partition you tried before.
First delete the old Ubuntu partition, (you can recognize the old Ubuntu partition by looking at the partition type column, it should have the type as
ext4orext3)Then create a new partition by clicking 'Add' button. In the new dialog change the "Do not use the partition" with
ext4, place a 'tick' mark at 'format' check box, and in the bottom select list, select/, then click OK.Check that, you choose the bootloader install device as
/dev/sda(if you are installing on the local hard disk). Then proceed.See if any error message appears. If it completes successfully, it should give you a message with two options - "Keep trying Live CD" and "Restart your Computer to use newly installed system". Restart your laptop.
I think it should work.
2A simpler method - Burn an rBoot CD and boot from it. When the menu shows up, select your Windows partition.
When Windows loads, in the disk management, right click on the boot partition and apply the boot flag. Restart.
Hopefully, this will work.
If it does, delete the Linux partition from the disk management. You're done.
From Windows 7, install easyBCD.exe (you can find it at )
Run it, and select RepairMBR
Then delete some partitions made by Ubuntu's system.
1Boot from a live Ubuntu media and wipe the partition table (and MBR) out with dd if=/dev/zero of=/dev/sdY bs=512 count=1 where Y is the drive. this will be /dev/sda in a single drive system. This command will blast the first sector of the drive full of zeros eliminating the partition table. Install the new OS you want to install as if the drive were new.
Note: you may have to increase the bs (block size) or count factors on a GPT disk. I haven't been able to find exact numbers but changing count to 8 or bs to 4096 should do the trick.
How to put Windows back on HDD Starting with Ubuntu only
The question sounds to me like there is no Windows on the OP's hard drive.
Most, if not all, of the above answers depend on Windows being installed.
Here are two methods of installing Windows starting with only a Ubuntu install or Live USB
Installing Windows using mkusb-plug
Install mkusb: Can I install mkusb in Ubuntu live USB? Works on internal Ubuntu drives and on Live Ubuntu USB's
Click mkusb-plug icon to start and then proceed as follows:
Step 1
Step 2
Step 3
[]4]
Step 4
Step 5
Step 6
Step 7
Step 8
You should now have a USB installer ready to infect your computer with Windows
Installing Windows 10 without USB using Ubuntu GRUB
Backup the Target drive.
Create a 6GB NTFS partition on the hard drive and extract the Windows ISO to it.
Create a 20GB, or larger, NTFS partition on the hard drive for the Windows Installation.
Open Disks, (Gnome-Disks), and note Device, (/dev/sdx), and UUID of the Windows ISO extract partition.
For msdos partition table, copy the following menuentry to
/etc/grub.d/40-custom/*:
menuentry 'Windows Recovery Environment (on /dev/sda4)' --class windows --class os $menuentry_id_option 'osprober-chain-592C85254E2CD0B7' { insmod part_msdos insmod ntfs set root='hd0,msdos4' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4 592C85254E2CD0B7 else search --no-floppy --fs-uuid --set=root 592C85254E2CD0B7 fi parttool ${root} hidden- drivemap -s (hd0) ${root} chainloader +1 ntldr /bootmgr
}Edit menuentry, changing
sda4 to sdax,msdos4tomsdosx(4 places), and 592C85254E2CD0B7 to UUID, (3 places), to suit step 4 above.Run
sudo update grubconfirm thatntldr /bootmgrappears in grub.cfg.Boot the computer into the newly created Windows menuentry and install Windows into it's new partition.
Reinstall Ubuntu if desired, the GRUB bootloader will have been replaced with the Windows bootloader.
*For gpt partition table, copy the following menuentry to /etc/grub.d/40-custom/:
menuentry 'Windows Recovery Environment (on /dev/sdc1)' --class windows --class os $menuentry_id_option 'osprober-chain-5642BC722509341F' { insmod part_gpt insmod ntfs set root='hd0,gpt1' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 5642BC722509341F else search --no-floppy --fs-uuid --set=root 5642BC722509341F fi drivemap -s (hd0) ${root} chainloader +1 ntldr /bootmgr
}This method can also be adjusted to make a Windows installer USB or to add a Windows installer to a multiboot USB.
Limitations
Windows 10 has limitations with respect to partition tables and boot modes.
I was able to install Legacy mode Windows to a drive with a MSDOS partition table.
I was able to install UEFI mode Windows to a drive with a GPT partition table.
I was not able to install Legacy mode Windows to a drive with a GPT partition table.
I was not able to install UEFI mode Windows to a drive with a GPT partition table and Legacy mode Ubuntu.
There may be workarounds that are outside the scope of this answer.
- Start with a working live CD/USB of Ubuntu and choose "Try Ubuntu"
- Check that it has a working Internet connection
- Run GParted and delete all partitions found. Re-run GParted to check that it's ok.
Open terminal (Ctrl+Alt+T) and type:
sudo apt-get update sudo apt-get install mbr sudo install-mbr /dev/sda- Reboot and install Windows normally from original installation CD/DVD
The most simple solution:
Boot into Windows Installation USB/DVD, go to "Install Windows" step, it will show you that Windows can't be installed on this partition. Press SHIFT+F10, which will bring up the command prompt. Type:
diskpart
list disk
select disk 0 (or the disk you want to convert)
clean
convert gpt
exitAfter that, click refresh button and you will be able to install Windows 7/8/8.1/10 and Ubuntu partition will be formated.
Video example: Click here
I had deleted the Linux Partition through disk manager and then my computer would keep starting in the Grub terminal. To get rid of that, I had to do the following in an advanced command prompt:
Diskpart
List disk (Note which disk is your System drive number. Mine was 2)
Sel disk 2
List vol (Note which volume is the EFI partition mine is 4)
Sel vol 4
assign letter=V: (or any other unassigned letter)
ExitThen navigate into that directory:
V:
cd EFI
dir (to see what is in there. I had neon and ubuntu in the list)
rmdir /S ubuntu
rmdir /S neon And restart! Make note of whatever other directory in there that might be linux related and delete them. I initially didn't know neon was a Linux Flavour (I received my husband's old laptop, I didn't install these) and that caused further headaches as my computer kept restart in the grub terminal.
0