Grub Rescue | Repairing your Bootloader

GRUB Rescue

Lets go over Grub Rescue and repairing your bootloader. This is a very misunderstood topic and by learn basic syntax you will be able to repair your GRUB very easily. Here are 4 methods of doing a GRUB Rescue.

Repairing from a GRUB > Prompt

Find your Hard drive
ls
Output Example:
(hd0) (hd0,msdos2) (hd0,msdos1)


List Root partition on each drive til you find your Install
ls (hd0,msdos2)/
Check for the directory listing, if nothing, move to next

Now that we have found the proper drive lets boot to it
grub> set root=(hd0,msdos2)
grub> linux /boot/vmlinu (tab complete) root=/dev/sda1 (or the root linux partition)
grub> initrd /boot/initrd (tab complete)
grub> boot

Repairing from a GRUB Rescue > Prompt

Find your Hard drive
ls
Output Example:
(hd0) (hd0,msdos2) (hd0,msdos1)

List Root partition on each drive til you find your Install
ls (hd0,msdos2)/
Check for the directory listing, if nothing, move to next

Now that we have found the proper drive lets boot to it

grub rescue> set prefix=(hd0,msdos2)/boot/grub
grub rescue> set root=(hd0,msdos2)
grub rescue> insmod normal
grub rescue> normal
grub rescue> insmod linux
grub rescue> linux /boot/vmlinu (tab complete) root=/dev/sda1 (or the root linux partition)
grub rescue> initrd /boot/initrd (tab complete)
grub rescue> boot

Fix GRUB Permanently

Now that we are booted in from GRUB Rescue, we can begin work with repairing our grub permanently. First we rebuild the /boot/grub/grub.cfg file:

Debian-based Distributions use update-grub
Other Distributions use grub-mkconfig -o /boot/grub/grub.cfg

With the Configuration rebuilt, we now simply need to reinstall grub

grub-install /dev/sda

Note: /dev/sda is the DEVICE…NOT THE PARTITION.

Other Methods of Repairing GRUB

Leave any Questions and Comments below and I will get back to you. I regularly publish on YouTube and christitus.com so if you’d like to see more videos and articles click the subscribe button in the top right.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: