1

I removed Ubuntu from partition and remove those partitions too after that whenever I start my window grub rescue screen pop up and not letting me enter in bios.

2 Answers 2

0

I'm guessing you're using UEFI boot with fast boot enabled, so there's no time to press the key that boots into setup.

Use the command fwsetup in the GRUB prompt. It should reboot the computer into setup. Then remove GRUB as a boot option.

Optionally you can remove GRUB from the EFI system partition, but there's no harm in leaving it there. You can do that by assigning the partition a letter in diskpart and deleting Ubuntu leftovers from there.

5
  • Unknown command 'fwsetup'
    – Rishabh
    Commented Jun 9, 2021 at 7:20
  • That would suggest your UEFI is configured for BIOS boot. You should be able to access the setup with the hard disk disconnected.
    – gronostaj
    Commented Jun 9, 2021 at 8:05
  • I tried it too but still nothing happening a black screen and in it, there is something appears like '
    – Rishabh
    Commented Jun 9, 2021 at 8:09
  • Media test failure, check cable; existing Broadcom pxe ROM; no bootable device -- insert boot disk and press any key
    – Rishabh
    Commented Jun 9, 2021 at 8:10
  • Thanks now I reached to it actually f2 was not working so I tried with different keyboard and it works now
    – Rishabh
    Commented Jun 9, 2021 at 8:15
0

First of all it is important to know your systems specifications. It could be

  1. a PC with BIOS, or
  2. a PC with (U)EFI.

In case of the later, it could be configured in

  1. native UEFI mode
  2. compatibility/legacy mode, BIOS compatible (called CSM, short for UEFI's Compatibility Support Module)

Since modern PCs use UEFI sind around before 2010 it is most likely a UEFI-PC, but it could be in native mode or in legacy (BIOS) mode, i.e. UEFI-CSM. This difference is crucial, as it defines which partition table is used (and in turn also how the system boots):

  1. native UEFI mode: GUID partition table (GPT)
  2. CSM (BIOS mode): Master Boot Record (MBR)

In UEFI mode the boot sequence is totally different from the BIOS way, but GRUB can be booted in both cases and it would also look the same.

Case 1

Suppose you are in UEFI mode: (U)EFI uses a special partition with EFI boot loaders on it, called the EFI System Partition or, in short: ESP. It is per UEFI specification a FAT partition (FAT32, but FAT16 should also work). Some non-standard UEFIs also support NTFS though. Don't ever delete this partition as it will earse all the boot loaders, the ones for Windows and the ones for Linux. If you did that you're doomed, but since you see a GRUB message this shouldn't be the case...

Additionally, in UEFI mode boot loaders are registered with the firmware and this information is stored in NVRAM. In the UEFI firmware setup, sometimes still called BIOS setup (even though it's not a BIOS anymore), it can be expected that those boot options are listed, but adding such boot options is only possible from an EFI console (power user stuff, don't even try it) or from a booted operating system. The Windows installation process and the Linux installer takes care of this. Is this information lost, or is it set to a non-existing boot loader, UEFI will refuse to boot. Sometimes there is a pre-defined boot loader, normally used for removable (external) media, that should always work as a fallback for internal media: on the ESP those fallback boot loaders are \EFI\BOOT\BOOTX64.EFI (for 64-Bit EFI on x86) or \EFI\BOOT\BOOTIA32.EFI (for 32-Bit EFI on x86). (For ARM and Itanium those would be BOOTARM.EFI/BOOTAA64.EFI and BOOTIA64.EFI.)

So this is your best case scenario: Ubuntu Linux is installed in this way and the GRUB boot loader is still set as the default UEFI boot loader. UEFI loads GRUB from the ESP and GRUB doesn't find its boot configuration, because you've deleted the Linux boot partition along with GRUBs configuration.

The solution: Use the UEFI setup to list all possible boot options and boot the Windows boot loader. It may also work to use the EFI fallback, but there is a fair chance that after Ubuntu has been installed this fallback has been changed to GRUB as well, in which case selecting it will not change the results in any way. If you are able to boot from another drive, like a USB pen drive, and copy the Windows EFI boot loader \EFI\Microsoft\Boot\bootmgfw.efi over to \EFI\BOOT\BOOTX64.EFI on the ESP, then you should be able to successfully retry the EFI fallback boot option.

In any case, check your computers manual to find which key you have to press (or hold) after turning it on to get this list of boot options. Normally it is one of the function keys, like F10 or F12. Microsoft lists Esc, Delete, F1, F2, F10, F11, and F12 as common keys. Could be easy as pie, at least to get Windows booted again.

Once Windows is up and running you must use Windows' ability to set its boot loader as the EFI default in NVRAM. There are a couple of ways to do this but I recommend the manual way using BCDBoot from the command line. To do this start the Command Prompt which you will either find in the Windows Start Menu. Right-click on it and select "Run as Administrator" (might be hidden behind "More", so click that first). Alternatively it can be opened by using the Run function: on the Windows desktop hold the Windows key while pressing the R key: ⊞ Win+R. A small window "Run" opens. Type "runas /user:administrator cmd.exe" and hit Enter.

Now use BCDBoot as follows:

Bcdedit /set {fwbootmgr} displayorder {bootmgr} /addfirst

Should you have accidentally also deleted the EFI System Partition getting Windows back is only possible by using external Windows installation media, like an installation DVD or USB pen drive, or any other external recovery method. The Windows 10 installer has a recovery option to reinstall the boot configuration, which should reset the ESP accordingly.

Case 2

You are in BIOS mode. This could mean you have a very old PC that acutally has a BIOS, or you have a PC with the (Unified) Extensible Firmware Interface, thus EFI or UEFI, but in legacy BIOS mode using the Compatibility Support Module which emulates a BIOS. In essence both are the same, because:

  • The partition table has to be BIOS compatible, which is the Master Boot Record (MBR) in 99.9999% of all cases.
  • The boot sector (the first 512 bytes of the drive) has to contain a boot loader. The MBR contains such a boot loader.

If this was the case, the best way is to reset the MBR is using an external Windows installation media (installation DVD or USB pen drive) and starting the Command Prompt. This is one of the recovery options.

Once on the command line, reset the MBR using these commands:

c:
bootrec /FixMbr
bootrec /FixBoot

The first line changes to drive c:, presumably where Windows is installed on the internal drive. You may want to run bootrec /ScanOs first to list installed Windows systems. Based on this information you may need to change C: to the drive you have your Windows installation on. The second command will reset the MBR and the third line resets the partition boot sector. Maybe it is also necessary to run bootrec /RebuildBcd to rebuild the boot configuration entirely. (Refer to: Windows RE to troubleshoot.)

In any case

In general the best way to fix boot problems with an operating system is to use the original installtion media for that operating system. So, if this is Windows 10 that you need fixed, use a Windows 10 installation disc or a USB pen drive. You need a working Windows 10 system, e.g. from a friend or colleague, an empty USB pen drive with 8GB or more, and an internet connection (without data issues, preferably an unlimited data plan). Then download the Windows 10 Media Creator, run it and have it download and place the files onto the USB pen drive. Warning: Any previous contents of this USB drive will be completely erased!

You really want that (external) Windows installation media!

I hope this helped.

Good luck!

BTW, a similar question has been asked multiple times, e.g. How to restore Windows boot loader after removing Ubuntu, but this only works when one operating system is able to boot...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .