LinuxHigh

GRUB Rescue Error: Causes and 4 Ways to Restore the Bootloader

The article explains what `grub-rescue` mode is, why the system fails to boot, and provides 4 practical ways to restore the GRUB bootloader, from simple commands in the rescue shell to a full reinstall using LiveCD.

Updated at February 16, 2026
15-30 minutes
Medium
FixPedia Team
Применимо к:Ubuntu 20.04+Debian 11+CentOS 8+Any distribution with GRUB2

What the grub-rescue error means

The grub-rescue> (emergency recovery mode) prompt appears when the GRUB bootloader cannot find its modules, configuration file, or necessary kernel files. This is not an error code in the usual sense, but a special minimalist shell that launches during critical failures.

Symptoms:

  1. When turning on the computer, instead of the GRUB menu or system boot, the following line is displayed:
    grub-rescue>
    
  2. Commands like ls and set work, but most standard GRUB commands (e.g., menuentry) are unavailable.
  3. The system does not boot past this screen.

grub-rescue mode is the bootloader's last line of defense. It allows you to manually specify the kernel location and initialize the boot, but it does not fix the GRUB configuration problem.

Causes

The error occurs because GRUB cannot read its files from the disk. Main causes:

  1. Corruption or loss of GRUB files in the /boot partition (e.g., grub.cfg, modules in /boot/grub).
  2. Change in disk order in BIOS/UEFI or physical reconnection (e.g., reconnected a SATA cable, and hd0 became hd1).
  3. Incorrect GRUB installation (e.g., to a partition instead of MBR/ESP, or to a different disk).
  4. Corruption of the partition table or /boot filesystem.
  5. Deletion or compression of the /boot partition without updating GRUB.
  6. Interrupted kernel/GRUB update (update was interrupted, /boot ran out of space).
  7. Error in GRUB configuration (grub.cfg), causing the bootloader to fail to find the kernel.

Method 1: Temporary system boot via rescue shell

This method does not fix GRUB, but allows you to boot into the system to restore the bootloader from within.

  1. At grub-rescue>, list disks and partitions:
    ls
    

    Output may be: (hd0) (hd0,msdos1) (hd0,msdos2) (hd1) (hd1,msdos1)...
  2. Check each partition for kernel files:
    ls (hd0,msdos1)/
    

    Look for directories boot, grub, grub2 or files vmlinuz-*, initrd.img-*.
  3. When you find the system partition (e.g., (hd0,msdos1)), set it as root:
    set root=(hd0,msdos1)
    
  4. Find the exact kernel filename (version may differ):
    ls /boot/vmlinuz-*
    

    Suppose the file is: /boot/vmlinuz-5.15.0-78-generic
  5. Load the kernel and initrd:
    linux /boot/vmlinuz-5.15.0-78-generic root=/dev/sda1 ro quiet
    initrd /boot/initrd.img-5.15.0-78-generic
    

    The root= parameter points to the root partition (usually /dev/sda1 or /dev/nvme0n1p1). Verify it via ls (hd0,msdos1)/etc/fstab or by partition size.
  6. Boot the system:
    boot
    
  7. After a successful boot, immediately reinstall GRUB (see Method 2).

⚠️ Important: If grub-rescue> does not see the ls command or disks are missing entirely, the problem may be with the disk driver (e.g., for RAID or NVMe). In this case, you need a LiveCD.

Method 2: Full GRUB reinstallation from a Live medium

Recommended method. Requires a bootable Linux USB (Ubuntu, Fedora, any live distro).

  1. Boot from the Live USB and open a terminal.
  2. Identify how your system disk is named in the Live environment:
    sudo fdisk -l
    

    Find the Linux partition (usually /dev/sda1, /dev/nvme0n1p1, etc.). If you have UEFI, also find the ESP partition (FAT32, ~100-500 MB, type EFI System).
  3. Mount the root partition:
    sudo mount /dev/sda1 /mnt
    

    If you have a separate /boot, mount it to /mnt/boot:
    sudo mount /dev/sda2 /mnt/boot
    
  4. For UEFI, mount the ESP partition:
    sudo mount /dev/sdaX /mnt/boot/efi  # X — ESP partition number
    
  5. Mount system virtual filesystems:
    sudo mount --bind /dev /mnt/dev
    sudo mount --bind /proc /mnt/proc
    sudo mount --bind /sys /mnt/sys
    
  6. Enter the chroot environment:
    sudo chroot /mnt
    
  7. Reinstall GRUB:
    • For BIOS/MBR (disk /dev/sda):
      grub-install /dev/sda
      
    • For UEFI (ESP already mounted at /boot/efi):
      grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
      
  8. Update the configuration:
    update-grub
    

    It should detect kernels and create a menu.
  9. Exit chroot and reboot:
    exit
    sudo reboot
    

    Remove the Live USB during boot.

Method 3: Restore GRUB configuration without LiveCD (if system booted via Method 1)

If you managed to boot temporarily, restore the GRUB configuration from within the system.

  1. Verify GRUB files are in place:
    ls /boot/grub
    

    Should contain grub.cfg, i386-pc/ (for BIOS) or x86_64-efi/ (for UEFI).
  2. Regenerate the configuration file:
    sudo update-grub
    

    Or, if update-grub is unavailable:
    sudo grub-mkconfig -o /boot/grub/grub.cfg
    
  3. If the config was restored but GRUB still doesn't boot, reinstall it to the boot partition:
    # For BIOS:
    sudo grub-install /dev/sda
    
    # For UEFI (if ESP is mounted at /boot/efi):
    sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi
    
  4. Reboot:
    sudo reboot
    

Method 4: Manual GRUB file recovery (emergency option)

If GRUB files were deleted or corrupted, but you have a backup or they exist elsewhere.

  1. From LiveCD (as in Method 2), enter chroot.
  2. Check if the GRUB package is installed in your system:
    dpkg -l grub-pc  # For Debian/Ubuntu
    rpm -qa | grep grub2  # For RHEL/CentOS/Fedora
    
  3. If the package exists, reinstall it:
    # Debian/Ubuntu:
    sudo apt-get install --reinstall grub-pc grub-common
    
    # RHEL/CentOS (with EPEL):
    sudo dnf reinstall grub2
    
  4. Then run grub-install and update-grub (steps from Methods 2 and 3).
  5. If the package is missing, install it via the package manager from within chroot.
  6. If there is no network in the Live environment, copy GRUB files from another working computer (compatible architecture and version) to /mnt/boot/grub and to the boot partition (for UEFI — to the ESP).

Prevention

To avoid recurrence:

  1. Do not delete or compress the /boot partition after system installation. If resizing is needed, use GParted from a bootable disk, then reinstall GRUB.
  2. When updating the kernel, ensure there is enough space on the /boot partition (at least 200 MB). Remove old kernels via apt autoremove or dnf autoremove.
  3. Avoid changing disk order in BIOS/UEFI. If you change cables, update the GRUB configuration.
  4. Regularly back up critical partitions (especially /boot and ESP) or create system snapshots (Btrfs, ZFS).
  5. When installing GRUB, always specify the physical disk (e.g., /dev/sda), not a partition (e.g., /dev/sda1), if using BIOS. For UEFI — the ESP should be a separate FAT32 partition.
  6. After any partition operations (creation, deletion, resizing), reinstall GRUB from a LiveCD.

Additional questions

What to do if ls is missing in grub-rescue?

This indicates serious issues with disk drivers. Try booting with LiveUSB and check if the disk is visible in fdisk -l. If not — the problem may be hardware-related (cable, controller) or with a RAID/NVMe driver that fails to load in rescue mode.

Can GRUB be restored automatically?

No, there is no auto-repair in grub-rescue. All steps require manual input. However, after a successful boot, you can configure automatic configuration regeneration via grub-mkconfig on each kernel update.

Why does grub-rescue reappear after GRUB recovery?

Most often this means GRUB was installed to the wrong partition or disk. Check:

  • For BIOS: sudo fdisk -l — is there a partition table? Where is the MBR located?
  • For UEFI: is the ESP mounted? Is GRUB installed to the correct EFI entry (efibootmgr)?
  • Is the root in grub.cfg set correctly?

F.A.Q.

How to exit grub-rescue and boot the system?
Can GRUB be restored without LiveCD/USB?
Why did grub-rescue appear after a kernel update?
How does grub-rescue differ from regular grub?

Hints

Identify disk partitions in the rescue shell
Find the partition with the installed system
Set a temporary root and load the kernel
Reinstall GRUB from LiveCD
Restore GRUB configuration

Did this article help you solve the problem?

FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community