How to get rid of grub and restore my windows back?

别等时光非礼了梦想. 提交于 2019-12-13 09:07:30

问题


I am dual booting my laptop with Windows 8.1 and Ubuntu, I wanted to remove Ubuntu so i have deleted those drives in disk management and also took recovery of windows on USB. As I restarted I got Minimal bash like line editing is supported and a prompt grub. I want my windows 8.1 back, can anyone please help me?


回答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)

  1. Run a cmd.exe process with administrator privileges
  2. Run diskpart
  3. Type: list disk then sel disk X where X is the drive your boot files reside on
  4. Type list vol to see all partitions (volumes) on the disk
  5. Select the EFI volume by typing: sel vol Y where Y is the SYSTEM volume (this is almost always the EFI partition)
  6. For convenience, assign a drive letter by typing: assign letter=Z: where Z is a free (unused) drive letter
  7. Type exit to leave disk part
  8. While still in the cmd prompt, type: Z: and hit enter, where Z was the drive letter you just created.
  9. Type dir to list directories on this mounted EFI partition
  10. If you are in the right place, you should see a directory called EFI
  11. Type cd EFI and then dir to list the child directories inside EFI
  12. 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.




回答2:


This is a dirty workaround to get the windows boot manager up and running over grub. Go to the start menu and run the command prompt as an administrator. Make sure the path is set to C:\Windows\System32. Then type bcdedit /enum all > %userprofile%/Desktop/bcdtxt.txt.

Now, go to your desktop and open the bcdtxt.txt file. Find the Windows Boot Manager UEFI firmware settings. Copy the identifier.

Now, go to the command prompt again. Type bcdedit /default {identifier}. Then, type bcdedit /timeout 0. You should have your windows boot without having the grub appear.

P.S. Note that the grub has not been removed from the bcd entries. If you want to remove the firmware settings associated with the ubuntu efi, get the respective identifiers. Go to the command prompt and type bcdedit /delete {identifier}. That should do.



来源:https://stackoverflow.com/questions/34639609/how-to-get-rid-of-grub-and-restore-my-windows-back

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!