Skip to content

Linux Boot Failure — GRUB Rescue Mode Fix

DodaTech Updated 2026-06-24 3 min read

In this tutorial, you'll learn about Linux Boot Failure. We cover key concepts, practical examples, and best practices.

GRUB rescue mode appears when the bootloader cannot find its configuration or the Linux kernel. The screen shows grub rescue> with errors like "unknown filesystem", "file not found", or "no such partition". This follows partition changes, disk reordering, or corrupted GRUB installation.

The Problem

On boot:

error: unknown filesystem.
Entering rescue mode...
grub rescue>

Or:

error: no such partition.
grub rescue>

Wrong Approach

# WRONG — random commands without understanding the disk layout
grub rescue> linux /vmlinuz
grub rescue> boot

Right Approach

# Step 1: Find the correct partition
grub rescue> ls

Expected output:

(hd0) (hd0,msdos1) (hd1) (hd1,msdos2)
# Step 2: Find the GRUB modules
grub rescue> ls (hd0,msdos1)/boot/grub
# Step 3: Set root and prefix
grub rescue> set root=(hd0,msdos1)
grub rescue> set prefix=(hd0,msdos1)/boot/grub
# Step 4: Load normal module and boot
grub rescue> insmod normal
grub rescue> normal

Step-by-Step Fix

Step 1: List available partitions

grub rescue> ls

Step 2: Probe each partition for boot files

grub rescue> ls (hd0,msdos1)/

Look for the /boot directory containing the kernel and initrd.

Step 3: Set the correct root and prefix

grub rescue> set root=(hd0,msdos1)
grub rescue> set prefix=(hd0,msdos1)/boot/grub

Step 4: Load the normal module

grub rescue> insmod normal
grub rescue> normal

The GRUB menu should appear. Boot normally.

Step 5: Reinstall GRUB after booting

sudo update-grub
sudo grub-install /dev/sda

Step 6: Fix using a live USB

# Boot from Ubuntu live USB, mount the root partition
sudo mount /dev/sda1 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
grub-install /dev/sda
update-grub

Prevention Tips

  • Avoid repartitioning the boot drive without reinstalling GRUB
  • Keep a live USB handy for emergency repairs
  • Back up /etc/default/grub and customize it before major changes
  • Use grub-install after every kernel update in custom setups
  • Test boot configuration with grub-script-check after changes

Common Mistakes with boot grub rescue

  1. Forgetting that lazy evaluation defers computation until the value is forced, causing space leaks with unevaluated thunks
  2. Using return to exit a function early instead of wrapping a pure value in the monad
  3. Mixing let bindings with <- bindings in do notation, producing type errors

These mistakes appear frequently in real-world LINUX code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### What causes GRUB rescue mode to appear?

GRUB rescue mode occurs when GRUB cannot locate its configuration file or the boot partition. Common causes: repartitioning the boot drive, changing partition types, moving GRUB files, disk reordering (swap SATA ports), or a corrupted MBR/GPT.

How do I identify my Linux partition from GRUB rescue?

Use ls to list partitions, then probe each one: ls (hd0,msdos1)/. The partition containing /boot, /vmlinuz, and /initrd is your root partition. Look for the grub directory inside /boot on most modern distributions.

Can I prevent GRUB rescue mode entirely?

Enable GRUB to boot from a fallback entry by configuring GRUB_TIMEOUT=5 and GRUB_RECORDFAIL_TIMEOUT=5 in /etc/default/grub. On UEFI systems, keep a fallback EFI boot entry. On BIOS systems, ensure the boot sector is backed up with dd if=/dev/sda of=boot.bin bs=446 count=1.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro