Skip to content
ohsudo, Home
Linux

"grub rescue>" with "error: unknown filesystem": find the partition, boot, then reinstall GRUB

Fix "error: unknown filesystem" and the grub rescue> prompt: find the Linux partition with ls, boot it with set prefix and insmod normal, then reinstall GRUB for good.

Intermediate3 min readApplies to Ubuntu · Debian · Linux Mint · RHEL / Rocky / AlmaLinux · dual boot with Windows

by OhSudo ··

Checked on real software: Ubuntu 24.04, GRUB 2 · November 2026How we check

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

GRUB, the program that starts Linux, loaded its first small part, and then couldn’t find the rest of itself: its modules and its menu, in /boot/grub. It’s looking on a partition that has moved, been resized, or been deleted, so it doesn’t recognize what’s there.

The typical causes are a partition changed from Windows, a Linux partition deleted on a dual-boot machine, or a disk added or reordered. Your data is usually fine. The rescue prompt has just enough commands to boot by hand, and then you fix GRUB from Linux.

  1. Firmwarestarts GRUB
  2. GRUB's first partloaded(works)
  3. /boot/grubmodules and menu: partition not recognized(breaks here)
  4. Linuxnever started

↻ It stops at the grub rescue> prompt instead.

GRUB's first small part loaded, then couldn't find the rest of itself in /boot/grub, on a partition that moved, changed or was deleted. Your data is usually fine.

TL;DR

At the grub rescue> prompt:

ls
ls (hd0,gpt2)/
set prefix=(hd0,gpt2)/boot/grub
set root=(hd0,gpt2)
insmod normal
normal

Use the partition where ls shows your Linux files. Once Linux is up, reinstall GRUB: section 4.

1. List the partitions

grub rescue> ls
(hd0) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1)

hd0 is the first disk, and gpt2 its second partition. On older disks, they’re called msdos1, msdos2, and so on.

2. Find the one with Linux

Look inside each, with a slash at the end:

grub rescue> ls (hd0,gpt1)/
error: unknown filesystem.
grub rescue> ls (hd0,gpt2)/
./ ../ lost+found/ boot/ etc/ home/ usr/ var/ ...

unknown filesystem there just means GRUB can’t read that partition, such as a Windows or EFI one. The one listing boot/ and etc/ is your Linux root. Check it holds GRUB:

grub rescue> ls (hd0,gpt2)/boot/grub

With a separate /boot partition, you’ll find a small partition listing grub/ and vmlinuz files directly. Then the path has no /boot: (hd0,gpt2)/grub.

Encrypted or LVM systems show something like (lvm/vg-root) in the list. Use that name instead.

3. Boot from the prompt

grub rescue> set prefix=(hd0,gpt2)/boot/grub
grub rescue> set root=(hd0,gpt2)
grub rescue> insmod normal
grub rescue> normal

The normal GRUB menu should appear. Choose Linux. These settings only last for this boot, so continue with the next step.

If insmod normal says file not found, the prefix is wrong: check the path with ls again. On RHEL, the folder is /boot/grub2.

4. Fix GRUB for good

Once logged in, find your disk with lsblk, then check how the machine boots:

Terminal window
[ -d /sys/firmware/efi ] && echo UEFI || echo BIOS

Ubuntu and Debian, BIOS:

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

Ubuntu and Debian, UEFI:

Terminal window
sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi
sudo update-grub

RHEL, Rocky and AlmaLinux:

Terminal window
# BIOS
sudo grub2-install /dev/sda
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
# UEFI: reinstall the signed boot files, rather than running grub2-install
sudo dnf reinstall grub2-efi-x64 shim-x64
sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Install to the disk, /dev/sda, not a partition like /dev/sda1. Restart to check.

5. If you can’t boot from the prompt

Start from a live USB of your distribution, and do the same from inside your system:

Terminal window
sudo mount /dev/sda2 /mnt
sudo mount /dev/sda1 /mnt/boot/efi # UEFI only
for d in dev proc sys run; do sudo mount --bind /$d /mnt/$d; done
sudo chroot /mnt
grub-install /dev/sda # or the UEFI form above
update-grub
exit

On Ubuntu, the Boot-Repair tool automates this, from the live USB.

6. You removed Linux on purpose

On a dual-boot machine where the Linux partition was deleted, GRUB is still the first thing that starts, and has nothing left to load. Give control back to Windows:

  • UEFI: in the firmware settings, put Windows Boot Manager first in the boot order. To clean up, the old ubuntu folder on the EFI partition can be removed later.
  • BIOS: boot from Windows installation media, open Repair → Command Prompt, and run bootrec /fixmbr.

Warning

Be careful which partition you work on. Never format or “fix” a partition you haven’t identified with ls or lsblk -f. And before resizing or deleting partitions on a dual-boot disk, take a backup: these steps change where bootloaders look, which is exactly how this error starts.

Shell, we have a problem!

Similar, but different: a kernel panic with “Unable to mount root fs” happens later, after GRUB has loaded the kernel. error: no such partition at grub rescue> is the same problem, with a partition number that no longer exists. Minimal BASH-like line editing is supported with a grub> prompt, without “rescue”, means GRUB loaded and only its menu file is missing: configfile (hd0,gpt2)/boot/grub/grub.cfg loads it.

Found this useful? Share it.

Found a mistake? Let us know at contact@ohsudo.com.

Articles

Related articles