Linux no longer boots, and all you get is grub>, grub rescue> or Windows right away? Typical causes are moved or resized partitions, a Windows update that has overwritten the bootloader, or a new hard disk. In almost all cases GRUB can be repaired from a live USB stick.
Preparation: boot a live system
- Download an Ubuntu image and write it to a USB stick with balenaEtcher, Rufus or
dd. - Boot from the stick and choose “Try Ubuntu”.
- Important: boot in the same mode as the installed system – i.e. in UEFI mode if Linux was installed via UEFI. The machine’s boot menu then shows “UEFI: USB stick”.
Option 1: Boot-Repair (graphical)
Boot-Repair detects the installation by itself and repairs GRUB with one click. Open a terminal in the live system:
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt update
sudo apt install -y boot-repair
boot-repair
Choose “Recommended repair” and follow the instructions. At the end Boot-Repair shows a link to a report – note it down in case you need to ask for help in a forum later.
Option 2: by hand via chroot
Without additional software, a few commands do the job. First identify the partitions:
lsblk -f
You are looking for the Linux root partition (usually ext4, e.g. /dev/nvme0n1p2) and, with UEFI, the EFI partition (vfat, roughly 100–1000 MB, e.g. /dev/nvme0n1p1). Adjust the names in the following example accordingly:
sudo mount /dev/nvme0n1p2 /mnt
sudo mount /dev/nvme0n1p1 /mnt/boot/efi # UEFI only
for d in dev proc sys run; do sudo mount --rbind /$d /mnt/$d; done
sudo chroot /mnt
You are now working inside the installed system. Reinstall GRUB:
# UEFI
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu
# BIOS / legacy – onto the disk, not onto a partition!
grub-install /dev/sda
# In both cases afterwards:
update-grub
exit
Then remove the stick and reboot.
Windows missing from the menu?
For some years now, GRUB no longer searches for other operating systems by default, for security reasons. In /etc/default/grub, add the line
GRUB_DISABLE_OS_PROBER=false
(or remove the comment character in front of it) and run sudo update-grub.
Emergency: booting straight from the GRUB prompt
If you have no live stick at hand, the system can often be booted from the grub> prompt as well. Use ls to list the partitions and find the right one, then for example:
set root=(hd0,gpt2)
linux /boot/vmlinuz root=/dev/nvme0n1p2
initrd /boot/initrd.img
boot
Once the system is up, repair it permanently with sudo grub-install and sudo update-grub.
Originally published in 2012, completely revised in November 2026.