Steps to recover GRUB BootLoader in Linux

Boot loader is  also called a boot manager, BootLoader is a small program that places the operating system (OS) of a computer into memory.
When a computer is powered-up or restarted, the basic input/output system (BIOS) performs some initial tests, and then transfers control to the Master Boot Record (MBR) where the boot loader resides. Most new computers are shipped with boot loaders for some version of Microsoft Windows or the Mac OS. If a computer is to be used with Linux, a special boot loader must be installed. The most common bootloader for Linux OS  is LILO (LInux LOader), LOADLIN (LOAD LINux) and  GRUB (GRand Unified Bootloader).  

1. Boot your computer with the first CD of  Redhat/Fedora in your CD drive (You have to enable your PC to boot from the cdrom, which you can set in the BIOS settings). At the installation boot prompt that you get, enter the following command:

boot: linux rescue

The installer will ask you a few questions like the language you would like to use, the type of keyboard etc. Then, if you have linux previously installed on your machine, the Fedora/Redhat installer will automatically detect it and mount it in the /mnt/sysimage directory. Once the linux partition is mounted, you are dropped into the command shell prompt.
2. Make your newly mounted directory the root (or parent) directory. Run the following command to do this

# chroot /mnt/sysimage

Now you are in the shell with respect to the parent directory which is the linux partition on your harddisk. the steps needed depends on which bootloader you are using. You should know  what is the device node of your harddisk partition housing your MBR. In most cases, it is /dev/hda if you have an IDE harddisk. But if you have a SCSI harddisk, it will be /dev/sda…. and press Enter.
3. Execute the following command to Restore GRUB
grub-install is to install GRUB boot loader on to your MBR, And then type exit to reboot the machine. Now your GRUB boot loader is fixed.

# grub-install /dev/hda

About mohan

This is Mohan Jayapalan author of TechPages Blog.I am a part time blogger and Currently working for private Software Concern.

© Copyright 2010-2016 · All Rights Reserved · Powered by WordPress ·