LinuxQuestions.org
Visit Jeremy's Blog.
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
 
Search this Thread
Old 01-05-2007, 10:55 PM   #1
itr1275
LQ Newbie
 
Registered: Jan 2007
Posts: 12

Rep: Reputation: 0
Fedora - Grub - Stuck at prompt


I installed Fedora Core 6 on a second HD in my PC. The first drive it Windows XP. I setup the Windows boot loader to boot XP or Linux. When I boot linux I get to a "grub" prompt, then I have to manually point it to my grub.conf file.
Quote:
grub> configfile /grub/grub.conf
Then it boots to Linux and seems to work fine; although, I get a few errors on boot that refer to mounting files systems that don't exist. My question what am I missing to get grub to work correctly?

My file system is setup as follows.
hda -> Windows (NTFS) (Default boot disk)
hdb -> Linux

There are 5 paritions on hdb
hdb1 - Filesystem type is ext2fs, partition type 0x83
hdb2 - Filesystem type is fat, partition type 0xb
hdb3 - Filesystem type unknown, partition type 0x82
hdb4 - Filesystem type unknown, partition type 0x5
hdb5 - Filesystem type unknown, partition type 0x8e

I have tried to reinstall grub.
Code:
# grub-install /dev/hdb
It tells me it worked, however it still doesn't get past the prompt.

The Clues: grub.conf is in a different location
1) The boot grub util finds it in /grub/grub.conf, my shell says /boot/grub/grub.conf
2) Also I have a /boot/boot/grub directory with no grub.conf or device.map file.
3) When I execute grub from the Linux shell it thinks the root is (fd0)
4) When I boot grub thinks the root is (hd1,0) <- Correct!

Grub Files below:
----------------------------------------
Code:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/hdb
default=0
timeout=5
splashimage=(hd1,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.18-1.2798.fc6)
        root (hd1,0)
        kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-1.2798.fc6.img
title Windows
        rootnoverify (hd0,0)
        chainloader +1
----------------------------------------
Code:
# this device map was generated by anaconda
(hd1)     /dev/hdb
(hd0)     /dev/hda
Any advise would be helpful.
 
Old 01-05-2007, 11:21 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,499

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Quote:
Originally Posted by itr1275
I installed Fedora Core 6 on a second HD in my PC. The first drive it Windows XP. I setup the Windows boot loader to boot XP or Linux.
Did you copy over the MBR sector, or the (partition) boot sector record ???.
Please post the dd command you used.
 
Old 01-05-2007, 11:57 PM   #3
itr1275
LQ Newbie
 
Registered: Jan 2007
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by syg00
Did you copy over the MBR sector, or the (partition) boot sector record ???.
Please post the dd command you used.
The only dd I did is make the NT boot loader have an image.
Code:
dd if=/dev/hdb of=/hdb.lnx bs=512 count=1
Then place the hdb.lnx file to [windows]C:\ and add
Code:
C:\boot=hdb.lnx
to the boot.ini?

I redid this too, just to make sure I wasn't using a fd0 image.

Let me clarify this, the NT multi-boot seems to work fine for Windows. For Linux is gets to a grub prompt.

Is there a nother dd I need to do?

Last edited by itr1275; 01-05-2007 at 11:59 PM.
 
Old 01-06-2007, 12:11 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,499

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Yep - close but not quite correct. This is why I asked.
You need the grub code installed it to the partition boot sector record rather than the MBR. Try the following instead.
Code:
 grub-install /dev/hdb1
dd if=/dev/hdb1 of=/hdb.lnx bs=512 count=1
 
Old 01-06-2007, 10:34 AM   #5
itr1275
LQ Newbie
 
Registered: Jan 2007
Posts: 12

Original Poster
Rep: Reputation: 0
That didn't work.

I redid the whole proceedure and used the new file to boot from the NT Loader. It got me just "GRUB" on the screen and it lockedup.

It seems like it can't find the config file. Could the /boot/boot/grub directory have something to do with it?
 
Old 01-06-2007, 11:37 AM   #6
itr1275
LQ Newbie
 
Registered: Jan 2007
Posts: 12

Original Poster
Rep: Reputation: 0
I got it to boot with out sticking by copying the following files to the /boot/boot/grub directory from the /boot/grub directory.

device.map
grub.conf
splash.xpm.gz

It looks like the mbr is using the double nested directory, anyway to fix this?
 
Old 01-06-2007, 12:36 PM   #7
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 18, 19, RHL 5.2
Posts: 546

Rep: Reputation: 43
When doing the grub-install, have you tried...
Code:
grub-install --root-directory=/boot /dev/hdb
You'll know it worked if you can mv the /boot/boot/grub/grub.conf to /boot/grub/grub.conf. If this doesn't work, post the output of fdisk -l. It may be that we are not pointing to the correct partition.

The /dev/hdb will work since this is the MBR on the second hard drive. If it wasn't correct the WinXP bootloader would not have found grub. Since we are not installing to /dev/hda it is not necessary to use /dev/hdb1. Of course you can still do it if you want to. One benefit I see of using /dev/hdb is that you can use the BIOS to boot into FC6 from /dev/hdb if something goes wrong with /dev/hda.

Bill

ps - haven't had this problem myself, but it sounds like it should work.

Last edited by wmakowski; 01-06-2007 at 12:41 PM.
 
Old 01-06-2007, 02:12 PM   #8
itr1275
LQ Newbie
 
Registered: Jan 2007
Posts: 12

Original Poster
Rep: Reputation: 0
That reintalled grub to /boot/boot/grub. All the generated files (stagex) had the current time/date stamp.

Code:
[root@localhost ~]# fdisk -l

Disk /dev/hda: 80.0 GB, 80060424192 bytes
255 heads, 63 sectors/track, 9733 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        9732    78172258+   7  HPFS/NTFS

Disk /dev/hdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1   *           1          13      104391   83  Linux
/dev/hdb2              14       12761   102398310    b  W95 FAT32
/dev/hdb3           12762       12888     1020127+  82  Linux swap / Solaris
/dev/hdb4           12889       30401   140673172+   5  Extended
/dev/hdb5           12889       30401   140673141   8e  Linux LVM
[root@localhost ~]#
Is there a config file that specifice where to look for grub?
 
Old 01-07-2007, 11:04 AM   #9
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 18, 19, RHL 5.2
Posts: 546

Rep: Reputation: 43
I spent a little time reading the grub documentation yesterday. Also installed a version of Gentoo and noticed when it created the boot partition it put a symbolic link to boot in the root of that partition. You will need to move the contents of grub and then remove the boot directory you created. Then, while your (hd1,0) also known as /dev/hdb1 is mounted at /boot, enter the following commands.
Code:
cd /boot
ln -s . boot
This is the quick fix and similar to what you've already done by adding a boot directory. If you want to delve into it further it sounds like either the setup or install commands will rewrite the stage2 file to point to any location you choose for a grub.conf/menu.lst file. I would be interested to hear how you make out if you choose the second option.

Bill

Last edited by wmakowski; 01-07-2007 at 11:13 AM.
 
Old 01-07-2007, 11:38 AM   #10
itr1275
LQ Newbie
 
Registered: Jan 2007
Posts: 12

Original Poster
Rep: Reputation: 0
That doesn't sound like I will fix the problem of pointing to the wrong directory, but just trick into thinking it has the correct one?

There must a config file that tells grub where to look for the grub.conf?
 
Old 01-07-2007, 06:42 PM   #11
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 18, 19, RHL 5.2
Posts: 546

Rep: Reputation: 43
I just noticed something in your first post that could be the source of this behavior. Do you still have the hiddenmenu command in your grub.conf? That would mean the menu doesn't come up and it would boot the default entry after the timeout expires.

To follow up on your last post, you're right the boot symlink is a way to trick it. According to the documentation the install command modifies the stage2 file to point to the location of the config file. It also indicates that by default grub will look at /boot/grub/grub.conf followed by /grub/grub.conf. Those defaults are most likely built into the source code. There are no other configuration files for grub.

Bill

Last edited by wmakowski; 01-07-2007 at 06:45 PM.
 
Old 01-08-2007, 12:58 AM   #12
itr1275
LQ Newbie
 
Registered: Jan 2007
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by wmakowski
... It also indicates that by default grub will look at /boot/grub/grub.conf followed by /grub/grub.conf. Those defaults are most likely built into the source code. There are no other configuration files for grub. ...
I believe this is the default. But why/how would/could I have the MBR looking to /boot/boot/grub. Is there a config file that tells it where to look or where the boot is mounted?

Would the LABEL=/boot make it got to /boot/boot?

fstab file
Code:
/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
sysfs                   /sys                    sysfs   defaults        0 0
/dev/hdb2               /win                    vfat    defaults        0 0
LABEL=SWAP-hda3         swap                    swap    defaults        0 0
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0
 
Old 01-09-2007, 01:15 PM   #13
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 18, 19, RHL 5.2
Posts: 546

Rep: Reputation: 43
This is the way I understand it. At boot time nothing is mounted. Grub finds the stage1 file by looking in the MBR of the drive or a partition. The stage1 file leads it to the stage2 file. The stage2 file is built based on the filesystem when Grub is installed. At that time the location of grub.conf is built into the stage2 file. To my knowledge there are no other configuration files. Locations are defined during install.

The partition label will have no effect on the filesystem. If you were to mount your boot partition at another mount point you will see that the directories and files do not have /boot in front of them.

I don't know what to tell you about why it still wants /boot/boot/grub/grub.conf. Does it find your splashimage at (hd1,0)/grub/splash.xpm.gz okay? While at a grub prompt, you can do this without rebooting, just type grub at a command line. Do a find /grub/grub.conf and see what happens. It should return (hd1,0) with the boot partition mounted or unmounted. You can play with the find command a little and maybe see if things are where they should be. Another thing you might check is the symlink /grub/menu.lst that points to /grub/grub.conf.

Have you taken a look at the install command in the grub documentation at http://www.gnu.org/software/grub? Essentially it says what I wrote above.

Bill

Last edited by wmakowski; 01-09-2007 at 01:20 PM.
 
Old 01-10-2007, 12:51 AM   #14
itr1275
LQ Newbie
 
Registered: Jan 2007
Posts: 12

Original Poster
Rep: Reputation: 0
I really appreciate all of your help on this one.

Once I get to the "GRUB>" prompt I just boot it by typing "configile /grub/grub.conf" and it boots fine. Finds the splash image and everything.

The menu.lst file points correctly to grub.conf.

From what you told me it looks like the MBR is pointing to /boot/boot/grub. However there is not /boot/boot/grub directory, but there is a /grub directory.

http://www.gnu.org/software/grub/gru...aq.en.html#q11
This is along the same lines of what you were saying before.
But the grub install parameters differnt. Perhaps I didn't get the install path correctly. I will work through it again following this guide line and repost.

. . . more RTFM.

Thanks again!
 
Old 01-10-2007, 08:11 AM   #15
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 18, 19, RHL 5.2
Posts: 546

Rep: Reputation: 43
Wow, that is a great find. It is also good to know that my advice was in the right direction. I was off on the hiddenmenu thing though. Glad to help and hope it all works out in the end.

Bill
 
  


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
suse 10.1 stops at grub prompt in multi boot install after XP and Fedora Core 6 ptbedford Linux - Newbie 2 12-15-2006 11:16 AM
Stuck on Command Prompt hkhiroya Debian 9 03-16-2006 01:21 PM
I'm stuck at a command prompt logiplex Linux - Software 2 09-08-2004 07:02 PM
installs of fedora and lycoris boot to grub prompt mrtessster LinuxQuestions.org Member Success Stories 2 08-16-2004 07:01 PM
RH 8.1, computer stuck at GRUB prompt, wont respond Sizam Linux - Software 4 08-25-2003 11:27 PM


All times are GMT -5. The time now is 06:44 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration