LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 05-16-2006, 05:44 AM   #1
vishallagdev
LQ Newbie
 
Registered: Mar 2006
Location: Melbourne Central Queensland University
Distribution: Fedora 5
Posts: 24

Rep: Reputation: 15
Unhappy 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...
 
Old 05-16-2006, 05:56 AM   #2
redhatrosh
Member
 
Registered: May 2004
Location: Student of University of Mumbai, Maharastra State, India
Distribution: Redhat Linux 9.0, Knoppix LIVE CD, Ubuntu Live CD, Kubuntu Live CD
Posts: 483

Rep: Reputation: 30
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.
 
Old 05-16-2006, 05:59 AM   #3
vishallagdev
LQ Newbie
 
Registered: Mar 2006
Location: Melbourne Central Queensland University
Distribution: Fedora 5
Posts: 24

Original Poster
Rep: Reputation: 15
I think that is what I entered in linux rescue command prompt......
grub-install /dev/hda3, which bounces back as
could not find grub
 
Old 05-16-2006, 06:02 AM   #4
okmyx
Member
 
Registered: May 2004
Location: Cornwall, UK
Distribution: Ubuntu 8.04
Posts: 464

Rep: Reputation: 31
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.
 
Old 05-16-2006, 06:03 AM   #5
vishallagdev
LQ Newbie
 
Registered: Mar 2006
Location: Melbourne Central Queensland University
Distribution: Fedora 5
Posts: 24

Original Poster
Rep: Reputation: 15
I am 100% confident that I used grub.....
I last used lilo on redhat 7.0
 
Old 05-16-2006, 07:00 AM   #6
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,526

Rep: Reputation: 53
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
 
Old 05-16-2006, 07:03 AM   #7
vishallagdev
LQ Newbie
 
Registered: Mar 2006
Location: Melbourne Central Queensland University
Distribution: Fedora 5
Posts: 24

Original Poster
Rep: Reputation: 15
Many thanks for the reply Bob,
But I can't use floppy as Fedora is on my laptop.
 
Old 05-16-2006, 07:28 AM   #8
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,526

Rep: Reputation: 53
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
 
Old 05-16-2006, 08:31 AM   #9
vishallagdev
LQ Newbie
 
Registered: Mar 2006
Location: Melbourne Central Queensland University
Distribution: Fedora 5
Posts: 24

Original Poster
Rep: Reputation: 15
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

Last edited by vishallagdev; 05-16-2006 at 08:32 AM.
 
Old 05-16-2006, 08:41 AM   #10
BobNutfield
Senior Member
 
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,526

Rep: Reputation: 53
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
 
Old 05-16-2006, 08:45 AM   #11
vishallagdev
LQ Newbie
 
Registered: Mar 2006
Location: Melbourne Central Queensland University
Distribution: Fedora 5
Posts: 24

Original Poster
Rep: Reputation: 15
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
 
Old 05-16-2006, 08:50 AM   #12
vishallagdev
LQ Newbie
 
Registered: Mar 2006
Location: Melbourne Central Queensland University
Distribution: Fedora 5
Posts: 24

Original Poster
Rep: Reputation: 15
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
 
Old 05-16-2006, 08:51 AM   #13
vishallagdev
LQ Newbie
 
Registered: Mar 2006
Location: Melbourne Central Queensland University
Distribution: Fedora 5
Posts: 24

Original Poster
Rep: Reputation: 15
Also,
As I select to boot from Windows XP

The new screen says

rootnoverify (hd0,0)
chainloader +1
Entering(something similar) GRUB stage2..
 
Old 05-16-2006, 08:52 AM   #14
vishallagdev
LQ Newbie
 
Registered: Mar 2006
Location: Melbourne Central Queensland University
Distribution: Fedora 5
Posts: 24

Original Poster
Rep: Reputation: 15
Also,
As I select to boot from Windows XP

The new screen says

rootnoverify (hd0,0)
chainloader +1
Entering(something similar) GRUB stage2..
 
Old 05-16-2006, 08:54 AM   #15
vishallagdev
LQ Newbie
 
Registered: Mar 2006
Location: Melbourne Central Queensland University
Distribution: Fedora 5
Posts: 24

Original Poster
Rep: Reputation: 15
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...
 
  


Reply

Tags
grub, windows, xp



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I add Windows XP to Grub boot loader? LUB997 Linux - Software 29 10-17-2009 11:11 AM
Please help me get back into WinXP. I screwed up Grub Boot Loader deived Linux - Newbie 8 10-31-2008 09:23 PM
Grub loader not loading Windows XP or Fedora Core 1 after changing partition size. zetafunc Fedora - Installation 17 06-12-2005 01:27 AM
Screwed up my grub. conf file. Can't get into Fedora? mman49 Fedora 5 05-07-2004 10:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 01:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration