LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 12-07-2005, 03:28 AM   #1
yumener
Member
 
Registered: Oct 2005
Posts: 63

Rep: Reputation: 15
how to recover GRUB without original installation CD


hi, I installed XP on (hd0,0) and FC4 on (hd1,1)

I want to recover the grub on FC4, but now I do not have the
installation CD. I only have a ubuntu live CD.

how should I do it?

I try grub-install /dev/hdb2, nothing changed.
 
Old 12-07-2005, 03:57 AM   #2
yumener
Member
 
Registered: Oct 2005
Posts: 63

Original Poster
Rep: Reputation: 15
I searched on google and try this,

booting from live cd
open a root terminal
run grub
run root (hd1,1)
run setup (hd1)
run quit

then reboot
but it does not work, I never changed /boot/grub on FC4 system,
I guess it should be find, does this relate to MBR?
 
Old 12-07-2005, 04:05 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Yes, it relates to the MBR. To boot grub, you need to install to the MBR - that means by definition hd0. Change the above to "setup (hd0)".

*note:* This will (probably) not resurrect your ability to boot FC4. You will need to enter the appropriate information in menu.lst/grub.conf The installer (used to be Anaconda, presumably still is) sets all this up for you when you install FC.

Search here on LQ should give you enough info to sort it out.
 
Old 12-07-2005, 04:18 AM   #4
yumener
Member
 
Registered: Oct 2005
Posts: 63

Original Poster
Rep: Reputation: 15
after booting from ubuntu live CD, I mount fc4 filesystem on
/mnt/fc4, and copy /mnt/fc4/boot/grub to /boot/grub, in
this directory ther are stage1 stag2 and others including
menu.list. is this step necessary?

because I do not know when I run grub, if it will use /boot/grub
files, if it does, then since I copied from original FC4, it
should be fine.




Quote:
Originally Posted by syg00
Yes, it relates to the MBR. To boot grub, you need to install to the MBR - that means by definition hd0. Change the above to "setup (hd0)".

*note:* This will (probably) not resurrect your ability to boot FC4. You will need to enter the appropriate information in menu.lst/grub.conf The installer (used to be Anaconda, presumably still is) sets all this up for you when you install FC.

Search here on LQ should give you enough info to sort it out.
 
Old 12-07-2005, 04:46 AM   #5
T.Hsu
Member
 
Registered: Jan 2005
Posts: 178

Rep: Reputation: 31
After mount the FC4 partition, you can chroot into it, before that, you may mount a proc filesystem for the chroot system.

Code:
mount -t proc none /mnt/fc4/proc
chroot /mnt/fc4 /bin/bash
Install grub to mbr

Code:
grub-install /dev/hda
If succeed, exit the chroot system

Code:
exit
umount /mnt/fc4/proc
umount /mnt/fc4
Note: grub-install have some additional parameter, use grub-install --help for its detailed usage
 
Old 12-07-2005, 10:51 AM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940
When you observe that "I've reinstalled XP and now Grub has disappeared," stop and consider exactly what has (and has not) happened, and the solution will present itself:
  • XP has installed itself, on the appointed partition, but it has not eliminated nor written-to any other partition, so Grub and Linux are both "still there, somewhere," and untouched.
  • XP has rewritten the Master Boot Record (MBR), this being the bootstrap program loaded by the BIOS which, in turn, loads the Windows-XP boot loader (NTLDR), which loads Windows-XP.
The solution, therefore, is to reinstall the original MBR, which points to Grub. You can do this from any Linux LiveCD. You do need to know upon which drive, and in which partition, the /boot partition is located.

You don't have to reinstall Linux, or Grub, or anything else, because they are still there.

Incidentally, this is one of the reasons why I consistently advocate the use of a separate drive or drives when you want to run Linux and Windows on the same computer. With this strategy, Windows could have overwritten the MBR on its drive with complete impunity... because the BIOS would still be set to read the MBR from the Linux drive, and therefore would continue to boot Linux (that is to say, Grub). Furthermore, if you chose to select the Windows drive as your boot-drive, what Windows would have done would have been exactly correct.

P.S. It is my recollection that you do not have to chroot anywhere to rewrite the Grub MBR. All that Grub needs to know is which drive is to be rewritten, and which partition (counting from zero, remember...) contains the /boot material.

Last edited by sundialsvcs; 12-07-2005 at 10:52 AM.
 
  


Reply



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
Reinstalling Samba doesn't recover the original /etc/samba/smb.conf Akhran Debian 2 11-11-2005 12:54 AM
Any way to restart the original installation setup? orange400 Debian 2 06-13-2005 04:07 AM
recover grub j0hn_galt Linux - Newbie 3 06-11-2005 01:26 AM
how to reinstall/recover grub? Present Linux - General 6 02-10-2004 11:12 PM
GRUB to recover? allenpanther Red Hat 2 02-09-2004 07:19 PM

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

All times are GMT -5. The time now is 01:26 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