LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   windows xp screwed fedora 5 grub loader (https://www.linuxquestions.org/questions/fedora-35/windows-xp-screwed-fedora-5-grub-loader-445291/)

vishallagdev 05-16-2006 05:44 AM

windows xp screwed fedora 5 grub loader
 
Unfortunately I had to re-install Windows XP on my existing Fedora-XP dual boot and Windows XP took over the GRUB. I tried the command “linux rescue” (truly speaking….I really don’t know how to use that but…) by booting from the Fedora DVD and went thru this command “grub-install” /”dev/xxx dir”, which punched me with a bouncer "could not find grub"……......I am sick of re-installing linux(I used to re-install linux every time windows xp screwed the boot loader)…......so please help me with an easy solution….if possible...

redhatrosh 05-16-2006 05:56 AM

1. Where did you issue the command, exactly?

2. the command should be grub-install /dev/hdax where x is the partition, where you are supposed to install it.(mostly where fedora is installed, most likely hda2)

3. So far, I have just learnt this way, of restoring grub..
you can search the forum, or on the Internet and find out.

vishallagdev 05-16-2006 05:59 AM

I think that is what I entered in linux rescue command prompt......
grub-install /dev/hda3, which bounces back as
could not find grub

okmyx 05-16-2006 06:02 AM

Did you choose grub or lilo as the boot loader during the install?

Is possible you have lilo installed. Re-try the linux rescue but reinstall lilo.

There are plenty of posts and instructions on this site if you need help on restoring lilo.

vishallagdev 05-16-2006 06:03 AM

I am 100% confident that I used grub.....
I last used lilo on redhat 7.0

BobNutfield 05-16-2006 07:00 AM

Hi

Try your rescue cd again to try an boot into your Linux. You can do this with:

boot /dev/hdX (here you will need to know what partition contains the root files)

If you do not know where the linux and windows partition are layed out, from the
rescue cd command line, type:

fdisk -l /dev/hda

This will tell you how your disk is partitioned and where Linux is and where Windows is.

Once you can boot into Linux, find where grub is installed at:

locate grub (or find grub)

This will tell you where grub is installed to (e.g. /usr/share/grub/i386)
Change to that directory. From there you can create a grub boot floppy to reinstall grub. Put a floppy into your drive and type:

$ dd if=stage1 of=/dev/fd0 bs=512 count=1

That command writes one block, with a block size of 512, or stage 1.

Then type:

$ dd if=stage2 of=/dev/fd0 bs=512 seek=1

This should have created a bootable GRUB floppy. This will boot to the GRUB command line. From the floppy, try the grub-install /dev/hdaX.

Hope this helps

Bob

vishallagdev 05-16-2006 07:03 AM

Many thanks for the reply Bob,
But I can't use floppy as Fedora is on my laptop.

BobNutfield 05-16-2006 07:28 AM

OK

Are you able to get to a command line from the rescue CD? If so, make sure there is a root prompt. Put the Fedora installation cd into the drive and when it gets to the prompt that says boot: and type: linux rescue

The cd will find your linux installation and ask you if you want to mount /mnt/sysimage, answer yes (you are not harming any files by doing this)

When you get to the command line, type:

chroot /mnt/sysimage

You should now be at a command line as root, so remember that and be careful.

Once at the command line as root, type:

grub

this should take you to another command line like this:

grub>

from there type: find /boot/grub/stage1

From the information that is returned (e.g. (hd0,0), type:

grub> root (hd0,0) (this sets the GRUB root device)

Then, run the setup command to install GRUB. If you have one drive and Windows is on the first partition of the drive and Linux is on the second partition, you would install GRUB to the MBR like this:

grub> setup (hd0)

This will install grub back to your MBR, overwriting what is there. You should then see the grub boot screen when you reboot. You will then have to go to your grub config file in the boot directory to make sure the grub configuration file is correct to also be able to boot windows.

Hope this helps

Bob

vishallagdev 05-16-2006 08:31 AM

Thanks Bob,

The command grub-install /dev/sda1 really worked and I can boot into linux without any problem. The same old boot screen comes up and I can select Fedora 5 and boot into it.
But......but.....when I select Windows XP......Boom.....a screen comes up

rootnoverify (hd0,0)
chainloader +1

and after 3 seconds it goes back to the grub boot screen....and asks me to select the operating system i.e, Fedora 5 or Windows XP......If I select XP.....does the same thing....but boots into Linux perfectly

BobNutfield 05-16-2006 08:41 AM

Glad you got Linux going again. Now let's fix the Windows boot.....

You will need to boot into Linux and go the /boot directory. There you will find a grub.conf file (or menu1st, which is just a symbolic link to the grub file).

As root, open the file to edit it.

Your Linux boot information will look something like this:

title Fedora Core 5 (2.6.X.X)
root (h0,1) #meaning the the second partition on the drive
kernel /boot/vmlinuz-2.6.XX.X ro root=LABEL=/
initrd /initrd-2.6.XX.X

Now, make sure the entry for Windows is correct:

title Windows XP
root (hd0,0)
makeactive
rootnoverify (hd0,0)
chainloader +1

This will boot you back into windows as long as your Windows installation is on the first partition of your hard drive.

Hope this helps

vishallagdev 05-16-2006 08:45 AM

This is what my grub.conf says


# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,2)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sda
default=3
timeout=5
splashimage=(hd0,2)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.16-1.2096_FC5)
root (hd0,2)
kernel /vmlinuz-2.6.16-1.2096_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.16-1.2096_FC5.img
title Fedora Core (2.6.16-1.2080_FC5)
root (hd0,2)
kernel /vmlinuz-2.6.16-1.2080_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.16-1.2080_FC5.img
title Fedora Core 5 (2.6.15-1.2054_FC5)
root (hd0,2)
kernel /vmlinuz-2.6.15-1.2054_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.15-1.2054_FC5.img
title Microsoft Windows XP
rootnoverify (hd0,0)
chainloader +1

vishallagdev 05-16-2006 08:50 AM

This is what my grub.conf says


# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,2)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sda
default=3
timeout=5
splashimage=(hd0,2)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.16-1.2096_FC5)
root (hd0,2)
kernel /vmlinuz-2.6.16-1.2096_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.16-1.2096_FC5.img
title Fedora Core (2.6.16-1.2080_FC5)
root (hd0,2)
kernel /vmlinuz-2.6.16-1.2080_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.16-1.2080_FC5.img
title Fedora Core 5 (2.6.15-1.2054_FC5)
root (hd0,2)
kernel /vmlinuz-2.6.15-1.2054_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.15-1.2054_FC5.img
title Microsoft Windows XP
rootnoverify (hd0,0)
chainloader +1

vishallagdev 05-16-2006 08:51 AM

Also,
As I select to boot from Windows XP

The new screen says

rootnoverify (hd0,0)
chainloader +1
Entering(something similar) GRUB stage2..

vishallagdev 05-16-2006 08:52 AM

Also,
As I select to boot from Windows XP

The new screen says

rootnoverify (hd0,0)
chainloader +1
Entering(something similar) GRUB stage2..

vishallagdev 05-16-2006 08:54 AM

Hi Bob,

I forgot to post it before....
As I select to boot from Windows XP

the new screen says.....

rootnoverify (hd0,0)
chainloader +1

entering (or something similar) GRUB stage2...


All times are GMT -5. The time now is 08:48 AM.