Ubuntu – How to remove grub without access to Windows

bootgrub2

I have been dual booting Windows 8.1 and Ubuntu 13.10 on my Surface Pro 2.
But as the drivers on Ubuntu aren't that great for the surface, I decided to remove Ubuntu.

However they way I removed Ubuntu was to delete the partition from Windows and then expand the Windows partition to use all the storage.

When I restarted the computer it booted straight into a grub console (Minimal BASH-like) grub>

The problem is now I want to boot Windows 8 as that's the only operating system on the device right now. How can I do that ?

I have successfully booted a Ubuntu Live USB from that menu. I did that because I wanted to run boot-repair or lilo from within the live environment to be able to remove grub and get the MBR back. However none of that worked.

I now feel a little stock, and I'm out of ideas on what to do next.
Can I reinstall grub somehow so I can boot windows?

Ps

  • I don't think I can boot a windows recovery media as I'm not able to get anywhere else but to this grub menu. That means, no BIOS/EFI menus are accessible.

  • I can't resize the windows partition from Ubuntu as it keeps saying something about Windows is in hibernate mode, and therefore the partition can only be mounted as read only..

The screen I see when I boot looks like this:

enter image description here

Best Answer

I have Surface Pro 1 with Windows 8.1. I resized the Windows partition and installed Ubuntu 13.10, but, like the person who posted the question (Steffen Christensen) I found the driver support very bad and WiFi always freeze my tablet .

So, I just formatted the Ubuntu partition, and could not remove Grub 2 boot loader. I did some research online and made this solution myself and fixed my tablet with it, and it is working great:

When tablet is powered off, put the Windows 8.1 Recovery USB drive in the USB port, hold down volume down and power for some seconds till it powers on. You'll see the Surface logo. It will take few minutes till the bios / UEFI menu starts.

Choose language and keyboard as English. Go to Troubleshoot->Advanced Options->Command Prompt. Enter these commands:

diskpart
list disk      

(If you have more than one physical disk, choose the disk with Windows installation on it. In my case, only one disk was in the list: disk 0.)

select disk 0
list partition
select partition  x    

(Where x is the number of the partition listed by the list partition command. You must choose the partition with type marked as the System ( EFI partition ), which in my case was number 2.)

assign letter=u   

(U is the drive letter you wish to assign to the EFI partition.)

exit              

(This will exit the diskpart command. You will still be on the command prompt window.)

u:                

(Take you to the U: drive.)

dir

(Shows list of directories in drive U: - you must see a directory named efi.)

cd efi
dir       

(Shows list of directories in folder efi - you must see a directory named ubuntu.) Now we must delete GRUB in its official/proper location EFI/ubuntu/grubx64.efi for Ubuntu. If Secure Boot was active, deleting EFI/ubuntu/shimx64.efi would be necessary instead. In fact, deleting the whole EFI/ubuntu directory, or at least renaming it, would do the job in any case. We will delete the entire directory:

rd /s /q  u:\efi\ubuntu    
cd c:\windows\system32
Bootrec/fixmbr 
Bootrec/fixboot 
exit

Done. Now the command prompt window is closed. Now choose 'Turn off your PC' and then restart. It should be back normal.

Related Question