Find the answer to your Linux question:
Page 1 of 5 1 2 3 4 5 LastLast
Results 1 to 10 of 49
Hello all, I'm hoping this will be an easy question with a simple answer. I have an old dual-boot machine that has RedHat 9 and WinXP dual-boot. When I set ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2004
    Posts
    8

    how to restore grub after WinXP reinstall


    Hello all, I'm hoping this will be an easy question with a simple answer.

    I have an old dual-boot machine that has RedHat 9 and WinXP dual-boot. When I set it up, I installed Windows first, and then set up RedHat 9 on the rest of the disk.

    Recently, I re-installed Windows fresh on the FAT32 windows partition. I was hoping (naively) that this wouldn't affect the Linux stuff.

    Of course now the machine boots straight into WinXP, with no knowledge of Grub or the Linux partitions, which should still be intact. Can anyone offer any assistance or point me to some good info on the easiest way to restore Grub to allow me to dual-boot again?

    Thanks!

  2. #2
    Linux Guru Vergil83's Avatar
    Join Date
    Mar 2004
    Posts
    2,407
    Take a look at http://www.linuxforums.org/forum/lin...d-edition.html I have used it several times and it has always worked
    Brilliant Mediocrity - Making Failure Look Good

  3. #3
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Quote Originally Posted by harry349
    Of course now the machine boots straight into WinXP, with no knowledge of Grub or the Linux partitions, which should still be intact. Can anyone offer any assistance or point me to some good info on the easiest way to restore Grub to allow me to dual-boot again?
    boot up from RedHat installation CD/DVD and execute this code at boot: prompt
    Code:
    linux rescue
    chroot /mnt/sysimage
    grub-install /dev/hda
    press Ctrl+D two times. machine will reboot and GRUB will be back in business.





    Casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  4. #4
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,757

    Angry

    Quote Originally Posted by devils_casper
    boot up from RedHat installation CD/DVD and execute this code at boot: prompt
    Code:
    linux rescue
    chroot /mnt/sysimage
    grub-install /dev/hda
    i agree with casper I used this same stuff several times to restore grub and its works fine.
    Come on, harry349 --get back your linux from dirty microsoft
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  5. #5
    Just Joined!
    Join Date
    May 2004
    Posts
    8
    Thanks guys, both for the good reference page, and the quick fix instructions. In the end, both suggested exactly the same thing of course, but that first page will be good for future reference as well.

    Not sure why I didn't find that when I searched the forum. Ah well, thanks again, that sure did the trick!

  6. #6
    TUK
    TUK is offline
    Just Joined!
    Join Date
    Dec 2006
    Posts
    28
    PASTE
    After installing Vista the Vista boot menu appears offering Vista or my XP instal but no option to boot FC6, so I need to re-install GRUB as my first boot menu:

    Here is my drive partition info:

    _________________

    [root@k1 ~]# fdisk -l

    Disk /dev/sda: 250.0 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 6528 52436128+ 7 HPFS/NTFS
    /dev/sda2 6529 13056 52436160 7 HPFS/NTFS
    /dev/sda3 19958 30401 83891428 7 HPFS/NTFS
    /dev/sda4 13057 19957 55432282+ 5 Extended
    /dev/sda5 13057 13069 104391 83 Linux
    /dev/sda6 13070 19957 55327828+ 8e Linux LVM

    Partition table entries are not in disk order

    _________________

    Iv tried the following steps

    _________________
    boot: linux rescue

    # chroot /mnt/sysimage
    # cd /boot/grub

    # grep '#boot' grub.conf
    Ouput:#boot=/dev/sda

    # grub-install /dev/sda4

    # sync;sync;exit;exit
    # reboot

    _________________

    It seem to install on to sda4 and even displays info on what looks like a boot directory to double check that its the GRUB boot partition, before running the exit commands

    But on Reboot the Vista menu appears?

    I then tried your method, first using hda, which complained of not finding some hardware, after using fdisk -l, i tried sda4 and sda5, which seemed to hang or leave the shell, then woudnt accept any more commands...

    linux rescue
    chroot /mnt/sysimage
    grub-install /dev/sda4 and sda5


    I would appreciate some help to recover my GRUB boot menu

  7. #7
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    install GRUB in MBR of Harddisk, not in the boot sector of sda4 or sda5
    Code:
    grub-install /dev/sda



    EDIT: hi TUK ! i posted a suggestion for you again i know you dont prefer to follow my suggestions, so, ignore it.



    Casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  8. #8
    TUK
    TUK is offline
    Just Joined!
    Join Date
    Dec 2006
    Posts
    28
    I think maybe something got lost in translation in previous posts, I respect your advice, and Im sorry if I offended you, All I intended before was to encourage more people to respond to my thread, as I didnt want to force the responsability of all my problem onto you, because I could see how busy you are all over the forum, 'you could say' you seem to be the backbone of this forum

    ok, I tried the following code:

    linux rescue
    chroot /mnt/sysimage
    grub-install /dev/sda


    After the last line the cursor returns to the left of the screen, but doesnt have the shell pre-fix anymore it just flashes, I left it for 15 mins but nothing changed

    I could still type and return but not even 'help' did anything, its as if it had left the shell,

    in the end the only thing that responded was ctrl-alt-del

    on reboot, still the Vista boot menu

  9. #9
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    hmmm... lets move on...

    After the last line the cursor returns to the left of the screen, but doesnt have the shell pre-fix anymore it just flashes, I left it for 15 mins but nothing changed
    I could still type and return but not even 'help' did anything, its as if it had left the shell,
    in the end the only thing that responded was ctrl-alt-del
    on reboot, still the Vista boot menu
    is your BIOS protected by Norton AntiVirus or any other BIOS protection tool? grub-install should work. try
    Code:
    grub-install /dev/hda  --recheck





    Casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  10. #10
    TUK
    TUK is offline
    Just Joined!
    Join Date
    Dec 2006
    Posts
    28
    XP SP2 uses ZoneAlarm FW and Nod32 AV,

    Vista Ultimate Final Build:6000(not beta) uses only built-in/default security
    I heard a rumour that the Vista install rewrites a new boot sector,Iv got a feeling maybe Vista is responsable, it would be interesting to hear if anyone has managed to successfull recover GRUB from this Vista build

    grub-install /dev/hda --recheck
    Should I run this code, or change the hda to sda?

Page 1 of 5 1 2 3 4 5 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •