LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 04-20-2005, 03:13 PM   #1
teronslair
LQ Newbie
 
Registered: Nov 2004
Location: Bucharest Romania
Distribution: fedora
Posts: 2

Rep: Reputation: 0
Unhappy Recover grub bootloader after win install!


I am using Fedora Core 3 and recently i had to reinstall Winxp on my system. Problem is I no longer have access to the Grub and I cannot boot Linux anymore. Please help me with some advice on how to avoid this on future Windows installations. Because, trust me, they are needed. Is there a software that saves my boot config and rewrites it after a new install? I really cannot afford to install 3Gb worth of Linux every time!!! Help!
 
Old 04-20-2005, 03:16 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
You should be able to boot with fedora cd1 and at the boot prompt enter "linux rescue".

Once booted run:
chroot /mnt/sysimage
/sbin/grub-install /dev/hda

This should put grub back on the mbr.
 
Old 04-20-2005, 03:21 PM   #3
jsutton
Member
 
Registered: Nov 2003
Location: Greenville, SC, USA
Distribution: (K)ubuntu 5.04 / Fedora 4
Posts: 113

Rep: Reputation: 15
If you still have the Fedora Install CD:

1. Boot off the cd.
2. At the boot prompt, type 'linux resucue' (no quotes) and hit enter.
3. continue with the default options through the prompts.
4. when you get to a bash prompt, type 'chroot /mnt/sysimage' (I think that's the path).
5. then, type '/sbin/grub-install /dev/hda' (assuming, hda is your system drive).
6. reboot your computer off the drive.

If that doesn't work, I have a different procedure, but I don't remember all of the steps right off the top of my head.

*edit: Aw junk, someone beat me to the answer.....
 
Old 06-29-2006, 12:18 PM   #4
cDn_NeMeSiS
LQ Newbie
 
Registered: Jun 2006
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by jsutton
If you still have the Fedora Install CD:

1. Boot off the cd.
2. At the boot prompt, type 'linux resucue' (no quotes) and hit enter.
3. continue with the default options through the prompts.
4. when you get to a bash prompt, type 'chroot /mnt/sysimage' (I think that's the path).
5. then, type '/sbin/grub-install /dev/hda' (assuming, hda is your system drive).
6. reboot your computer off the drive.

If that doesn't work, I have a different procedure, but I don't remember all of the steps right off the top of my head.

*edit: Aw junk, someone beat me to the answer.....
another way to do this is the same but instead 'grub-install /dev/hda' because sometimes show a error of bios no foud or something, it is because the devices are mapped and /dev/hda does not work and you can try if the otrhr solution don work type
'/dev/mapper/pdc_ebajbgad' and its the same device hda mapped to pdc_ebajbgad and should be work

sorry for my english
 
Old 07-02-2006, 01:24 AM   #5
teronslair
LQ Newbie
 
Registered: Nov 2004
Location: Bucharest Romania
Distribution: fedora
Posts: 2

Original Poster
Rep: Reputation: 0
Talking Thanks guys

Ok, thanks a lot for the advice. As i'll use Linux more and more i'll get the hang of this.
 
Old 02-15-2007, 08:51 AM   #6
towsonu2003
Member
 
Registered: May 2005
Distribution: Ubuntu 6.06
Posts: 129

Rep: Reputation: 15
there is a nice guide at http://wiki.ubuntu.com/RecoverGrub in case anyone needs

Last edited by towsonu2003; 02-15-2007 at 09:08 AM.
 
Old 02-15-2007, 09:01 AM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,800

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
As for avoiding this in the future:
Put GRUB on a floppy
 
Old 02-15-2007, 09:09 AM   #8
towsonu2003
Member
 
Registered: May 2005
Distribution: Ubuntu 6.06
Posts: 129

Rep: Reputation: 15
Quote:
Originally Posted by pixellany
As for avoiding this in the future:
Put GRUB on a floppy
not to troll, but many computers don't come with a floppy drive nowadays, especially laptops.
 
Old 02-15-2007, 11:54 AM   #9
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Grub put on a floppy----->Chapter 3.1 of Grub Manual refers

Grub put on a CD--------->Chapter 3.4 of Grub Manual refers

A bootable Grub floppy or CD is the most lethal weapon in the booting business.

There is no PC system such weapon cannot boot.

If a PC system is bootable then a Grub floppy or CD can fire it up and you don't even need to tell Grub what that system is.

For a Linux you can remove every trace of its boot loader and Grub can still fire it up.

If you know how to use a bootable Grub floppy or Grub CD then you can kiss all your booting problems good bye.

---------------------------------------------------

As an example how I would use Grub to solve the OP problem as follow.

(1) I boot up a Grub CD (or a floppy) to get a Grub prompt.

(2) I type
Code:
geometry (hd0)
to see the hard disk partitions layout. Since this is a Fedora C3 it must has a Type 83 partition for /boot, a Type 8e for LVM and a Type 7 for the XP. FC3 may have several Type 83 partitions if LVM is not used but the /boot is always at the front. Say the first type 83 partition is number 2 then I can fire up Fedora by
Code:
root (hd0,2)
configfile /grub/grub.conf
--------------------------
If I want to be lazy I can ask Grub to find out which partition has grub.conf by command
Code:
find grub.conf
and use that partition reference for the above "root" command.

I can also restore the Grub without booting up Fedora by
Code:
root (hd0,2)
setup (hd0)
the above is exactly what would be achieved by Fedora's installation CD except it is done with a Linux and Grub can do it without a boot-up Linux.

Also if the Fedora still doesn't boot I can ask Grub to diaplay its cconfiguration file by
Code:
 cat (hd0,2)/grub/grub.conf
I can then follow line by line to type the same command at the terminal boot Fedora "manually" and vary the parameters at the same time if needed.

A Grub floppy or CD can fire up the XP, say if it is in the 1st partition, by
Code:
root (hd0,0)
chainloader +1
boot
Grub counts from 0 so hda3 is (hd0,2) and so on.

You see one humble Grub floppy (with only 2 files inside) or Grub CD (with only one file inside) can solve your booting problems for good!

Last edited by saikee; 02-15-2007 at 12:16 PM.
 
Old 02-15-2007, 11:58 AM   #10
towsonu2003
Member
 
Registered: May 2005
Distribution: Ubuntu 6.06
Posts: 129

Rep: Reputation: 15
link to manual for convenience http://www.gnu.org/software/grub/man...l#Installation

PS. "If you know how to use a bootable Grub floppy or Grub CD" doesn't look so easy to grasp

Last edited by towsonu2003; 02-15-2007 at 12:18 PM.
 
Old 02-15-2007, 12:35 PM   #11
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
I got nothing to do with Grub and just like you I am no more than an end user.

My Grub Manual is exactly the same one you can read from the Internet and does not contain one extra word in it.

I would say it is fair to say Grub Manual isn't easy to understand for a beginner because Grub's ambition lies beyond Linux and so the notations, the methods, the explanations are generic. However once you start to refer to it when you have a problem you can see a solution there.

Grub never told us it can boot every system manually, nor it ever makes the claim that there is no PS system it can't boot. The folks who wrote Grub were only interested to provide the functionalities. It is up to the users to apply the tool.

In a nutshell a user should look upon Grub as a mini operating system loaded before the Linux kernel. There is a lot he/she can do with this mini operating system which is lightening fast, seldom hangs and is remarkably flexible.

My whole point is you can talk to Grub, interact with it and let this bugger teaches you all the tricks it can do. Grub always responds error or warning if it cannot accept a command so one can learn from Grub very quickly by booting systems manually. The commands on how to boot systems are already written in grub.conf (or menu.lst). The whole thing is a lot easier than many people think.
 
Old 02-15-2007, 01:02 PM   #12
Hitboxx
Senior Member
 
Registered: Mar 2006
Location: India
Distribution: Fedora
Posts: 1,562
Blog Entries: 3

Rep: Reputation: 51
Yes definitely, Grub is so easy and yet powerful, reading and applying the read is the only way to go, i read a lot about grub, learning along the way and now i find myself absolutely at ease with it.

Edit: And saikee, all your links have become my bookmarks long back, thanks for that, and that 100+ systems blew away many of my Windows friends,lol

Last edited by Hitboxx; 02-15-2007 at 01:09 PM.
 
Old 02-15-2007, 04:16 PM   #13
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
shrikant.odugoudar,

Glad you found Grub easy. So I haven't been telling lies after all.
 
Old 08-12-2008, 10:23 AM   #14
robertri
LQ Newbie
 
Registered: Aug 2006
Posts: 4

Rep: Reputation: 0
Super grub problem

Hey
Hope it's not of topic. I tried Super Grub Disk, Auto Super Grub Disk that is, and it installed fine. But when i booted with it, it found the partition with boot files (grub.conf), but it hanged when trying to boot.. Is there something wron with my system?

Booting with a cd. Seems pretty unpractical to have a cd every time you start the computer...

Last edited by robertri; 08-12-2008 at 10:26 AM.
 
Old 12-16-2008, 12:33 AM   #15
sirajuddin
LQ Newbie
 
Registered: Dec 2008
Posts: 2

Rep: Reputation: 0
Smile Thanks very much.

Quote:
Originally Posted by david_ross View Post
You should be able to boot with fedora cd1 and at the boot prompt enter "linux rescue".

Once booted run:
chroot /mnt/sysimage
/sbin/grub-install /dev/hda

This should put grub back on the mbr.


Thanks very much David Ross. Its very useful for me. 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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to recover the password of bootloader reply2vinay Linux - Software 6 03-10-2008 10:14 PM
Recover Redhat BootLoader saeed144 Linux - General 7 11-02-2005 03:54 PM
Linux Redhat recover Bootloader saeed144 Linux - Newbie 1 10-12-2005 12:48 PM
Recover of /etc/inittab from GRUB Bootloader in RED HAT OS 8 sujith_marar Red Hat 1 06-23-2004 01:19 PM
How to install Grub bootloader to MBR from command line sleddog Linux - Software 2 04-08-2004 02:17 PM


All times are GMT -5. The time now is 11:43 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration