Where's my GRUB?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AmberJain
    Recognized Expert Contributor
    • Jan 2008
    • 922

    Where's my GRUB?

    Well,
    I installed Red hat linux a few days ago and recently I tried to repair my XP installation on same machine. It displayed the following message when I expected it to repair my XP-"Setup is performing requested operations on your hard disk" or something similar (I don't actually remember the message displayed). But instead of repairing XP it did something unexpected. My GRUB boot loader got lost into nowhere.

    When I tried booting with DamnSmallLinux LiveCD and searched for older Linux parttions on my PC, then I found that both Linux and Linux Swap partitions are fine and all files are in order. I have set of Redhat bootable CD's .

    I want to bring GRUB back so that I can boot into Redhat linux installed on my PC.

    Hope I have given enough information and if you expert need more information, tell me so that I can provide them to you.

    THANKS in advance........ ......

    ============
    AmbrNewlearner
    ============
  • micmast
    New Member
    • Mar 2008
    • 144

    #2
    You gave enough info, you could have also said I tried to repair XP after installing any linux distro...

    Microsoft doesn't care that you have grub/lilo or any other bootloader installed and will simply remove it and install the windows bootloader. There are a few solutions to solve this problem.

    The first is use the SuperGrub Boot Disk: http://www.supergrubdisk.org/

    Another option, but a bit more difficult, is using a liveCD (I would say ubuntu or something, or maybe even fedora/redhat, but I haven't tried those). When you use a liveCD you have to follow the following steps:
    (I assume everything below is done as root in a terminal)

    1. mount your linux partition; for example: mount /dev/sda2 /mnt/sda2
    2. Mount /dev, /proc and /sys to the correct directories of your original system
    mount --bind /dev /mnt/sda2/dev
    mount --bind /proc /mnt/sda2/proc
    mount --bind /sys /mnt/sda2/sys

    3. The next step is going back to your orginal machine.
    chroot /mnt/sda2

    Now everything you do, will be applied to the linux version on your sda2 device instead of on the CDROM.

    4. Reinstall grub
    grub-install

    5. If you want to leave the chroot environment, you have to do the following steps:

    umount /proc (Not 100% sure this is required)
    CTRL+D (The keycombination)
    umount /mnt/sda2/dev
    umount /mnt/sda2/proc
    umount /mnt/sda2/sys

    That should reinstall the grub on your MBR. But the supergrubdisk is a lot quicker & easier :D

    Hope this helps

    Comment

    • AmberJain
      Recognized Expert Contributor
      • Jan 2008
      • 922

      #3
      THANKS micmast......I will try as you advised me to do and then I will reply back with the result.

      ============
      AmbrNewlearner
      ============

      Comment

      • AmberJain
        Recognized Expert Contributor
        • Jan 2008
        • 922

        #4
        Originally posted by micmast
        You gave enough info, you could have also said I tried to repair XP after installing any linux distro...

        Microsoft doesn't care that you have grub/lilo or any other bootloader installed and will simply remove it and install the windows bootloader. There are a few solutions to solve this problem.

        The first is use the SuperGrub Boot Disk: http://www.supergrubdisk.org/

        Another option, but a bit more difficult, is using a liveCD (I would say ubuntu or something, or maybe even fedora/redhat, but I haven't tried those). When you use a liveCD you have to follow the following steps:
        (I assume everything below is done as root in a terminal)

        1. mount your linux partition; for example: mount /dev/sda2 /mnt/sda2
        2. Mount /dev, /proc and /sys to the correct directories of your original system
        mount --bind /dev /mnt/sda2/dev
        mount --bind /proc /mnt/sda2/proc
        mount --bind /sys /mnt/sda2/sys

        3. The next step is going back to your orginal machine.
        chroot /mnt/sda2

        Now everything you do, will be applied to the linux version on your sda2 device instead of on the CDROM.

        4. Reinstall grub
        grub-install

        5. If you want to leave the chroot environment, you have to do the following steps:

        umount /proc (Not 100% sure this is required)
        CTRL+D (The keycombination)
        umount /mnt/sda2/dev
        umount /mnt/sda2/proc
        umount /mnt/sda2/sys

        That should reinstall the grub on your MBR. But the supergrubdisk is a lot quicker & easier :D

        Hope this helps
        Instead of going with supergrubdisk, I tried manual recovery of GRUB as you advised.
        I booted into damn small linux live cd and then I did as you advised. Everything went fine till following command.
        chroot /mnt/hdd2

        When I executed above command, I got on to bash of my hdd2 partitions linux.
        Then I entered following at the terminal--->
        grub-install

        But I get a error- "Format of install_device not recognised". I tried various combinations for install_device but couldnot find the appropriate one. So what should I do now.

        THANKS for your help....

        Comment

        • micmast
          New Member
          • Mar 2008
          • 144

          #5
          o sorry, I made a small error
          it should be: grub-install /dev/<your harddrive>

          That should install it.

          Comment

          • AmberJain
            Recognized Expert Contributor
            • Jan 2008
            • 922

            #6
            Originally posted by micmast
            o sorry, I made a small error
            it should be: grub-install /dev/<your harddrive>

            That should install it.
            Hello,
            I did as you advised but still GRUB doesnot comes up.......
            _______________
            grub-install /dev/hdd5

            I have enclosed below a screenshot of terminal when I executed the commands at Damn Small Linux terminal. (point your mouse pointer over the image so that you can view the enlarged and original image).



            It says- "installati on finished-No errors reported". But my GRUB sill don't appear when I boot my PC i.e. IBM/Windows bootloader is still the defaullt bootloader.

            What is wrong now.
            THANKS for your help in advance........ .

            Comment

            • AmberJain
              Recognized Expert Contributor
              • Jan 2008
              • 922

              #7
              SUCCESS.......
              problem solved. I made a mistake. I typed

              grub-install /dev/hdd5
              instead of

              grub-install /dev/hdd.

              THANKS for help...........

              Comment

              Working...