The grub rescue> prompt appears when GRUB starts but cannot find its files or modules. Usually this happens after a disk resize, a changed partition layout, a failed upgrade or a full /boot. You can boot by hand from the prompt, then reinstall GRUB so it stays fixed.
Before you start
- VNC or console access to the VPS from your control panel.
- A rescue ISO, in case the manual boot does not work.
Find the partition that holds /boot
At the prompt, list the disks and partitions:
lsYou will see entries such as (hd0) (hd0,msdos1) (hd0,gpt2). Try each one until it shows Linux folders:
ls (hd0,msdos1)/If you see boot/ (or grub/, when /boot is a separate partition), you have found it. "error: unknown filesystem" means that partition is not the right one, or it is swap or LVM. Try the next one.
Boot manually
set root=(hd0,msdos1)
set prefix=(hd0,msdos1)/boot/grub
insmod normal
normalOn AlmaLinux and Rocky, the prefix is /boot/grub2. If /boot is its own partition, drop /boot from the path. The normal GRUB menu should appear; boot the system.
Reinstall GRUB permanently
Once the system is running, reinstall GRUB to the disk, not to a partition.
Ubuntu/Debian:
sudo grub-install /dev/vda && sudo update-grubAlmaLinux/Rocky (BIOS boot):
sudo grub2-install /dev/vda && sudo grub2-mkconfig -o /boot/grub2/grub.cfgCheck the disk name with lsblk. It may be /dev/sda instead of /dev/vda.
Reinstall from a rescue ISO
If the manual boot fails, boot the rescue ISO, mount the root partition and chroot into it:
mount /dev/vda1 /mnt && for d in dev proc sys; do mount --bind /$d /mnt/$d; done && chroot /mntRun the same grub-install and update-grub commands, then exit and reboot. For LVM roots, run vgchange -ay before mounting.
Common causes to check
- A full /boot during a kernel update left GRUB files incomplete. See fix no space left on device.
- A partition was resized or moved while growing the disk.
- The disk has errors. Run
fsckfrom rescue mode; see fix a read-only file system. - Kernel parameters were edited wrongly. See kernel parameters in GRUB.
FAQ
What is the difference between grub> and grub rescue>?
At grub>, GRUB has loaded its modules but found no config. At grub rescue>, it cannot even load the modules, so far fewer commands work.
Will reinstalling GRUB delete my data?
No. grub-install only rewrites the boot loader area and the GRUB files. Your files are untouched.
Why did this happen after a disk upgrade?
Growing a disk can shift partition numbers or locations that GRUB stored. Reinstalling GRUB records the new layout.
