/How to Restore Grub on a Multi-boot Computer

How to Restore Grub on a Multi-boot Computer

I have made my Ferrari 3400 a triple-boot machine. I have Windows XP, Vista RC2 and FC6. The proper way to set it up is to install the XP first, then Vista and finally FC6. Therefore, I can use Grub as my boot manager to switch between Linux and Windows. However, if you decide to install or re-install Windows, the grub is gone and you can boot to Windows only.

Here are the procedures I use to restore grub.

  1. Boot the machine using a KNOPPIX live cd.
  2. Bring up a root shell.
  3. My main Linux partition is on hda8, so I use this command to mount it.
    mkdir /mnt/hda8

    mount -o dev,rw /dev/hda8 /mnt/hda8
  4. I have a separate boot partition hda6, so I need to mount it, too. You can skip this step if you don’t have it.
    mount -o dev,rw /dev/hda6 /mnt/hda8/boot
  5. Finally, I run grub-install to re-install
    grub.
    grub-install --root-directory=/mnt/hda8 /dev/hda
TAGS: