Why Your Linux System Boots into grub rescue> and How to Fix It

Why Your Linux System Boots into grub rescue> and How to Fix It

It can be deeply frustrating when a Linux system fails to boot properly and drops into a grub rescue> prompt. This usually indicates a problem with the GRUB (GRand Unified Bootloader), the software responsible for booting the OS. This guide will help you understand why this happens and how to recover your system—even if you’re using RHEL 7, 8, 9, or 10.

Common Symptoms

You might see one of the following errors on a black-and-white screen:

error: file 'grub/i386-pc/normal.mod' not found
Entering rescue mode...
grub rescue>

Or:

error: file 'grub2/i386-pc/XYZ.mod' not found

Where XYZ could be:

  • normal.mod
  • net.mod
  • boot.mod
  • crypto.mod
  • …and other GRUB modules.

This means GRUB cannot find the module files it needs to load the full boot menu. Your system is now stuck in a minimal shell, waiting for help.

Why This Happens (Root Causes).

  • Accidental Deletion of GRUB Files Sometimes during maintenance or partition changes, files may be deleted from /boot.

  • Filesystem Corruption If /boot is on its own partition and gets corrupted, GRUB will not find what it needs.

  • Wrong Boot Device in BIOS/UEFI If the system tries to boot from the wrong disk, it may not find GRUB or kernel files.

  • Corrupted or Missing /boot Directory Important GRUB files like normal.mod live in /boot/grub2/i386-pc/. If these are missing or corrupted, GRUB will fail

How to Fix It (Quick Recovery Steps)

Step 1: Try Manual Rescue via grub rescue> Prompt

grub rescue> ls (hd0,msdos1)
grub rescue> ls (hd0,msdos1)/boot
grub rescue> set root=(hd0,msdos1)
grub rescue> set prefix=(hd0,msdos1)/boot/grub2
grub rescue> insmod normal
grub rescue> normal

If insmod normal fails, you must use rescue media (like a RHEL installation DVD or USB) to recover.

Booting into Rescue Mode (RHEL 7 and Above)

  1. Boot from a RHEL installation DVD or ISO.
  2. Select “Troubleshooting” > “Rescue a Red Hat Enterprise Linux system”.
  3. Choose Option 1 (Continue) to mount the system at /mnt/sysimage.
  4. Access a shell, then run: chroot /mnt/sysimage

    See the steps in the screenshots:

chroot /mnt/sysimage

Reinstall GRUB Bootloader

Once you’re in chroot, reinstall GRUB with:

grub2-install /dev/sdX   # Replace with your disk, e.g., /dev/sda or /dev/vda

Make sure /boot is mounted before running this. You can check:

ls /boot

Once GRUB is installed successfully, reboot:

exit
exit

The system will likely relabel SELinux contexts during reboot, then boot normally.



Rescuing a RHEL Server That Boots into GRUB Using a DVD, when most /boot contents are compromised.

When a Red Hat Enterprise Linux (RHEL) server drops to a GRUB prompt instead of booting the OS, it usually indicates a problem with the bootloader or kernel. In such cases, you can use a RHEL installation DVD (or ISO) in rescue mode to recover the system. This guide provides a step-by-step walkthrough for system administrators to rescue a non-booting RHEL system using a bootable DVD. We’ll boot into rescue mode, chroot into the installed system, use the DVD as a local package source to reinstall critical boot packages (the kernel and GRUB), and reinitialize the GRUB bootloader. All commands and their outputs are shown in text format for clarity.

Step 1: Boot into Rescue Mode from the DVD

Begin by booting the server from a RHEL installation DVD/ISO. At the boot menu, select the Troubleshooting option, then choose Rescue a Red Hat Enterprise Linux system. The system will load a minimal Anaconda rescue environment. Follow the prompts:

  • When asked whether to find and mount the existing Linux installation, choose Continue (usually option 1). This will search for your RHEL installation and mount its root filesystem under /mnt/sysimage.
  • Once the environment is ready, you’ll be presented with a shell (usually with a prompt like sh-4.4# or bash-4.2#). The system’s partitions should now be accessible at the /mnt/sysimage mount point.

Tip: If your system’s disks weren’t auto-mounted (for example, if you chose Skip), you may need to manually activate LVM and mount the filesystems. For instance, run vgchange -ay to activate volume groups, then mount your root partition to /mnt/sysimage (and any separate boot partition to /mnt/sysimage/boot). In most cases, however, the Continue option in rescue mode will handle this for you.

Step 2: Verify Mounted Filesystems and Locate the DVD Repository

With the system’s disks mounted at /mnt/sysimage, let’s verify the environment. Use the df -hT command to check disk usage and confirm the DVD is mounted as a repository. The DVD (or ISO) is typically mounted at /run/install/repo in the rescue environment:

In the above output, /dev/sr0 (the DVD drive) is mounted on /run/install/repo (with filesystem type iso9660). This is the mounted RHEL installation media that we will use as a package source. The system’s own root (/dev/mapper/…) is mounted on the rescue environment’s / (this is the RAM-based rescue OS). Our goal is to use the content under /run/install/repo to fix the installed system under /mnt/sysimage.

Step 3: Bind-Mount the DVD Repository into the Installed System and Chroot

Next, we need the DVD’s repository to be accessible from within our installed system’s environment (when we chroot). We can achieve this by bind-mounting the already-mounted DVD (/run/install/repo) to a directory inside /mnt/sysimage. For example, we’ll use /mnt/sysimage/mnt as a mount point (you can choose another path like /mnt/sysimage/media if preferred):

mount --bind /run/install/repo /mnt/sysimage/mnt/
#OR
mount -o bind /run/install/repo /mnt/sysimage/mnt/

Now the DVD’s contents will be visible at /mnt from the perspective of the installed system.

Now, change root into the installed system:

chroot /mnt/sysimage

Your shell prompt will change (it may reflect the installed system’s hostname or appear as sh-4.4# in chroot). At this point, you are “inside” your RHEL installation, with its filesystem as /. Any commands you run now (like dnf) will operate on the installed system. However, because the system is in rescue mode, networking might be disabled and only the DVD repository is available for package operations – which is exactly what we need.

Step 4: Configure the DVD as a Yum/DNF Repository in the Chroot

Inside the chroot (the installed system), we will set up the mounted DVD as a local Yum/DNF repository so that we can reinstall packages from it. The RHEL DVD contains a repository metadata file called media.repo at its root. We’ll copy this file into the installed system’s repository configuration directory and edit it to point to our mounted DVD path.

  1. Copy the repo file from the DVD:
cp /mnt/cdrom/media.repo /etc/yum.repos.d/

This copies the repository definition from the DVD into a new repo file (named media.repo) on the installed system. By default, the media.repo may have some placeholders and might be disabled, so we will edit it next.

  1. Edit the repo file to enable it and set the base URL: Open /etc/yum.repos.d/media.repo in a text editor (vi, nano, etc.) and make sure it has an entry pointing to the DVD mount. For example:

Note: The label [InstallMedia] and name may vary slightly depending on RHEL version (for example, it might say “DVD for RHEL 8.?” with a specific media ID). The important part is that baseurl points to the correct mount directory. If the installation media contains multiple repositories (e.g., BaseOS and AppStream in RHEL 8+), you might create separate sections or ensure the baseurl covers all needed packages. In our case, kernel and GRUB packages are in the BaseOS content, which this setup will cover.

Step 5: Verify the Local Repository is Enabled

After configuring the repo file, run DNF’s repolist to verify that the DVD repository is recognized:

The output should list the “InstallMedia” repository (or whatever name was in the repo file) as enabled. If you see “0 packages” or an error, double-check that the baseurl path is correct and that the DVD is still mounted. You can also run dnf clean all && dnf repolist to refresh the repo metadata if needed. At this point, no Internet connection or Red Hat subscription is required because we are using the DVD’s packages as our source.

Step 6: Reinstall the Kernel and GRUB2 Packages

Now we will reinstall the boot-critical packages: the Linux kernel and GRUB2 bootloader packages. Reinstalling ensures that any missing or corrupted files (like the kernel image, initramfs, GRUB modules, or config) are restored from the DVD. Use a wildcard dnf reinstall to grab all kernel and grub2 related packages:

dnf reinstall kernel* grub2-*

This command will find all installed packages matching “kernel” and “grub2-” and reinstall them from the DVD repo. You’ll see DNF resolve the package list and prompt for confirmation. For example, the transaction may include packages such as kernel-core, kernel-modules, kernel-modules-extra, and various GRUB2 packages:

Last metadata expiration check: 0:10:12 ago on Tue 03 Sep 2025 12:30:45 PM UTC.
Dependencies resolved.
===================================================================================
 Package                  Arch   Version               Repo           Size
===================================================================================
Reinstalling:
 kernel-core              x86_64 4.18.0-425.19.2.el8    InstallMedia   30 M
 kernel-modules           x86_64 4.18.0-425.19.2.el8    InstallMedia   26 M
 grub2-pc                 x86_64 2.02-123.el8          InstallMedia  1.3 M
 grub2-pc-modules         noarch 2.02-123.el8          InstallMedia  1.1 M
 grub2-tools              x86_64 2.02-123.el8          InstallMedia  2.0 M
 grub2-tools-minimal      x86_64 2.02-123.el8          InstallMedia  197 k
 grub2-tools-extra        x86_64 2.02-123.el8          InstallMedia  1.4 M

Transaction Summary
===================================================================================
Reinstall  7 Packages

Total download size: 61 M
Installed size: 190 M
Is this ok [y/N]: y
Downloading Packages:
...
Running transaction check...
Running transaction test...
Transaction test succeeded.
Running transaction
  Reinstalling : kernel-core-4.18.0-425.19.2.el8.x86_64                       1/7 
  Reinstalling : kernel-modules-4.18.0-425.19.2.el8.x86_64                    2/7 
  Reinstalling : grub2-pc-2.02-123.el8.x86_64                                 3/7 
  Reinstalling : grub2-pc-modules-2.02-123.el8.noarch                         4/7 
  Reinstalling : grub2-tools-minimal-2.02-123.el8.x86_64                      5/7 
  Reinstalling : grub2-tools-2.02-123.el8.x86_64                              6/7 
  Reinstalling : grub2-tools-extra-2.02-123.el8.x86_64                        7/7 
  Verifying    : grub2-tools-extra-2.02-123.el8.x86_64                        1/7 
  Verifying    : grub2-tools-2.02-123.el8.x86_64                              2/7 
  Verifying    : grub2-tools-minimal-2.02-123.el8.x86_64                      3/7 
  Verifying    : grub2-pc-modules-2.02-123.el8.noarch                         4/7 
  Verifying    : grub2-pc-2.02-123.el8.x86_64                                 5/7 
  Verifying    : kernel-modules-4.18.0-425.19.2.el8.x86_64                    6/7 
  Verifying    : kernel-core-4.18.0-425.19.2.el8.x86_64                       7/7 

Reinstalled:
  kernel-core-4.18.0-425.19.2.el8.x86_64                                           
  kernel-modules-4.18.0-425.19.2.el8.x86_64                                        
  grub2-pc-2.02-123.el8.x86_64                                                     
  grub2-pc-modules-2.02-123.el8.noarch                                             
  grub2-tools-2.02-123.el8.x86_64                                                  
  grub2-tools-minimal-2.02-123.el8.x86_64                                          
  grub2-tools-extra-2.02-123.el8.x86_64                                            

Complete!

(Output abridged for brevity.)

In the above example, DNF reinstalled the kernel packages and GRUB2 packages from the DVD (notice the Repo column shows InstallMedia). The exact package list and versions will vary depending on your RHEL release. The key is that all necessary components for booting (vmlinuz, initramfs, GRUB modules, GRUB config scripts, etc.) are now restored.

Step 7: Reinstall the GRUB Bootloader to the Disk

Reinstalling the GRUB2 packages puts the bootloader files back on the disk (under /boot), but we also need to ensure the GRUB boot sector/EFI entry is properly installed so the system can actually execute GRUB at boot. The final step is to run the GRUB installer utility to write GRUB into the MBR (for BIOS systems) or UEFI boot records (for UEFI systems).

Since this example assumes a BIOS-based system (legacy boot), we use the disk device (e.g. /dev/sda where the OS is installed) with grub2-install:

grub2-install /dev/sda
Installing for i386-pc platform.
Installation finished. No error reported.

The output above indicates that GRUB was successfully written to the device’s boot sector. The grub2-install command copies GRUB’s low-level bootloader code to the disk and ensures the GRUB modules are in place in /boot/grub2. If your system uses UEFI, the process is slightly different: you would reinstall the EFI GRUB binaries (via dnf reinstall grub2-efi shim packages, etc.) and ensure the EFI System Partition is mounted at /boot/efi. Then you might run grub2-install --efi-directory=/boot/efi --bootloader-id=... to update the UEFI boot entry. For a BIOS-based server, however, grub2-install /dev/sda is the correct approach.

Step 8: Final Steps – Update GRUB Config (if needed) and Reboot

At this point, the critical pieces have been restored. The kernel and GRUB files are in place and GRUB’s boot code is installed to the disk. One more action that is often recommended is to regenerate the GRUB configuration file (grub.cfg) in case it was missing or outdated. This is done with:

grub2-mkconfig -o /boot/grub2/grub.cfg

This command scans the system for installed kernels and generates a fresh /boot/grub2/grub.cfg based on /etc/default/grub and scripts in /etc/grub.d. (If you reinstalled the kernel packages, this may have been done automatically by post-install scripts, but running it manually ensures the config is up to date.)

Finally, exit the chroot and reboot:

exit         (exit chroot)
exit         (exit rescue shell, or type reboot)

Remove the DVD/ISO and allow the system to boot from its disk. If all went well, the server should now boot normally into RHEL, and you’ll see the GRUB menu or a successful OS startup. The GRUB prompt should be gone, as we have restored the bootloader and kernel. Upon first boot, RHEL might perform an SELinux relabeling (if the context changed, especially if new files were added; we touched the kernel and grub files which usually don’t need relabel, but if you created any files manually, relabeling ensures the correct contexts). If you see a message about relabeling, let it complete and the system will reboot once more automatically

Optional Cleanup and Verification

After recovery, verify the presence of required modules:

ls /boot/grub2/i386-pc/normal.mod

If missing, reinstall the grub2-pc-modules package.

Also, ensure /boot contains your kernel and initramfs files:

ls /boot/vmlinuz-* /boot/initramfs-*

Tips to Avoid This in the Future

  • Never delete /boot files manually unless you’re sure.
  • Regularly back up /boot and /etc/fstab.
  • Ensure BIOS is pointing to the correct primary disk.
  • Run dnf update carefully, especially on headless or remote systems.

Conclusion

grub rescue> prompt doesn’t mean your system is dead—it’s asking for your help. With the right tools (like rescue mode and grub2-install), you can bring your server back to life without reinstalling the OS. Bookmark this guide and stay calm the next time it happens.

Posts Carousel

Leave a Comment

Your email address will not be published. Required fields are marked with *

Latest Posts

Most Commented

Featured Videos