LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   RH 8 - boots fine from floppy, not from Grub (https://www.linuxquestions.org/questions/linux-newbie-8/rh-8-boots-fine-from-floppy-not-from-grub-44687/)

equack 02-09-2003 08:26 AM

RH 8 - boots fine from floppy, not from Grub
 
I've been reading the man pages, how-tos, and posts about Grub and still can't seem to find the solution to my problem.

Yes, I know - use LILO. I've seen the posts. Spare me.

This is a clean installation of Red Hat 8.0 download edition. Booting from the floppy works fine, no matter what init level I choose. However, booting from the hard drive just brings me to a single line that simply says:

GRUB (blinking cursor)
Characters typed here aren't even echoed on the screen.:Pengy:

here are the config details:

fdisk -l > /usr/grubconfig.txt
Disk /dev/hda: 255 heads, 63 sectors, 1247 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 1215 9655065 83 Linux
/dev/hda3 1216 1247 257040 82 Linux swap

cat /etc/grub.conf >> /usr/grubconfig.txt
# 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/hda2
# initrd /initrd-version.img
boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,1)/grub/splash.xpm.gz
title Red Hat Linux (2.4.18-14)
root (hd0,1)
kernel /vmlinuz-2.4.18-14 ro root=/dev/hda2=/
initrd /initrd-2.4.18-14.img

ls -C /boot >> /usr/grubconfig.txt
boot.b kernel.h module-info-2.4.18-14 vmlinuz
chain.b lost+found os2_d.b vmlinuz-2.4.18-14
config-2.4.18-14 message System.map
grub message.ja System.map-2.4.18-14
initrd-2.4.18-14.img module-info vmlinux-2.4.18-14

I have included the /boot listing as proof that the files grub.conf points to are there.

It seems to not be related to grub.conf because it doesn't matter what I change it to, I still get the same response.

I ran (in init level 1) grub-install /dev/hda and it appeared to run successfully. Still no change, but it seems to me that Grub is in the mbr or it wouldn't even display GRUB.

I am determined to get Grub working, not because I have any preference, but because I want to figure this out. It is working fine booting from the floppy, so I don't have to get it working any time soon.

da_kidd_er 02-10-2003 12:03 AM

try using the command below:

grub-install /dev/hda --force-lba

born4linux 02-10-2003 02:39 AM

there is something wrong with ur grub.conf:

title Red Hat Linux (2.4.18-14)
root (hd0,1) ---> this should be (hd0,0)

as what grub.conf says:

# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)

so u need root(hd0,0).

boot via floppy, edit /boot/grub/grub.conf, reboot and see if this worked.

equack 02-10-2003 09:55 AM

Thanks for the suggestions, but neither of them worked. Still the response is:
GRUB (Blinking Cursor)
Shouldn't Grub at least bring up some sort of menu? I would think that if grub.conf were wrong, then it would error out tring to find vmlinuz, but I get nothing at all. I really had hopes for the --force-lba suggestion, but alas, it was not to be.

equack 02-10-2003 09:58 AM

BTW, this is now my grub.conf:
# 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/hda2
# initrd /initrd-version.img
boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.18-14)
root (hd0,0)
kernel /vmlinuz-2.4.18-14 ro root=/dev/hda2
initrd /initrd-2.4.18-14.img

born4linux 02-10-2003 07:09 PM

can u post the contents of the *.conf file in your boot floppy?

equack 02-10-2003 08:00 PM

floppy contents:
boot.msg initrd.img ldlinux.sys syslinux.cfg vmlinuz

contents of syslinux.cfg:
default linux
prompt 1
display boot.msg
timeout 100
label linux
kernel vmlinuz
append initrd=initrd.img ro root=/dev/hda2

Also I found the following at http://www.gnu.org/manual/grub-0.92/...e/FAQ.html#FAQ
I have a separate boot partition and GRUB doesn't recognize it...
There are several solutions for this situation...
(3)Install GRUB with the command install, to specify the paths of GRUB images explicitly. Here is an example:
grub> root (hd0,1)
grub> install /grub/stage1 d (hd0) /grub/stage2 p /grub/menu.lst


However, when I tried to follow these instructions exactly, I received a 'file not found' error running the 'install' command. I then repeated it, substituting root (hd0,0) instead of root (hd0,1) as per instructions and the 'install' command completed successfully.

But even after all this I still have the same result.

equack 02-10-2003 11:47 PM

more info:
I just created a grub boot floppy (http://www.gnu.org/manual/grub-0.92/...0boot%20floppy) so I now know what grub is supposed to look like. I can tell from comparing the differences that grub on my mbr never even finds Stage1. Not sure what this means yet, but it's another clue to the puzzle.

I told you I'm determined to figure this out!

born4linux 02-11-2003 02:34 AM

here is the listing of my /boot:

-rw-r--r-- 1 root root 5824 Sep 6 04:53 boot.b
-rw-r--r-- 1 root root 612 Sep 6 04:53 chain.b
-rw-r--r-- 1 root root 42257 Jan 31 20:05 config-2.4.18-24.8.0
drwxr-xr-x 2 root root 1024 Feb 7 13:27 grub
-rw-r--r-- 1 root root 129514 Feb 7 13:26 initrd-2.4.18-24.8.0.img
-rw-r--r-- 1 root root 473 Feb 6 20:09 kernel.h
drwx------ 2 root root 12288 Feb 6 19:56 lost+found
-rw-r--r-- 1 root root 23108 Sep 6 22:05 message
-rw-r--r-- 1 root root 21282 Sep 6 22:05 message.ja
lrwxrwxrwx 1 root root 25 Feb 7 13:26 module-info -> module-info-2.4.18-24.8.0
-rw-r--r-- 1 root root 15436 Jan 31 20:05 module-info-2.4.18-24.8.0
-rw-r--r-- 1 root root 640 Sep 6 04:53 os2_d.b
lrwxrwxrwx 1 root root 24 Feb 7 13:26 System.map -> System.map-2.4.18-24.8.0
-rw-r--r-- 1 root root 503847 Jan 31 20:05 System.map-2.4.18-24.8.0
-rwxr-xr-x 1 root root 3171861 Jan 31 20:05 vmlinux-2.4.18-24.8.0
lrwxrwxrwx 1 root root 21 Feb 7 13:26 vmlinuz -> vmlinuz-2.4.18-24.8.0
-rw-r--r-- 1 root root 1112073 Jan 31 20:05 vmlinuz-2.4.18-24.8.0

and here is my /boot/grub:

-rw-r--r-- 1 root root 82 Feb 6 20:24 device.map
-rw-r--r-- 1 root root 10848 Feb 6 20:24 e2fs_stage1_5
-rw-r--r-- 1 root root 9776 Feb 6 20:24 fat_stage1_5
-rw-r--r-- 1 root root 8864 Feb 6 20:24 ffs_stage1_5
-rw------- 1 root root 663 Feb 7 13:27 grub.conf
-rw-r--r-- 1 root root 11072 Feb 6 20:24 jfs_stage1_5
lrwxrwxrwx 1 root root 11 Feb 6 20:24 menu.lst -> ./grub.conf
-rw-r--r-- 1 root root 9280 Feb 6 20:24 minix_stage1_5
-rw-r--r-- 1 root root 12512 Feb 6 20:24 reiserfs_stage1_5
-rw-r--r-- 1 root root 7985 Sep 6 22:05 splash.xpm.gz
-rw-r--r-- 1 root root 512 Feb 6 20:24 stage1
-rw-r--r-- 1 root root 130340 Feb 6 20:24 stage2
-rw-r--r-- 1 root root 8576 Feb 6 20:24 vstafs_stage1_5
-rw-r--r-- 1 root root 12552 Feb 6 20:24 xfs_stage1_5


compare it with the contents of your /boot and /boot/grub directories. the vmlinuz, System.map and config.* version tags might be different.

deadbug 02-11-2003 04:45 PM

equack, do you have a SCSI drive? If so, is it an Adaptec SCSI?

da_kidd_er 02-11-2003 10:15 PM

i don't think that its a scsi drive coz its displaying '/dev/hda' not '/dev/sda' when he runs fdisk -l...

Meanwhile, i noticed that you have a

kernel /vmlinuz-2.4.18-14 ro root=/dev/hda2=/

removed the '=/' part from the mentioned line...

born4linux 02-12-2003 03:50 AM

Quote:

Originally posted by da_kidd_er
i don't think that its a scsi drive coz its displaying '/dev/hda' not '/dev/sda' when he runs fdisk -l...

Meanwhile, i noticed that you have a

kernel /vmlinuz-2.4.18-14 ro root=/dev/hda2=/

removed the '=/' part from the mentioned line...

equack posted his latest grub.conf.

i believe he has some problem with some files in his /boot directory.

equack 02-12-2003 08:20 PM

da_kidd_er's right - no SCSI.

Had no time to post last night. I compared my /boot and /boot/grub directories they were virtually identical to what born4linux posted. The only difference at all was two additional directories, /boot/boot and /boot/boot/grub. /boot/boot was identical, but /boot/boot/grub didnt have grub.conf or menu.lst.

the first thing I tried was copying grub.conf to /boot/boot/grub and creating the menu.lst symlink. - NO

Next I tried to force it using
grub> root (hd0,1)
grub> install /boot/grub/stage1 d (hd0) /boot/grub/stage2 p /grub/menu.lst
- NO

Next I deleted the two extra directories and ran
grub> root (hd0,1)
grub> install /grub/stage1 d (hd0) /grub/stage2 p /grub/menu.lst
- NO

Then I tried grub-install /dev/hda - NO

Then I tried grub-install --root-directory=/boot /dev/hda
- Still NO, but that recreated the /boot/boot and /boot/boot/grub directories, so now I know how they got there. (I had tried that command before.)
:confused:
Next, I'll try to create a grub floppy with a menu interface. (See http://www.gnu.org/manual/grub-0.92/...e/FAQ.html#FAQ)

smallfish 02-14-2003 10:50 AM

Did you select not to install grub during ur installation?

equack 02-14-2003 06:09 PM

I selected the bootloader default for RH8 -- install grub. It just never has worked.
I also made a basic grub boot diskette, but it doesn't work either. it loads Stage2 and waits for a command at grub > but when I type in the first command grub>root (hd0, 0), it hangs with a blinking cursor at the next line.

I also copied /etc/lilo.conf.anaconda to etc/lilo.conf and ran /sbin/lilo but that didn't work either. I might find more time to work on it this weekend.

I must admit to being rather puzzled, but there's a limit to how much time I can spend on the computers here at home and stay married.

deadbug 02-16-2003 08:32 PM

equack, go to this Red Hat site and download the latest version of Grub (grub-0.93-1.i386.rpm).

http://people.redhat.com/~katzj/grub/

As root type this:

rpm -uvh grub-0.93-1.i386.rpm

After it installs, rebuild Grub with grub-install

/sbin/grub-install /dev/hda

If it still doesn't work, what error codes are you getting. If you are getting beyond Stage 1, Grub gives error codes for both Stage 1.5 and Stage 2.

equack 02-17-2003 07:14 AM

deadbug,
Thanks for the suggestion. Downloaded the package, no time to try it now, will try ASAP.

There have been no error messages so far, grub is not loading Stage2, and probably not Stage1.5 either, but I don't know how to tell for sure. (I can only tell you that I never see GRUB Loading...... only GRUB .)

Do I need to clean up the /boot directory before installing the package? I was considering deleting everything other than
config-2.4.18-24.8.0
initrd-2.4.18-24.8.0.img
module-info -> module-info-2.4.18-24.8.0
module-info-2.4.18-24.8.0
System.map-2.4.18-24.8.0
vmlinux-2.4.18-24.8.0
vmlinuz -> vmlinuz-2.4.18-24.8.0
vmlinuz-2.4.18-24.8.0

before installing anything. (My reasoning is to force the installer to rebuild as much as possible.)
What do you thing - good idea, bad idea, or simply unnecessary?

equack 02-17-2003 08:19 PM

Quote:

Originally posted by deadbug
...download the latest version of Grub (grub-0.93-1.i386.rpm).
http://people.redhat.com/~katzj/grub/
As root type this:

rpm -uvh grub-0.93-1.i386.rpm

After it installs, rebuild Grub with grub-install

/sbin/grub-install /dev/hda

Downloaded and installed. Had to use rpm -Uvh grub-blah as -u is not a valid rpm switch. Other than that all seemed well. grub-install ran fine also. However, still the same response as before: GRUB _ then nothing.

Obviously not loading Stage2. Could it be that the mbr isn't pointing to /boot and therefore grub is trying to find stage2 in /grub rather than /boot/grub?

Should I cp /boot/grub /grub ?

deadbug 02-20-2003 07:34 PM

Here is what the Grub manual says about Stage 1 errors:

Errors reported by the Stage 1

The general way that the Stage 1 handles errors is to print an error string and then halt. Pressing <CTRL>-<ALT>-<DEL> will reboot.

The following is a comprehensive list of error messages for the Stage 1:

Hard Disk Error
The stage2 or stage1.5 is being read from a hard disk, and the attempt to determine the size and geometry of the hard disk failed.
Floppy Error
The stage2 or stage1.5 is being read from a floppy disk, and the attempt to determine the size and geometry of the floppy disk failed. It's listed as a separate error since the probe sequence is different than for hard disks.
Read Error
A disk read error happened while trying to read the stage2 or stage1.5.
Geom Error
The location of the stage2 or stage1.5 is not in the portion of the disk supported directly by the BIOS read calls. This could occur because the BIOS translated geometry has been changed by the user or the disk is moved to another machine or controller after installation, or GRUB was not installed using itself (if it was, the Stage 2 version of this error would have been seen during that process and it would not have completed the install).

Any of these look possible?

As for the deletions and copies you are asking about--I'm afraid I'm out of suggestions. Everything I would suggest, you have done. I admit to being intrigued that none of the boot loaders seem to work--that generally doesn't happen.

Okay, I just reread this post a second time and did notice something. We had you change the root line to hd(0,0), but did we also have you change the splashimage line at the same time?

From what I can tell, we have very similar setups. I have Red Hat 8.0 as a stand alone system on a 20 GB hard drive (yours appears to be a 10 GB). I have three partitions: /boot, /, and swap. My grub.conf file has both the splashimage and root lines pointed at hd(0,0)--my /boot partition. It works like a charm.

Grub is a GUI bootloader and the splashimage is probably a must have for it. If we didn't try changing both to hd(0,0), what have we got to lose by trying it?

Obviously, I'm grasping at straws!

equack 02-20-2003 09:11 PM

I don't think the menu is required, based on what I've read. The menu fust gives the commands to grub in a batch-file format. These same commands can be input at the grub> prompt that would come up after Stage 2 loads. But of coure I never see that prompt at bootup since Stage 2 doesn't load.

deadbug 02-25-2003 06:10 PM

According to the Grub manual and Red Hat site, I think the Grub commands in your grub.conf are read right after Stage 1. Stage 1 is machine language (for most of us in the MBR) that triggers Stage 2.

equack 02-27-2003 08:13 PM

Hmmm... Grub.conf before stage 2 would certainly change my understanding of the process. I've been considering a fresh install, because I've scrounged up some improved hardware, but maybe I'll play a little bit more first.

deadbug 02-28-2003 06:30 PM

Yeah, I re-read what I wrote. Stage 1 is the MBR; machine code that merely loads the first part (Stage 1.5?) of the boot loader into memory and reads the grub.conf file. I can read it both ways that: the menu is loaded before Stage 2; the menu is loaded by stage 2.

Given that a Stage 1 error can be problems reading Stages 1.5 & 2, let's assume that Stage 2 loads the menu. While I still think you need to change the hd(0,1) entries to hd(0,0), that will only prevent further problems, not solve this one.

You stated several times that you think the problem is with Stage 1. In reviewing the Stage 1 potential problems, they mostly center around geometry errors--what Stage 1 is expecting to find, it isn't.

For hard drive problems, grub isn't encountering the size, type hard drive it is expecting.

The Geometry errors are for a hard drive that was changed after Grub was installed.

Since you've reinstalled it several times, I'd say we're not looking at a Geometry problem. Since it will give you a non-functioning Grub prompt, I think that Stage 1 is loading and it cannot load much beyond that (Grub gives error codes with Stage 1.5 and beyond).

How about looking at the hard drive settings? Assuming that your hda drive is the primary drive in the first IDE channel, maybe changing the settings on the drive would fix things. I don't mean the cylinder/sector arrangement--but simple things such as turning LBA off; disabling SMART--little tweaking of the BIOS things?

Thoughts?

equack 02-28-2003 08:19 PM

BTW, The hardware wizard is great; recognized the new (new to this box anyway) video card I tossed in there and removed the old VC configuration.

But I digress. I hadn't really thought about BIOS settings. This is an old PII 233MHz MB that I've never updated the BIOS on, and 10GB drives were fairly uncommon when it was new. That might be worth looking into. I could copy an image of it onto a 4GB drive just as a test, though I would need a newer Ghost version to work with EFS3.

I'll let you know...

equack 02-28-2003 10:50 PM

:D HOORAY!!!!!!!!!!!:D

I changed HDD from MODE=LBA to MODE=NORMAL. It then booted into the command-line grub because I had moved the /boot/grub directory elsewhere before downloading grub (as described in post # 18). (This proves that grub will load without menu.lst or an image file.)

I copied the missing files back to /boot/grub. The grub GUI came up, and the OS loaded.

orange400 03-01-2003 03:36 AM

Dude I have the same freaking problem!!! What did you do??? What file??? I am soooo desperate to get this working, my life literally depends on it, I'm a digital musician and all my stuff is on Windows XP! I was reading your first posts and I was like holy cow, he has the same problem, but when I read that you fixed it I was like ... NO WAY!! If I can get GRUB working like you did I would be eeeeeeestatic!!!

orange400 03-01-2003 04:09 AM

I just solved it!!!

It was such a simple solution, and I came upon it mistakenly!

I didn't configure hdb up in the BIOS, so Windows and Linux were loading the drive themselves. And when I was just peeking around my BIOS to try to disable LBA mode, I found out that my slave wan't even configured! The LBA does screw up the boot sometimes, my 486 wouldn't even get past the BIOS screens with the LBA mode running on the drive. Anyways, I thought ... HEY! My boot folder is on the SLAVE, and the boot runs BEFORE any of the OSs, so I need to ENABLE this sucker! And I did, and walla, the GRUB boot loader worked beautifully.

Thank you for your help but I closed the case. I am in rejoice as I can load Windows with 100% stability and accuracy through GRUB!! All my work is totally back!! I think I'll be burning my files to discs soon ... :p

All I have to say is I'm amazed, I feel like it's fine shiny weather outside even though it's just 2:06 in the morning with me at the computer trying to solve this rig ... successfully!

equack 03-01-2003 02:33 PM

Deadbug, I forgot to thank you for your persistence with this little grub issue, so I'll do it now.

Thank you, deadbug!

I did, however, remember to click Affero and put in a good word for you there.

indulis 03-11-2003 10:26 PM

FYI I had a similar problem (different cause) with Grub just sitting there starting at me, worked with floppy, not from hard disk.

It seems that the disk partition I was using for Grub was once written on by Windows, so Grub thought it was still a FAT partition, and was trying to read files using a FAT filesystem.

I found *my* solution was to use

dd if=/dev/zero of=/dev/hda1 count=1

where /dev/hda1 is my /boot partition with Grub etc
(note do **NOT** do this on /dev/hda!!! or it will destroy your partition table!!!!!!!!! Don't do it!!!!!! No!!! Bad dog!!!)

That got rid of the FAT stuff and then it came up from disk OK. I can't remember if I had to rewrite Grub back to the boot partition after zeroing the first block.... you may have to do this too.

Don't know why Grub doesn't just believe the partition type and try that first...

Indulis

indulis 03-26-2003 10:17 PM

Oops, the dd command SHOULD be somthing like

dd if=/dev/zero of=/dev/hda1 bs=512 count=1

Where /dev/hda1 is your /boot partition, you can see a similar problem with floppy disks at
http://www.mathematik.uni-marburg.de.../mkgrubfd.html

If you accidentally do this to your windows partition, recover as per...
http://mail.gnu.org/archive/html/bug.../msg00081.html


All times are GMT -5. The time now is 06:02 PM.