This page looks best with JavaScript enabled

Grub Rescue | Repairing your Bootloader

 ·  β˜• 2 min read  ·  ✍️ Chris Titus

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

grub

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

Video Walkthroughs

grub-yt
Note: YouTube Video - Hold Ctrl + Left Click to open in new window

I live stream on Twitch and encourage you to drop in and ask a question. I regularly publish on YouTube and christitus.com, but if you need immediate assistance, check out the Terminal Cafe with Discord Invite Link.

Share on

Chris Titus
WRITTEN BY
Chris Titus
Tech Content Creator