🔍
Artificial Intelligence Cybersecurity Windows Mac Android iPhone Software How-To Guides Reviews Comparisons Productivity Internet Apps Cloud Business Software About Contact

How to Fix "grub rescue" Error in Linux: Complete Recovery Guide

The "grub rescue" prompt appears when GRUB cannot find its files. This typically happens after installing Windows alongside Linux, repartitioning your drive, or a failed GRUB update. Here is how to recover your system.

Understanding the grub rescue Prompt

When you see "grub rescue" instead of the normal GRUB menu, the bootloader cannot locate the /boot/grub directory. The prompt accepts basic commands: ls lists available drives and partitions, set prefix= sets the GRUB directory, insmod loads modules, and normal boots the full GRUB interface.

Fix 1: Find Your Linux Partition from grub rescue

At the grub rescue prompt, type ls to list all available drives and partitions. You will see output like (hd0) (hd0,msdos1) (hd0,msdos2). Try each partition with ls (hd0,msdos1)/ to see its contents. Look for a partition containing /boot/grub directory or /vmlinuz file. This is your Linux root partition.

Fix 2: Boot Linux from grub rescue

Once you find your Linux partition, set it as the root: set root=(hd0,msdos1). Then set the GRUB prefix: set prefix=(hd0,msdos1)/boot/grub. Load the normal module: insmod normal. Then run normal to boot into the full GRUB menu. From there, you can boot Linux and reinstall GRUB permanently.

Fix 3: Reinstall GRUB Permanently

After booting into Linux, reinstall GRUB to the Master Boot Record. Run sudo update-grub to regenerate the GRUB configuration. Then install GRUB to the MBR with sudo grub-install /dev/sda (replace sda with your boot drive). For UEFI systems, use sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi.

How to Prevent Future GRUB Problems

Always install Windows before Linux on dual-boot systems. Keep a bootable Linux USB drive for emergencies. Back up your partition table regularly. If you resize partitions, run sudo update-grub afterward. Consider using a separate /boot partition to isolate GRUB files from root filesystem changes.