Restore GRUB

GRUB

GRUB is a multiboot boot loader. The name stands originally for GRand Unified Bootloader.

A boot loader (like GRUB) is the first software program that runs when a computer starts. It is responsible for loading and transferring control to the operating system kernel software (Linux in this case). The kernel, in turn, initializes the rest of the operating system (GNU).

Restoring/Rescuing/Recovering GRUB requires to use a Live Session, any DVD/USB/SD media storage can be used to succeed, with the following instructions:

Mount the Partition with the System

GParted can be used to know the partition name to replace X with the partition letter and Y with its number.

sudo mount /dev/sdXY /mnt

Bind Directories for GRUB’s OS detection

sudo mount --bind /dev /mnt/dev &&
sudo mount --bind /dev/pts /mnt/dev/pts &&
sudo mount --bind /proc /mnt/proc &&
sudo mount --bind /sys /mnt/sys

Mount with Chroot

sudo chroot /mnt

Install, Check and Update

Only the letter has to be indicated (to replace X), usually it is “a”.

grub-install /dev/sdX
grub-install --recheck /dev/sdX
update-grub

Unbind Directories

exit &&
sudo umount /mnt/sys &&
sudo umount /mnt/proc &&
sudo umount /mnt/dev/pts &&
sudo umount /mnt/dev &&
sudo umount /mnt

Reboot the System

sudo reboot

Finally, this procedure is not intended to replace easier solutions like using Rescatux, Super Grub Disk, Boot-Repair or even Grub Customizer but to show how to take advantage from a Live Session to restore GRUB.

3 Likes