LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Grub vanished after reinstalling windowsxp (https://www.linuxquestions.org/questions/linux-software-2/grub-vanished-after-reinstalling-windowsxp-533970/)

invulner 03-02-2007 12:17 PM

Grub vanished after reinstalling windowsxp
 
I have an dual boot system ,Xp and Fedora core 6.Both were workin fine.i recently reinstalled my windows Xp and after it ,the Xp overwrote my Grub boot loader with its loader,so now i could not get into to linux..How to get my Grub back??????????

Lenard 03-02-2007 12:25 PM

Boot from the Installation media into rescue mode by typing when the menu screen is displayed: linux rescue

Answer a few questions and read the on-screen message about using chroot and follow the advice. When ready type something like;

/sbin/grub-install --recheck /dev/hda

Amenemhet 03-02-2007 02:23 PM

Quote:

Originally Posted by invulner
I have an dual boot system ,Xp and Fedora core 6.Both were workin fine.i recently reinstalled my windows Xp and after it ,the Xp overwrote my Grub boot loader with its loader,so now i could not get into to linux..How to get my Grub back??????????


Yep, sorry to say , but whatever os you install last will install it's boot loader. You may be able to reinstall grub without reinsatalling fed6 by using the install cd, not sure tho, alternatively, you could just boot to linux and reinstall grub as a package maybe...
If you cant see your linux distro in the windows splash then you may be able to edit it using the msconfig in windows, there is a tab for boot.ini there I beleive. No sorry , you cant modify it there..:scratch: I would use the linux install cd, if ya have one. Let us know how ya fixed it please, I would hope a reinstall is unnecessary.

almatic 03-03-2007 02:16 AM

Quote:

Originally Posted by Amenemhet
I would hope a reinstall is unnecessary.

you can just boot a live-cd (like knoppix, kanotix, ubuntu or whatever) and then set a chroot to your linux root directory. Just do:

chroot /your/linux/root/directory

then reinstall grub. man chroot tells you more.

btw. if you use one or more windows installations it's probably better to use the windows bootloader, since the probability of reinstalling/repairing windows is higher. To do that install grub in the startsector of your root partition, then copy it out into a file with

dd if=... of=... bs=512 count=1

Copy the file to c: (where windows has its start files) and make an entry into boot.ini and off you go.

Amenemhet 03-03-2007 08:56 AM

Hey good call almatic, shoulda thought of that too, as I am sometimes running a lot of different os's. One never knows when the hammer will fall...

Dutchy 03-03-2007 01:11 PM

Getting Grub back
 
You all are making this way too difficult.

All you have to do is boot from a live CD, open a terminal, switch to root and type
Code:

grub
that will give you a new prompt, which is grub's prompt.

You then type:
Code:

root (hd0,1)
setup (hd0)

You may have to change the numbers. (hd0,0) = /dev/hda1 (hd0,1) = /dev/hda2 (hd1,0) = /dev/hdb1 and so forth.

almatic 03-05-2007 02:21 PM

Quote:

Originally Posted by Dutchy
You all are making this way too difficult.

All you have to do is boot from a live CD, open a terminal, switch to root and type
Code:

grub
that will give you a new prompt, which is grub's prompt.

You then type:
Code:

root (hd0,1)
setup (hd0)

You may have to change the numbers. (hd0,0) = /dev/hda1 (hd0,1) = /dev/hda2 (hd1,0) = /dev/hdb1 and so forth.


will this install the menu.lst of your root partition (hd0,1) or the menu.lst of the live cd ? I haven't tried this without chroot.

invulner 03-16-2007 06:29 AM

thanks..got grub back
 
hi guys thanks for the help..
dutchy's idea worked well and i got my grub back ...
thanks dutchy and all others

and by the way lenard ur's idea didn't work ...
its just checking whether grub is installed or not..

sorry for the late reply got a little busy here

thanks once again


All times are GMT -5. The time now is 07:58 PM.