Reinstalling the GRUB Boot Loader

If you have a dual-boot system that runs both Windows and Linux on the same machine, you may need to reinstall your GRUB boot loader. This problem occurs if your Windows system completely crashes beyond repair and you have to install a new version ofWindows, or you are adding Windows to your machine after having installed Linux.

Windows will automatically overwrite your boot loader (alternatively, you could install your boot loader on your Linux partition instead of the master boot record, MBR). You will no longer be able to access your Linux system.

To reinstall your boot loader, first boot from your Linux DVD/CD-ROM installation disk, and at the menu select Rescue Installed System. This boots your system in rescue mode.

Then use grub-install and the device name of your first partition to install the boot loader. Windows normally wants to be on the first partition with the MBR. You would specify this partition.

At the prompt, enter grub-install/dev/sda1 to reinstall your current GRUB boot loader, assuming that Windows is included in the GRUB configuration.

You can then reboot, and the GRUB boot loader will start up. If you are adding Windows for the first time, you will have to add an entry for it in the /boot/grub/menu.lst file to make it accessible from the boot loader.

 





Tags: boot,boot loader,grub,mbr

Related Articles