LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-02-2007, 12:17 PM   #1
invulner
LQ Newbie
 
Registered: Feb 2007
Posts: 4

Rep: Reputation: 0
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??????????
 
Old 03-02-2007, 12:25 PM   #2
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
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
 
Old 03-02-2007, 02:23 PM   #3
Amenemhet
LQ Newbie
 
Registered: Mar 2007
Location: canada
Distribution: fedora core 5, ubuntu 6.1
Posts: 13

Rep: Reputation: 0
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.. 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.
 
Old 03-03-2007, 02:16 AM   #4
almatic
Member
 
Registered: Mar 2007
Distribution: Debian
Posts: 547

Rep: Reputation: 67
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.
 
Old 03-03-2007, 08:56 AM   #5
Amenemhet
LQ Newbie
 
Registered: Mar 2007
Location: canada
Distribution: fedora core 5, ubuntu 6.1
Posts: 13

Rep: Reputation: 0
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...
 
Old 03-03-2007, 01:11 PM   #6
Dutchy
LQ Newbie
 
Registered: Mar 2007
Location: Netherlands
Distribution: Sidux, Debian, Ubuntu
Posts: 17

Rep: Reputation: 0
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.
 
Old 03-05-2007, 02:21 PM   #7
almatic
Member
 
Registered: Mar 2007
Distribution: Debian
Posts: 547

Rep: Reputation: 67
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.
 
Old 03-16-2007, 06:29 AM   #8
invulner
LQ Newbie
 
Registered: Feb 2007
Posts: 4

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
GRUB for Linux, WindowsXP and MSDOS - HOWTO? Yalla-One Linux - General 4 10-26-2004 02:55 PM
Grub to Boot WindowsXP on SATA daveteusink Linux - Software 4 07-25-2004 06:32 PM
Canot Boot WindowsXP from GRUB snufferz Linux - Newbie 9 04-01-2004 11:34 AM
grub problem....windowsXP will not boot...please help me*tear* bock9259 Linux - Newbie 5 04-01-2004 11:29 AM
GRUB WindowsXP rubenmp Linux - Software 1 09-24-2003 07:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:13 PM.

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