Repair damaged Linux GRUB loader

Spread the words

The boot loader (such as Grand Unified Bootloader or 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. The kernel, in turn, initializes the rest of the operating system.

GRUB 2 has replaced what was formerly known as GRUB, which has, in turn, become GRUB Legacy.

If GRUB is corrupted the system might become unbootable.

One of my Debian servers wasn’t booting after an important update. I got the following error at the startup.

grub-error

From the rescue mode, I run ls to see all my drives and partitions.

ls

The server wasn’t installed by me but I supposed the boot partition was probably (vg-root). I run ls (vg-root)/  to check by supposition. And I was rightJ.

ls-2

I run the ls (vg-root)/boot to check the root partition architecture. It is an amd64 here.

ls-boot

After that I booted the system using the install CD. Select rescue mode under Advanced options. And execute a shell on the root partition.

rescueshell

Now run the following commands to update the GRUB.

Grub-mkdevicemap

Grub-install /dev/hda  (this is my boot device)

Update-grub

Restart the server.

That’s it.

Be the first to comment on "Repair damaged Linux GRUB loader"

Leave a comment

Your email address will not be published.


*