Get Virtualizor

Fix VPS grub rescue

GRUB Boot Issues

The most common reason for GRUB not booting into the operating system is another OS's bootloader overwriting GRUB boot configuration or a failed OS update leading to failure in writing grub file. When GRUB cannot boot the system, the GRUB Rescue prompt appears.

image

Fix GRUB issue

Note
The following steps would be helpful if the VPS was created using our OS template.

Type ls and check if any disk lists, in some case it can show as gpt1 or gpt2 :

grub> ls

(hd0)   (hd0,gpt1)


While using set command make sure the directories list for the selected disk.
In this case, it is disk 1 (hd0) and partition 1 i.e. gpt1 :

grub> set root=(hd0,gpt1)
Below is the example screenshot to view the directories in it :


Once that is successful, its time to load the linux kernel.
use sda in case of Ide and scsi disks and for Virtio use vda and xvda in case of Xen and XCP :

grub> linux /boot/4.18.0-513.9.1.el8_9.x86_64 root=/dev/sda1 ro

It will ideally lists other kernels in /boot directory so if it fails to boot after all the commands are done then you can go for other kernel.

Now you can load the initramfs and choose the image of the same kernel used in previous command :

grub> initrd (hd0,gpt1)/initramfs-4.18.0-513.9.1.el8_9.x86_64.img

Finally boot command can be issued.

grub> boot

Once the system is finally booted you can proceed with re-building the grub.

For newer RPM based systems, you can use the following command (grub config in boot directory can vary from distro to distro)

grub2-mkconfig -o /boot/grub2/grub.cfg

For Debian / Ubuntu, you can try this :

update-grub2

You can now reboot the VPS to check if it is able to boot with the latest installed kernel.

    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list