News about our company, tutorials about IT and much more you will find in this page.
GRUB is the most important part of the Linux OS. GRUB is the Boot Loader for Linux, hence without it Linux OS cannot be booted or start, it is the most important part in the Linux Booting process. When this GRUB is damaged or corrupted its core files in your Linux OS cannot be booted. In many cases, the GRUB boot loader can mistakenly be deleted, corrupted, or replaced by other operating systems.
The following steps detail the process on how GRUB is reinstalled on the master boot record.Note: This tutorial assumes that you already know how to use our recovery tools available on your client area or at least that you know how to boot your OS into recovery mode using a live/installation CD. If you don’t know how to do this, follow this How to Reset Root Password With Rescue tutorial to learn how to put your server in recovery mode, before proceeding any further.
In this example we will assume that /boot is on sda1 and / on sda2.
Start by entering recovery mode through SSH and mount all the partitions needed:
Now we are going to need to chroot into this newly mounted root partition:
All we need to do now is install GRUB on our drive by accessing the GRUB command line.
grub> root (hd0,0) grub> setup (hd0)
If GRUB returns a successful installation, then you’re all set. Leave recovery mode and your server should boot into the OS again.
In this example we will assume that /boot is on md0 and / on md1 of a RAID1 array.
Start by entering recovery mode through SSH and mount all the partitions needed:
Now we are going to need to chroot into this newly mounted root partition:
All we need to do now is install GRUB on our drive by accessing the GRUB command line, but since we have two drives in a RAID1 configuration we will install GRUB on both drives, so if one fails the server can still boot into the OS through the other.
grub> root (hd1,0) grub> setup (hd1) grub> root (hd0,0) grub> setup (hd0)
If GRUB returns a successful installation, then you’re all set. Leave rescue mode and your server should boot into the OS again.
In this example we will assume that /boot and / are on md0 on a RAID1 array.
Start by entering recovery mode through SSH and mount all the partitions needed:
Now we are going to need to chroot into this newly mounted root partition:
All we need to do now is install GRUB on our drive by accessing the GRUB command line, but since we have two drives in a RAID1 configuration we will install GRUB on both drives, so if one fails the server can still boot into the OS through the other.
grub> root (hd1,0) grub> setup (hd1) grub> root (hd0,0) grub> setup (hd0)
If GRUB returns a successful installation, then you’re all set. Leave rescue mode and your server should boot into the OS again.