This question already has an answer here:
I had installed windows 8 and ubuntu in my laptop. but after that by mistake i formatted the drive in which ubuntu was installed so now when ever i reboot my machine i get the error: unknown filesystem and grub rescue. I want to reinstall ubuntu again in the same drive but i am unable to install because of grub rescue. please suggest me solution to install ubuntu from grub rescue or to delete grub so that i can reinstall ubuntu in normal way. I am able to boot to windows if i keep the boot mode to UEFI.