You have been playing with Ubuntu on your Windows Machine and messed something up. To the point that it does not even boot correctly on start up. A fresh install can help if all else fails. This is how I went about it and thought it would be nice to share. For those who may have better solutions please leave them in the comments below.
Need to get access to the partition and recover files?
If you need to recover your files from your Ubuntu Partition here are 2 ways of doing this.
Ext2 Installable File System For Windows— This connects the Linux File System with Windows. You will be able to browse and use the partition with File Explorer
OR
Disk Internals Linux Reader — Is a separate File Manager that allows you to preview and move data from Linux OS via Windows.
Removing Ubuntu
- Clean out Ubuntu Partition for a fresh install
- Delete Ubuntu Boot Folder to avoid conflicts with the new install
Step 1: Clean out your Ubuntu Partition
Tools Used: Disk Management
To open Disk Management in Windows click Start and type:
Disk Management
You should see an application listed as: Create and format hard disk partitions
Click that application and you will be in Disk Management. It should look like this.
My Ubuntu Partition happens to be on Disk 1 (my HDD) so I will be deleting that space. To do this right click the partition and click Delete Volume
Now the volume is unallocated space which we will leave for the fresh install.
Step 2: Delete Ubuntu Boot Folder
Tools used: Command Prompt & DiskPart
This step is long so I will split it into parts. What we want to accomplish is to gain access to the boot folder to delete it. In Windows, I was able to accomplish this by assigning a letter to the drive that has the FAT32 file system (where boot folders are kept) and then accessing it via Command Prompt and DiskPart. Then finishing the process by removing the drive’s letter to return to it’s original state.
Part 1
We can find this folder using DiskPart on Command Prompt. However we need administrative access. First click Start and type:
command prompt
The desktop application should be available in the menu. Right click the app and select: Run as administrator
Next type diskpart and hit Enter:
diskpart
With DiskPart, we can now find the volume with the boot folder. Type list volume and hit Enter:
list volume
We are looking for the volume who’s file system is FAT32. Which in my case is Volume 3. The reason we use DiskPart is because Disk Management cannot see this detail.
Part 2
In order to access this volume we need to select the volume and assign a letter so we can see it in File Explorer. In DiskPart, type select volume 3 (whatever number is yours) and hit Enter.
select volume 3
Now type list volume and hit Enter:
list volume
As you can see the correct volume has an asterisk (*) next to it. Indicating that it is selected. Now we can assign a letter to it that is not already is being used by the Windows file system. Type assign letter G (or whatever letter that is available in your file system) and hit Enter:
assign letter G
Part 3
Now we have access to the volume. Which you can now see in File Explorer but not the contents inside. For that reason we need Command Prompt. I recommend opening a new Command Prompt window as Administrator.
To access the volume (in my case is letter G) type in G: (your assigned letter) and hit Enter:
G:
To see the contents of drive G: type dir and hit Enter:
dir
Now the folders inside drive G are listed. The Ubuntu Boot Folder is in EFI. To access it we need to change directories. Type cd EFI and hit Enter:
cd EFI
Now type dir and hit Enter again.
dir
We now have access to the Ubuntu folder. Next step is super important not to mess up so pay attention. What we want to do is delete the folder and all of the contents inside. So we are going to use the rmdir /S command to get this done. Please make sure you select the correct folder.
Type rmdir /S ubuntu and hit Enter:
rmdir /S ubuntu
If you type dir again and hit Enter you will see now the folder is removed from EFI. Now you can close that command prompt window and return to the other one that is still in DiskPart. If for some reason you closed it you can repeat the steps above in Part 2 to get back to where we left off.
Part 4
The final part is to remove the letter from the volume. In DiskPart you can type remove letter G (your assigned letter) and hit Enter:
remove letter G
Final thing to do is exit DiskPart. Type exit and hit Enter:
exit
And that is it! You can close the window and restart the Ubuntu installation process.
After this tutorial
Here is a guide for installing Ubuntu as a dual boot if you don’t already have one. However recommend looking online to see about installing the latest version to get the best instructions possible. Also google things to do after you install Ubuntu. Nice stuff there. Good luck with your dual-boot!
One last note!
I found that I had to start my Ubuntu in safe mode in order to get the drivers for my Nvidia GPU. Not having them resulted in having a black screen when booting.
Sources
- YouTube Video explaining how to remove Ubuntu with Disk Management (step 2)
- YouTube Video explaining how to use DISKPART to format hard drive and remove all partitions.
- How to use Microsoft DiskPart to display disk information
- 7 things you can do with the Disk Management tool, in Windows
- How to Browse Linux Partitions From Windows (And Vice Versa)
- Command Prompt: 11 basic commands you should know (cd, dir, mkdir, etc.)
- Microsoft DOS rd and rmdir command
