Linux VPS

Fix grub rescue> and error: unknown filesystem on a Linux VPS

Get a Linux VPS out of the grub rescue prompt: find the boot partition, boot manually with set root and insmod normal, then reinstall GRUB permanently from the system or a rescue ISO.

AdvancedLinux VPS2 min read

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:

ls

You 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
normal

On 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-grub

AlmaLinux/Rocky (BIOS boot):

sudo grub2-install /dev/vda && sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Check 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 /mnt

Run the same grub-install and update-grub commands, then exit and reboot. For LVM roots, run vgchange -ay before mounting.

Common causes to check

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.

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.