How to reinstall GRUB boot loader using a GRUB floppy

Many of those who use dual booting systems with Windows and Linux must have come across GRUB error. Its easy to reinstall GRUB if you have a bootable GRUB floppy.

Here is how to reinstall grub in a Debian system.

1. Creating GRUB floppy: It will be better to have a GRUB floppy everytime with you. To create one, after loading Linux, insert a floppy in drive and type
grub-floppy /dev/fd0
2. Installing GRUB: Configure system to boot first from floppy and insert the GRUB floppy.
In the grub> prompt, type the following commands.
grub> root (hd0, x)
here x refers to your Linux installed partition. You can find it by pressing the TAB key after root (hd0,
grub> kernel /boot/vmlinuz root=/dev/hda
Kernel version is automatically detected by pressing TAB key after typing grub> kernel /boot/vmlinuz If the value of x in the previous step was 2, you must type 3 in the place of x+1

grub> initrd /boot/initrd
grub> boot
3. Now, you will be able to boot to the pre installed Linux in your system. After logging in as root, type the following in root terminal.

grub-install /dev/hda

After this, you will be able to access the Linux installed in your system from the boot menu.