Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 02-09-2007, 11:49 AM   #1
LQ Newbie
Registered: Feb 2007
Location: Kathmandu
Distribution: Ubuntu Fiesty
Posts: 3

Rep: Reputation: Disabled
reinstalling the GRUB

Previously i had a dual boot system with Fedora Core 5 and windows xp. When i reinstalled windows xp, when i switch on my PC, the GRUB doesnt show up as before and it boots directly into Windows. I do not have the installation DVD of Fedora but i do have the installation CD of Red Hat. I tried using the rescue feature on the Red Hat CD but it fails to detect the Linux partition. Can anyone please help me with it? I need to access the Linux partition. ( I have couple of Live CD's too.. like ubuntu, mandriva and knoppix.. incase they can do the work...) Thank you in advance
Old 02-09-2007, 02:00 PM   #2
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,805

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
Any of the live CDs can be used to re-install GRUB. You need to know the partition numbers where Linux is installed. The live CD can help you determine this also.

Specifically, you need to know the partition which contains the /boot directory. In a typical installation on an IDE/PATA drive, it might be like this:
/dev/hda1 Windows
/dev/hda2 Linux / (including /boot)
/dev/hda3 Linux swap

If yours is different, you will need to adjust the following:
To install GRUB:
boot from live CD
open a terminal
grub    starts the grub shell
root   (hd0,1)    tells grub that /boot is on the 2nd partion of drive 1)
setup  (hd0)     puts grub on the mbr of drive 1
Since you had grub working previously, it should find the config file and everything should work

You'll note that GRUB counts from zero and always uses numbers and "hd"
hda = hd0
sda = hd0
hda1 = hd0,0
hdb2 = hd1,1
Old 02-10-2007, 12:54 PM   #3
LQ Newbie
Registered: Feb 2007
Location: Kathmandu
Distribution: Ubuntu Fiesty
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hi, first of all thanks for the post. I tried that using the live CD of Knoppix. After starting konsole (thats the terminal app.) and typing in grub, the grub prompt showed up.

grub>root (hd0,1) showed the error message
Error 21: selected disk does not exist

when you type
grub>setup (hd0) it says
Error 12: Invalid Device request

I tried the rescue option of the Red Hat Install CD but it fails to detect the partition where i have installed Linux.

Any suggestions?
Old 02-10-2007, 02:22 PM   #4
Registered: Sep 2006
Distribution: Ubuntu 8.04 Hardy Heron LST
Posts: 346

Rep: Reputation: 33
From the live cd in the terminal type

sudo fdisk -l

this will show you where the linux partition is and then just ajust the partitions in the post as pixellany posted


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
Reinstalling Grub michaelsr Fedora - Installation 3 06-27-2006 10:40 AM
Reinstalling grub republicson Linux - Newbie 15 02-28-2006 02:35 PM
reinstalling GRUB vineet7kumar Linux - Newbie 1 01-15-2006 01:02 PM
reinstalling grub. greythorne Ubuntu 23 12-03-2005 02:51 AM
Reinstalling GRUB Petelow Linux - Newbie 1 05-24-2004 05:03 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:31 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration