Fix the grub rescue> Prompt and "error: unknown filesystem"

Quick fix

At the grub rescue> prompt, find the partition that contains /boot/grub, point GRUB at it, and boot. Replace (hd0,gpt2) with what ls shows on your machine:

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

Once Linux boots, make it permanent: sudo grub-install /dev/sda (BIOS) or sudo grub-install (UEFI), then sudo update-grub. If nothing works, reinstall GRUB from a live USB.

What grub rescue means

GRUB boots in stages. The first, tiny stage lives in the MBR or the EFI system partition. It loads the rest of GRUB, its modules (normal.mod, filesystem drivers) and the grub.cfg menu, from /boot/grub on your Linux partition. If that path is wrong, GRUB drops to grub rescue>, a minimal shell with only ls, set, unset and insmod.

The message above the prompt tells you why:

MessageMeaning
error: unknown filesystem.The partition GRUB was told to use has no filesystem it recognises: it was deleted, reformatted (for example as NTFS by Windows), or the partition numbers shifted.
error: no such partition.The partition number GRUB remembers no longer exists, usually after deleting or re-creating partitions.
error: file '/boot/grub/i386-pc/normal.mod' not found.The partition exists, but the GRUB files are not where expected (a different /boot layout, a failed upgrade, or a moved partition).
error: disk 'lvmid/...' not found.GRUB cannot see the LVM volume or encrypted container that holds /boot.

Common causes

  1. A Linux partition was deleted, often while removing a dual-boot install. If you meant to remove Linux, follow remove Ubuntu from a Windows dual boot to restore the Windows bootloader instead.
  2. Partitions were resized or moved with GParted or Windows Disk Management, changing their numbers or start sectors.
  3. Disk order changed: a new drive or USB stick made hd0 a different disk.
  4. A failed or interrupted GRUB update during a distro upgrade left mismatched files.
  5. Firmware boot order or a Windows update started an old, stale GRUB from another disk.

Step 1: Boot from the grub rescue prompt

Find the right partition

Run ls to list disks and partitions:

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

gpt means a GPT disk (usually UEFI), msdos an MBR disk. Now check each partition for GRUB's directory. A partition GRUB cannot read gives unknown filesystem; the right one lists files:

grub rescue> ls (hd0,gpt1)/
error: unknown filesystem.
grub rescue> ls (hd0,gpt2)/
./ ../ lost+found/ boot/ etc/ home/ usr/ var/ ...
grub rescue> ls (hd0,gpt2)/boot/grub
fonts/ grub.cfg grubenv locale/ x86_64-efi/ i386-pc/

Two layouts need a different path:

  • Separate /boot partition (Fedora, encrypted installs): the GRUB directory is at the partition root, e.g. (hd0,gpt2)/grub, or /grub2 on Fedora and openSUSE.
  • Btrfs with subvolumes (Fedora, openSUSE, some Ubuntu installs): try (hd0,gpt3)/@/boot/grub or (hd0,gpt3)/root/boot/grub2.

Point GRUB at it and load the normal mode

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

The normal GRUB menu should appear. Boot Linux. If insmod normal fails with file not found, the prefix is wrong; recheck with ls. If you only ever get unknown filesystem on every partition, the Linux partition is gone or damaged: go to Step 3.

If you land at grub> instead

The full grub> prompt means GRUB's modules loaded but grub.cfg was not found. You can boot by hand; Tab completes paths:

set root=(hd0,gpt2)
linux /boot/vmlinuz root=/dev/sda2 ro
initrd /boot/initrd.img
boot

Use the kernel and initrd file names that Tab completion shows (they include the version on most distros). If the kernel starts but cannot find the root filesystem, see kernel panic: unable to mount root fs.

Step 2: Make the fix permanent from the booted system

The settings above last for one boot. Reinstall GRUB and regenerate its menu so it records the current partition layout. First check whether you booted in UEFI or BIOS mode:

[ -d /sys/firmware/efi ] && echo UEFI || echo BIOS
lsblk -f

Ubuntu, Debian, Linux Mint

# UEFI
sudo grub-install
# BIOS: install to the disk, not a partition
sudo grub-install /dev/sda
sudo update-grub

Fedora

On UEFI, Fedora boots through signed shim and GRUB binaries from packages. Do not run grub2-install there; reinstall the packages instead:

# UEFI
sudo dnf reinstall 'shim-*' 'grub2-efi-*' grub2-common
# BIOS
sudo grub2-install /dev/sda
sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Arch Linux

# UEFI (adjust the ESP path if yours is /efi)
sudo grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
# BIOS
sudo grub-install --target=i386-pc /dev/sda
sudo grub-mkconfig -o /boot/grub/grub.cfg

openSUSE

sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo update-bootloader --reinit

Newer openSUSE installs may use systemd-boot or GRUB with Boot Loader Spec entries instead of the classic layout. Check YaST → Boot Loader to see which one you have before changing anything.

Install to the disk, not a partition

On BIOS systems, grub-install /dev/sda is correct; /dev/sda1 is not. On NVMe the disk is /dev/nvme0n1. Check with lsblk: picking the wrong disk (for example a USB drive) leaves the real disk unbootable.

Step 3: Reinstall GRUB from a live USB (chroot)

Use this when you cannot boot at all. Boot any live USB of your distro (the Ubuntu installer's Try Ubuntu mode works for Ubuntu, Debian and Mint), in the same mode the system was installed in: pick the USB entry labelled UEFI: in the firmware boot menu for UEFI installs.

Identify the partitions

sudo lsblk -o NAME,SIZE,FSTYPE,LABEL,MOUNTPOINTS
sudo fdisk -l

Example output:

NAME          SIZE FSTYPE LABEL
nvme0n1     476.9G
├─nvme0n1p1   512M vfat
├─nvme0n1p2   100G ntfs   Windows
└─nvme0n1p3   200G ext4

The vfat partition of a few hundred MB is the EFI system partition (ESP); the ext4 (or btrfs) one is your Linux root.

Mount and chroot

sudo mount /dev/nvme0n1p3 /mnt
# UEFI only: mount the ESP
sudo mount /dev/nvme0n1p1 /mnt/boot/efi
# only if you have a separate /boot partition
# sudo mount /dev/nvme0n1pX /mnt/boot
for d in dev proc sys run; do sudo mount --rbind /$d /mnt/$d; done
sudo chroot /mnt

For Btrfs, mount the root subvolume: sudo mount -o subvol=@ /dev/nvme0n1p3 /mnt (the subvolume name is @ on Ubuntu, root on Fedora; list them with btrfs subvolume list). For LVM, run sudo vgchange -ay first and mount /dev/mapper/.... For LUKS, unlock with sudo cryptsetup open /dev/nvme0n1p3 cryptroot first. If the ESP is mounted at /boot or /efi on your system (common on Arch), mount it there instead; cat /mnt/etc/fstab shows where it belongs.

Reinstall inside the chroot

# Ubuntu / Debian / Mint, UEFI
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu
# Ubuntu / Debian / Mint, BIOS
grub-install --target=i386-pc /dev/sda
update-grub
exit
sudo umount -R /mnt
sudo reboot

Use the Fedora, Arch or openSUSE commands from Step 2 inside the chroot on those distros. On Ubuntu UEFI with Secure Boot, apt install --reinstall grub-efi-amd64-signed shim-signed inside the chroot puts the signed binaries back as well.

If update-grub does not find Windows, enable os-prober: add GRUB_DISABLE_OS_PROBER=false to /etc/default/grub, make sure the os-prober package is installed, and run it again.

Check the UEFI boot entry

sudo efibootmgr -v

Example output:

BootCurrent: 0001
BootOrder: 0000,0001,0002
Boot0000* ubuntu	HD(1,GPT,...)/File(\EFI\ubuntu\shimx64.efi)
Boot0001* Windows Boot Manager	HD(1,GPT,...)/File(\EFI\Microsoft\Boot\bootmgfw.efi)

If the Linux entry is missing or not first, reorder with sudo efibootmgr -o 0000,0001 (use your numbers), or change the order in the firmware setup.

Common chroot errors

  • grub-install: error: cannot find EFI directory: the ESP is not mounted at /boot/efi inside the chroot. Exit, mount it, and try again.
  • EFI variables are not supported on this system: the live USB was booted in BIOS mode. Reboot and choose the USB's UEFI: entry.
  • grub-install: warning: this GPT partition label contains no BIOS Boot Partition: BIOS installs on GPT disks need a 1 MB partition with the bios_grub flag. Create one with GParted, or switch the firmware to UEFI if the system was installed that way.

Alternative: Boot-Repair

Boot-Repair is a graphical tool that automates the chroot and reinstall above and can produce a diagnostic report. On an Ubuntu live session:

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt update
sudo apt install boot-repair
boot-repair

Use Recommended repair first. Avoid the advanced options that rewrite the Windows bootloader unless you understand them.

How to prevent it

  • Resize or move Linux partitions only from a live USB, then run sudo update-grub (or grub-mkconfig) from the installed system before the next normal reboot.
  • When removing a dual-boot Linux, fix the boot order first, then delete partitions. See remove Ubuntu from dual boot.
  • Reference partitions by UUID in /etc/fstab (the default on modern installers) so disk order changes don't matter. Disk management explains how.
  • Keep a live USB around. It is the universal way back into any broken boot.

If GRUB loads fine but the system then stops at a maintenance shell, that is a different problem: see "You are in emergency mode". The upstream reference is the GNU GRUB manual and the Arch Wiki GRUB page.

Frequently asked questions

What causes grub rescue?

GRUB's first stage loaded, but it cannot find its own files in /boot/grub. Typical reasons are a deleted or moved Linux partition, a resized or renumbered partition, a disk that changed order, or a Windows or firmware update that changed boot settings.

Can I fix grub rescue without a live USB?

Often yes, temporarily. Use ls to find the partition holding /boot/grub, then set prefix, set root, insmod normal and normal. Once booted, run grub-install and update-grub to make it permanent.

What is the difference between grub rescue> and grub>?

grub> is the full GRUB shell: it found its modules but not a config file, and you can boot with linux and initrd commands. grub rescue> is the minimal mode with only a few built-in commands, used when the modules themselves are missing.

I removed Linux and now Windows shows grub rescue. What do I do?

The firmware still starts GRUB from the Linux boot entry. Select Windows Boot Manager in the firmware boot menu, or repair the Windows bootloader from Windows recovery with bcdboot C:\Windows (UEFI) or bootrec /fixmbr (BIOS).

Spotted a mistake or a command that no longer works? Send a correction — pages are re-checked when reports come in.