Link to home
Start Free TrialLog in
Avatar of delphet
delphet

asked on

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?
Avatar of Cygnus78
Cygnus78



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

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.
You can just download a mini-distro to get into linux. Then edit your lilo.conf file so that you can boot with lilo.
Avatar of delphet

ASKER

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
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.
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
ASKER CERTIFIED SOLUTION
Avatar of YensidMod
YensidMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial