• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4375
  • Last Modified:

how to recover grub loader after reinstall windows xp

I had a dual system (RedHat and win xp in two hard drives). After winxp crashed down, I reformated the windows partition and reinstalled xp. But I lost the grub boot loader and can't boot the linux. Can any body tell me how to get my linux back  instead of installing a new one?
0
delphet
Asked:
delphet
1 Solution
 
Cygnus78Commented:


You do not have a floppy to boot into Linux with ? If not I think you can boot from the red hat cd to get into linux (have not tried this with red hat though, it works on suse linux)

If you somehow manage to get into red hat again you maybe want to create a boot floppy with grub, then you wont risk to do the opposite of what you just did (not getting into windows after reinstalling grub).

You can do this with the following commands:

# cd /usr/share/grub/i386-pc
# dd if=stage1 of=/dev/fd0 bs=512 count=1
1+0 records in
1+0 records out
# dd if=stage2 of=/dev/fd0 bs=512 seek=1
153+1 records in
153+1 records out

By the way you can read about dual boot on red hat systems here:

http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/install-guide/ch-x86-dualboot.html

0
 
garisoainCommented:
You can also, booting with your Linux instalation CD or with a Rescue Disk, configure the Windows XP boot loader to start linux...

1. When logged into linux, use the following command.

If your linux boot partition is /dev/hda1 and your WinXP partition is mounted on /winxp/

# dd if=/dev/hda1 of=/winxp/bootsect.lnx bs=512 count=1

2. Then, edit /winxp/boot.ini and add this line:

C:\bootsect.lnx="Linux"

3. Reboot, you should be able to select and start linux from your Windows boot menu.

For Rescue Disks, check this page:
http://www.ibiblio.org/pub/Linux/system/recovery/!INDEX.html

Hope this helps you, good luck !
-Garisoain.
0
 
paultje3181Commented:
You can just download a mini-distro to get into linux. Then edit your lilo.conf file so that you can boot with lilo.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
delphetAuthor Commented:
Hi,

Thanks for all the messages from you. I tried them but they don't work. There is no /winxp directory in my machine so garisoain's suggestion can't work. According to Cygnus78's message, I should write someting to the floppy (/dev/fd0 is the floppy drive). I don't think that can help and it really didn't. I guess I may not describe my problem clearly. I had a dual boot system (RedHat and Winxp) before. When I reinstalled XP, I can't get GRUB boot loader run when booting the machine. It goes directly to XP. I don't want to reinstall RedHat. So my question is how I can recover the existing GRUB and make it work again. Hope that makes my situation clear.

Thanks again.

-delphet
0
 
CleanupPingCommented:
delphet:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
paullamhkgCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is to:

Be PAQ'd/Points No Refunded

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Paul
EE Cleanup Volunteer
0
 
YensidModCommented:
PAQed per request/recommendation - No Refund

YensidMod
Community Support Moderator
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now