"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.
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.
- Firmwarestarts GRUBloads
- GRUB's first partloaded(works)looks for(fails)
- /boot/grubmodules and menu: partition not recognized(breaks here)so
- Linuxnever started
↻ It stops at the grub rescue> prompt instead.
TL;DR
At the grub rescue> prompt:
lsls (hd0,gpt2)/set prefix=(hd0,gpt2)/boot/grubset root=(hd0,gpt2)insmod normalnormalUse 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/grubWith 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/grubgrub rescue> set root=(hd0,gpt2)grub rescue> insmod normalgrub rescue> normalThe 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:
[ -d /sys/firmware/efi ] && echo UEFI || echo BIOSUbuntu and Debian, BIOS:
sudo grub-install /dev/sdasudo update-grubUbuntu and Debian, UEFI:
sudo grub-install --target=x86_64-efi --efi-directory=/boot/efisudo update-grubRHEL, Rocky and AlmaLinux:
# BIOSsudo grub2-install /dev/sdasudo grub2-mkconfig -o /boot/grub2/grub.cfg
# UEFI: reinstall the signed boot files, rather than running grub2-installsudo dnf reinstall grub2-efi-x64 shim-x64sudo grub2-mkconfig -o /boot/grub2/grub.cfgInstall 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:
sudo mount /dev/sda2 /mntsudo mount /dev/sda1 /mnt/boot/efi # UEFI onlyfor d in dev proc sys run; do sudo mount --bind /$d /mnt/$d; donesudo chroot /mntgrub-install /dev/sda # or the UEFI form aboveupdate-grubexitOn 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
ubuntufolder 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.