Uninstall GRUB and use Windows bootloader
Solution 1
This answer is for those with UEFI who have deleted the Ubuntu partitions before removing grub
You will be doing this from Windows 10. No bootable media required.
Where bootrec /fixmbr
, bootsect /nt60
and the Ubuntu live with the boot-repair
suggestions have failed, this has worked for me:
(This answer borrowed verbatim from here)
- Run a
cmd.exe
process with administrator privileges - Run
diskpart
- Type:
list disk
thensel disk X
where X is the drive your boot files reside on - Type
list vol
to see all partitions (volumes) on the disk (the EFI volume will be formatted in FAT, others will be NTFS) - Select the EFI volume by typing:
sel vol Y
where Y is theSYSTEM
volume (this is almost always the EFI partition) - For convenience, assign a drive letter by typing:
assign letter=Z:
where Z is a free (unused) drive letter - Type
exit
to leave disk part - While still in the
cmd
prompt, type:Z:
and hit enter, where Z was the drive letter you just created. - Type
dir
to list directories on this mounted EFI partition - If you are in the right place, you should see a directory called
EFI
- Type
cd EFI
and thendir
to list the child directories insideEFI
- Type
rmdir /S ubuntu
to delete the ubuntu boot directory
Assuming you only ever had two operating systems (Win 10 & Ubuntu) you should now be able to boot directly to Windows without hitting the black grub screen.
Solution 2
To restore Win 10 default bootloader follow these steps:
- Log into Win 10
- Open Command Prompt (Admin)
c:\> bootsect /nt60 <drive name>: /mbr
<drive name>
is the drive letter where the Master Boot Record (MBR) will be updated
For example to update C master boot record this is the command:
c:\> bootsect /nt60 c: /mbr
For more help about bootsect command see here - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/bootsect-command-line-options
Solution 3
You can restore the Windows bootloader with a Windows 8/8.1 DVD. These instructions are inspired by Manindra Mehra's answer, but I expanded it with full working details (verified with a Windows 8.1 DVD).
Put the DVD in your optical drive and boot from it.
Press a key when it displays
Press any key to start from CD or DVD
.Select your language etc. and click
Next
.Click
Repair your computer
.Click
Troubleshoot
.Click
Advanced Options
.Click
Command Prompt
.In the command prompt window, type
bootrec /fixmbr
Click the red
X
to close the command prompt.Click
Turn off your PC
.Turn the PC back on and it should boot directly into Windows.
This leaves the Ubuntu partition on your hard drive or SSD. To remove it:
Hit
Windows
+X
and selectDisk Management
.Find the Ubuntu partition. It will probably be a large partition without a drive letter.
Be sure you have the correct partition!
Right-click the partition and delete or reformat it with a Windows filesystem.
Solution 4
Remove Boot Loader EFI / System Partion in Windows 10
Quick Guide
Open PowerShell as Administrator
mountvol S: /S
S:
cd .\EFI\
dir
rd /S Ubuntu
Details
Administrator PowerShell
Enter powershell into the windows search of the start menu. Look for a blue icon with the label "Windows PowerShell", right click on the that and select "Run as Administrator" within the context menu.
Mount EFI/System Partition As Volume
To Mount the EFI System Partition on the given drive use the mountvol command by using the /S parameter. You can chose any free drive letter you want. For example "S".
mountvol S: /S
Access Mounted Volume
Now the partition is mounted. We can access the mounted volume by changing to the drive by the cd command and the drive letter S: as parameter
cd S:
To ensure we are at the root of this volume we should execute:
cd\
Type via the dir command to list the entries of the current path to ensure you on the right one.
dir
It should look like this:
Directory: S:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2019-01-17 12:55 EFI
-a---- 2018-10-16 10:57 31 startup.nsh
Delete Boot Loaders
Your boot loaders are location in the EFI directory. Change to it by using the cd command and list the entries via the dir command.
cd .\EFI\
dir
Your output depends on the boot loaders you have installed, here is a example with Windows and Ubuntu.
Directory: S:\EFI
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2018-12-06 06:55 Ubuntu
d----- 2018-12-05 05:21 Microsoft
d----- 2019-01-17 12:55 Boot
Now you can delete unwanted loaders via the command Remove-Item and the parameter -Recurse.
DO NOT DELETE THE BOOT DIRECTORY OR THE WINDOWS DIRECTORY!
Remove-Item -Recurse .\ubuntu
Solution 5
To do so you will need a windows installation cd/dvd
- put it in your optical drive and boot from it
- on the installation screen where it asks you to install windows, click on Repair Your Computer on the lower left corner of your screen
- Now go to command prompt (It probably will show a window saying "Trying to repair windows automatically", close it) and type
BootRec.exe /fixmbr
- after it finishes GRUB is gone and you can now boot into windows directly
- you have an Ubuntu partition left in your computer, that doesn't show in "My Computer", to access that, right click on "My Computer" and Select "Manage" and go to "Disk Management"
- Select the Ubuntu partition and format it to a file system that windows can use.
mrolive
Updated on September 18, 2022Comments
-
mrolive over 1 year
I have Windows 8 pre-installed, and then I installed GRUB with Ubuntu. Ubuntu is not my thing, so now I want to remove it along with GRUB. From what I have learned, with UEFI, GRUB does not overwrite the windows bootloader in the EFI partition and is stored elsewhere. How would I remove GRUB and make my PC use the Windows bootloader instead? It should be noted that I created a separate /boot partition when installing Ubuntu.
-
Ilja KO about 2 yearsSo for those who have dual boot windows and ubuntu on the same or different disks and don't want the grub loader to show up but default to windows bootup instead and keep ubunut as a second option to start from the UEFI by boot overloading, jsut change the boot order in your UEFI to have windows as first and ubuntu as second and this will do the trick
-
-
TheSchwa about 8 yearsWelcome to AskUbuntu! As it appears this was a copy paste, please consider linking to the original page at the end of your answer.
-
Pavel Niedoba over 7 yearsThis is by far best solution, one minute, no install disk, usb needed
-
flickerfly over 7 yearsThis was helpful in directing what I needed to do. I could delete the ubuntu partition in Windows using informaition from here: superuser.com/questions/662823/…
-
SeinopSys about 7 yearsSome CISCO Talos annoyware was preventing me from doing this from within my OS, but as of Windows 10 you no longer need an install disk to do this. I have just done this operation without one; all you need to do is log out so you're on the log in screen, then you start holding down Shift, and press the power icon in the bottom right, then click Restart, now let go of Shift. This will open the same menu as the repair disk. You just have to go to Troubleshoot > Advanced options > Command Line and run
bootsect /nt60 c: /mbr
. Grub will be gone in an instant. -
Efi Kaltirimidou about 7 yearsI preferred this solution because I did not want to create a bootable device and it worked perfectly
-
Yibo Yang almost 7 yearsFor completeness, also remove ubuntu from the efi boot menu. I think this should be added as step 7.
-
Chris Vilches almost 7 yearsPlease fix step 3 by explaining how to go to command prompt. Michael Geary's answer is more complete. This answer led me to reset my PC unnecessarily once because I didn't know how to go to command prompt.
-
Menasheh almost 7 yearsDoes not appear to work for me. Grub appears until I press exit. Updated NTFS filesystem bootcode. The update may be unreliable since the volume could not be locked during the update: Access is denied. \??\PhysicalDrive0 Bootcode is only updated on MBR partitioned disks. A different partitioning scheme is used on this disk. Bootcode was successfully updated on all targeted volumes. PS C:\WINDOWS\system32>
-
Admin almost 7 yearsWhat does the /mbr do? I looked for documentation on bootsect, and I couldn't find anything about /mbr.
-
kross almost 7 yearsrebooting after this caused me to recieve
Reboot and Select proper boot device
. -
kross almost 7 yearsI figured out there was a submenu under bios
Boot
menu that was still referencing the deletedubuntu
grub item. I set this toWindows
and it worked. -
wired00 over 6 yearsLegend. This worked perfectly for me with a Razer blade stealth windows 10 with Ubuntu. I wanted to perform a complete factory restore for selling the laptop but needed to rid it of the bootmenu + ubuntu. Thanks
-
stackOverlord over 6 yearswow everything was exactly where you said it would be!
-
Bram over 6 yearsThis worked for me, but I still have a question: does this actually remove grub or is in the background still something going on where grub hands things over to the windows boot loader?
-
armadadrive about 6 years@Bram I can't say for certain because I am just not knowledgeable enough, but I would hazard the guess that these steps actually delete the program files for Grub and therefore it would be "gone" gone.
-
David Faure about 6 years@PieTillIDie /mbr means Master Boot Record, surely this is about writing to the MBR, to overwrite what grub put there.
-
dev_nut about 6 yearsThis is the solution that works. MBR does not exist anymore because of GPT.
-
sonlexqt about 6 yearsThere's a video instructions here: youtube.com/watch?v=ZTMCKOx5Jz0 if you need it.
-
Salman Amintabar about 6 yearsIt's doesn't work for me 😐
-
Anton about 6 yearsbeautiful!! after hours of trying, the only thing that has worked for me!
-
Abdul Mohsin almost 6 yearsawesome. :) I wish I could upvote the answer multiple times :)
-
hsandt almost 6 yearsI really messed up my previous install attempts so I got a notification on rmdir: "The file or directory \EFI\ubuntu\fw is corrupt and unreadable. Please un the Chkdsk utility."
-
hsandt almost 6 years-> which I did, although I had to force dismount gulp. Removal worked, but I still see ubuntu in my boot menu.
-
petobens over 5 yearsHours of reading askubuntu and other stackexchange posts to finally hit this jackpot. Thanks a lot!
-
armadadrive over 5 yearsYou're welcome. I wish I could take credit for the answer, but alas I was just reposting steps that helped me. I'm glad it is working well for so many others!
-
Rigoxls over 5 yearsGreat Man, it works !!!
-
Fezzo about 5 yearsSpent hours trying to get rid of GRUB, and this worked. Thanks for the solution. I'm on a Surface Pro 3 as well, so this works on Surfaces. If you run the /dir command again, you'll see that the ubuntu folder is deleted, so it does remove it for good!
-
Force Hero about 5 yearsThis worked for me. I did this from a win 10 recovery USB. You start on X:\Windows\System32 I ran
cd /d c:
and thenbootsect /nt60 c: /mbr
I got one error about access denied and one success message. Unplugged the USB and rebooted and it worked! -
tomsihap about 5 yearsFor those having a scary "System BootOrder not found. Initializing defaults" error, which causes a reboot loop, I had to F2 and select "Windows Boot Manager". Everything else is working like a charm!
-
udippel about 5 yearsIt worked without hitch on my MBR-install. I was confused, though, with the command line: c:\> further up is not what you enter. In my case it was some C:\windows32\something. The '>' is actually the last character of the command prompt. As user you start entering the command with the word 'bootsect'.
-
Sabrina almost 5 yearsI'm so happy I could cry
-
Sagnik almost 5 yearsThis advice still works! Thanks a lot.
-
Casperrw over 4 yearsFrom a live usb stick, starting with efibootmgr -v, then using -b 0002 -B worked for me after 'fixmbr' from windows didn't seem to work, and that solution seemed a lot easier than some of the other solutions.
-
alex over 4 years@ForceHero That does not work for me. It yields "The update may be unreliable since the volume could not be locked during the update - access denied".
-
Walter Schrabmair over 4 yearsGreat solution ! Thanks
-
devb over 4 yearsSo, I followed this perfectly, but upon restarting, my laptop was stuck in an infinite bootloop. I somehow managed to enter the BIOS and was able to select Windows. How do i prevent this from happening?
-
user1686 over 4 yearsIf all you want is to assign a drive letter for the EIF system partition, DISKPART is a bit unnecessarily complex – you can collapse steps 2–7 to a single
mountvol Z: /s
command. -
GMaster about 4 yearsFor people wondering where to find this, go to your BIOS settings.
-
Jordan Rolph about 4 yearsThis was a perfect solution! Thank you lots and lots
-
hunzter about 4 yearsThis is the correct way to remove the boot entry
-
Faiz Hameed about 4 yearsHow to remove the assigned letter afterwards its showing in file explorer now
-
Bhavesh G about 4 yearsyou sir, are a genius!
-
yushulx almost 4 yearsOnly your answer worked for my case. Thanks!
-
NelsonGon almost 4 yearsLogged in to upvote this.
-
jerrymouse almost 4 yearsSolution to the error: The update may be unreliable since the volume could not be locked during the update: Access is denied. \??\PhysicalDrive0. 1. Reboot and press F12 to open your bios screen (It could be F8 or F2 depending on your model). 2. You should see Ubuntu Grub as the first bootloader and Windows as the second one. 3. Follow the instructions in your BIOS to change the order. This video might help - youtube.com/watch?v=46OofQo1W_4
-
RohitS almost 4 yearsAwesome and Thanks! :D
-
Chemist almost 4 yearsThis is confirmed to work with windows installation on mbr partition
-
KhoPhi almost 4 yearsNote from present self to future self: This is the ONLY solution that worked
-
BlueDev almost 4 yearsIn PowerShell instead of command 'rd /S ubuntu', I had to use 'Remove-Item ubuntu'.. Thanks for sharing this solution!
-
Ashu over 3 yearsnot working in my case. UEFI Dell XPS desktop
-
Ashu over 3 yearsworked for me - deleted the ubuntu directory recursively but PC is going into BIOS - if i ESC or come out of it - it is shutting down and not booting into Windows
-
pgalilea over 3 yearsAfter a lot of workarounds this finally worked!!
-
cloverink over 3 yearsthx you save my day
-
Seamus over 3 yearsThis is the correct answer for systems with EFI, especially if you installed linux on a separate drive which is the optimal way to go. Goodness, so many complicated answers out there and its really simple to do.
-
John Strood over 3 yearsEven though this is correct, this is not sufficient. The BIOS boot menu still has ubuntu in it. I removed it completely using
efibootmgr
application - askubuntu.com/a/923231/452738 -
Botond Balázs over 3 yearsThis is the perfect solution. I registered only to upvote it. Thank you!
-
armadadrive over 3 years@BotondBalázs Haha, thanks - but I can only take credit for reposting the steps I found in the linked article.
-
geras over 3 yearsDid you maybe mean to write
rd /s ubuntu
instead ofrd /S ubuntu
? There is no/S
option in the manual of rd and it didn't work for me. I usedRemove-Item ubuntu
instead, like @BlueDev did. -
geras over 3 yearsThere was still an "Ubuntu" entry left in the boot menu after I did this so I just deleted it.
-
Felix Quehl over 3 years@geras I changed the command. Thanks for the feedback.
-
drerD over 3 yearsgot a error "Virtual Disk Service error: Assigning or removing drive letters on the current boot or pagefile volume is not allowed."
-
Pakpoom Tiwakornkit over 3 yearsHow do I restore the deleted EFI/ubuntu folder after doing these esteps?
-
Bang Dao about 3 yearsI comment just to show how much I love you
-
rothermere about 3 years@geras There is still an Ubuntu entry left in the Boot menu. How did you delete that? The commands I executed:
mountvol S: /S
S:
cd .\EFI\
dir
Remove-Item -Recurse .\ubuntu
-
Felix Quehl about 3 yearsWhen you are sure that you are not having a typo in the folder name, you could try adding the
-Force
paramter to theRemove-Item
command:Remove-Item -Recursive -Force .\ubuntu
-
Tek about 3 yearsThis is mind-blowingly the easiest way to get rid of a boot entry. THANK YOU. Links are broken by the way.
-
oldfred about 3 yearsRemoved broken links, add suggestion for example in man page for efibootmgr. A few Manufacturers, do not recognized efibootmgr and then your only choice is to go into UEFI menu (not UEFI one time boot menu) and on boot tab edit entries.
-
Madhusudan chowdary over 2 yearsThanks , this worked for me
-
VijayRana over 2 yearsI just signed up to upvote this answer. Super helpful and works perfectly.
-
evening_g over 2 yearsI just wanted to add. If you don't want to see the volume after that, you can remove the letter in same diskpart. Select the volume and then just type
remove
-
H2-san over 2 yearsThis works extremely well for cleaning up after any EFI-capable distro (such as Ubuntu) on an active system and stopped tricking my UEFI system. Thank you so much - this MUST be accepted as the answer, @mrolive
-
Josh Zwiebel about 2 yearsthis works perfectly
-
ianaz about 2 yearsThanks! I can tell it works for Windows 11 as well
-
Admin almost 2 yearsthanks, this worked
-
Admin almost 2 yearsGreat Solution!