LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   GRUB problems (https://www.linuxquestions.org/questions/linux-newbie-8/grub-problems-175257/)

Swishaa 04-27-2004 04:19 PM

GRUB problems
 
I have just installed Red Hat Linux 9 on my computer. I haveWindows XP on the system also. GRUB installed to my MBR (hda). Both of my hard drives have LBA enabled according to my BIOS.

When Grub runs on starup i get:
GRUB Loading stage1.5
GRUB loading, please wait...
Error 18


This is how my computer is set up (fdisk -l):
Code:

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
  Device Boot    Start      End    Blocks  Id  System
/dev/hda1  *        1      9729  78148161    7  HPFS/NTFS    <---- Windows XP
 
Disk /dev/hdb: 163.9 GB, 163928604672 bytes
255 heads, 63 sectors/track, 19929 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
  Device Boot    Start      End    Blocks  Id  System
/dev/hdb1            1      5483  44042166    7  HPFS/NTFS
/dev/hdb2          5484    15212  78148192+  f  Win95 Ext'd (LBA)
/dev/hdb3        15213    15343  1052257+  82  Linux swap
/dev/hdb4  *    15344    19929  36837045  83  Linux
/dev/hdb5          5484    15212  78148161    b  Win95 FAT32

My grub.conf file:
Code:

default=0
timeout=10
slashimage=(hd1,3)/boot/grub/splash.xpm.gz
title Red Hat Linux
        root (hd1,3)
        kernel /boot/vmlinuz-2.4.20-8 ro root=/dev/hdb4
        initrd /boot/initrd-2.4.20-8.img
title Windows XP
        rootnoverify (hd0,0)
        chainloader +1

I also tried to put GRUB on a floppy disk and boot from that, but i got "GRUB Geom Error".

All I can do right now is boot Linux from my boot floppy disk I made durring installation.

bruno buys 04-27-2004 08:21 PM

By this line:
/dev/hdb3 15213 15343 1052257+ 82 Linux swap
we see that this is a swap partition.

But your grub.conf maps this partition to be the root:
title Red Hat Linux
root (hd1,3)

Still, the output of fdisk shows that hdb4 is marked active (the *). Try to set this one to be the root.

Try to fix this, and see if it works.
Its possible that grub fails even if only one entry is bugged. One would expect grub to supply the whole stuff and boot only the good ones. But it doesn't.

There's another alternative to this situation:
You may want to overwrite grub and its stuff with winXP tools, and let linux boot from floppies always. Just run the winXP install cd, choose recovery console and run the utility to write mbr. I guess its name is something like xpboot, or makeboot or some similar .exe.

Swishaa 04-27-2004 08:35 PM

Grub uses a different numbering system for its hard drives/partitions. Grub starts at (hd0, 0) where as linux starts at /dev/hda1. So /dev/hdb4 is the same as (hd1,3) (2nd hard drive, 4th partition).

I could overwrite the MBR with the windows version, but I'd kinda like to get some kind of boot loader working where I can choose windows or linux.

Qucho 04-28-2004 03:56 AM

This might have an easy solution.
First you should just boot linux with your rescue floppy/cd and type in the comman line;
# update-grub

I hope this fix your problem. :)

Swishaa 04-28-2004 02:12 PM

Uhh, update-grub is not a command. When I typed it into my terminal, I got
bash: update-grub: command not found
grub-update does not work either. I know that "grub-install" installs grub, but i've re-installed grub and still got the same error.

WhatsHisName 04-28-2004 02:41 PM

From the GRUB manual :study:

http://www.gnu.org/software/grub/man...roubleshooting

"Stage 1:

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).


Stage 1.5 & Stage 2:

Error 18 : Selected cylinder exceeds maximum supported by BIOS

This error is returned when a read is attempted at a linear block address beyond the end of the BIOS translated area. This generally happens if your disk is larger than the BIOS can handle (512MB for (E)IDE disks on older machines or larger than 8GB in general).”


Hmmmmm.

Swishaa 04-28-2004 02:59 PM

So, what do I do. I mean, I've even tried removing the slashimage line and the linux option (so all it would show is windows) since both are beyond the first 8GB, and I still get the same error. What exactly is it that has to be at the front of the hd? GRUB itself is in the MBR, which is the first 512MB. Also, does anyone know how old an 'older machine' is? I mean, I bought my computer about the time that the P4 came out, so it's not really old.

WhatsHisName 04-28-2004 03:14 PM

Actually, a pointer for GRUB is in the master boot record (MBR). The MBR is only 512 bytes in size.

It may not help, but try starting at the beginning. Rewrite the MBR using either the recovery utilities on the XP installation CD or using a Win95/98/ME Startup Disk (i.e., run fdisk /mbr).

Then boot to linux using the floppy boot disk and try installing GRUB using:

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

where:

--force-lba = force GRUB to use LBA mode
--recheck = force probing of device map


Again, this may not help. :)

Swishaa 04-28-2004 05:46 PM

Thanks for correcting me on the size of the MBR, i knew it was 512 something, lol. I reset the MBR and then installed GRUB again with no luck though. I still get the same error.

JZL240I-U 04-29-2004 02:01 AM

You might also use the boot-loader of XP by editing boot.ini (if it still exists :(). In WinNT it looks like this
Code:

[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows NT Workstation, Version 4.0"
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows NT Workstation, Version 4.0 [VGA-Modus]" /basevideo /sos
[boot loader]
timeout=3
default=multi(0)disk(0)rdisk(0)partition(1)\WINNT

add a new line like this in the [operating systems] section
Code:

multi(0)disk(0)rdisk(1)partition(4)\Linux="Your distro here"
But I don't really remember whether you have to change the parameter of disk(0) or of rdisk(0) to 1 for hdb (or both). Just experiment, as long as you don't touch the XP-lines nothing bad will happen and you ought to make a backup beforehand anyhow...

[edit]Uargh, that's not right. First you have to copy the boot sector from your /dev/hdb4 by dd and write it to a partition XP can read, e.g. as Linux.ini. Next you have to move it to C: (into the NTFS file structure by WIn...) Then you access it by
Code:

multi(0)disk(0)rdisk(1)partition(4)\Linux.ini="Your distro here"
Selecting this in the Win-loader menu will start GRUB from /dev/hdb4

Swishaa 04-30-2004 02:09 PM

Alright, this is what I did. I copied my MBR to the file boot.lnx. Then I took boot.lnx and put it on my C:\ drive. Then I added 'C:\boot.lnx="Red Hat Linux 9"' to my boot.ini file. The problem is, all that this does it add a choice in boot.ini to load GRUB. I got the same error after selecting Linux from my boot.ini menu. Does anyone know of a way i can point directly to Linux from boot.ini instead of pointing to GRUB or LILO?? (all of the tutorials i've found have you copy lilo and add it into your boot.ini)

Swishaa 05-01-2004 08:52 AM

I have an idea, not sure if it's possible though. What if i take the files from my rescue floppy, and put them on my c:\ drive. Then somehow have boot.ini use those files. Has anyone done this or know if it works???

JZL240I-U 05-10-2004 09:47 AM

Sorry to answer so late.

You absolutelyhave to use a bootloader to start Linux, and the Win-bootloader can't do it. So my suggestion is to check your installation of GRUB (though it works with LILO as well). I just shot down my machine and had to rebuild the whole procedure this weekend, so do I know it works -- but most times not at the first try ;) (I think I had five tries this time, dunno why GRUB is so pigheaded or whether its just the quality of my CD-ROMs).

Oh, and as to your last question, I don't think it works, because you have to set the floppy as boot-medium, but experiment away -- and don't forget to tell us your results. And you still have to announce to the boot loader that these files are there ...


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