How to reinstall GRUB bootloader on the Master Boot Record (MBR) in rescue mode

Solution Verified - Updated -

Issue

  • How to reinstall grub2 into the MBR on Red Hat Enterprise Linux?
  • Why does my Red Hat Enterprise Linux system drops to GRUB rescue prompt on boot?
  • I had to restore my system and data partitions from tape after a crash. Why does my Red Hat Enterprise Linux system only shows a black screen after POST?
  • I reinstalled Windows on my server and now I can no longer boot to Red Hat Enterprise Linux.
  • On attempting to reinstall grub I get the following error "Error 5: Partition table invalid or corrupt"
  • When I do grub-install I get error as "Error 12: Invalid device requested"

Environment

  • Red Hat Enterprise Linux 10
  • Red Hat Enterprise Linux 9
  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 6
  • GRUB or GRUB2 Bootloader
  • BIOS systems

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content