Re: Fedora Core 2/Windows XP dual boot: selecting Linux doesn't work



On Fri, 16 Dec 2005 21:35:21 +0100, Garmt de Vries <g.devries@xxxxxxxxxx> wrote:
Running "embed /grub/e2fs_stage1_5 (hd1,0)"...failed (this is not fatal)
Running "embed /grub/e2fs_stage1_5 (hd1,0)"...failed (this is not fatal)

I have done some reading of the source, and it turns out that grub does not implement an "embed" function for ext2/ext3 file systems. It appears that only a few file systems have such a function: Reiserfs, Jfs, and Ufs2. It may mean that only file systems that presend certain particular difficulties have this.

I have also seen in the code how it decides to leave the disk
number as 0xff.  It says that if you are doing the setup on
the same disk where the grub files reside, leave it at 0xff.
The idea seems to be that if the earlier steps of the load
procedure have arrived at the point where the boot sector is
loaded into memory from disk X, then the code for disk X is
already in register dl, and there is no need to change it.

However, for what we are doing, this is wrong, because
we copy the boot sector to hde, and ntloader loads it from
there, and starts it. At that point, register dl probably
has the value 0x80, corresponding to (hd0).

We see in the output from install-grub that the setup command
executes the command

Running "install --stage2=/boot/grub/stage2 /grub/stage1 (hd1,0) grub/stage2 p /grub/grub.conf "...succeeded
Done.
grub> quit

It is possible to run the "install" command directly, in stead of through the setup command. Or so it seems from the code, but it may be only a partial truth, because the program uses a lot of global variables and it takes a lot of reading to make sure no preliminary commands are required before issuing the "install" command.

To issue an install command that sets the disk number, a "d" has to be
inserted after "/grub/stage1", before "(hd1,0)".


I will read more code to see what else I can discover.


I have also some thoughts: It may be easier to install into the MBR of hdc, instead of hdc1. In that case, there is an embed-function that is independent of file system. With the stage1_5 installed there the process may get one step further before errors happen. Hard to say if stage1_5, once loaded, will perform better, since we don't know what the problem really is. I mean, you tried to patch the disk number, and it did not work, and we don't know why not.

Next: If the problem is diverging disk geometry settings in the Bios
and under Linux, it may work to do a "native" setup.  That means
getting to run Grub natively.  Is there a floppy drive in the computer?
If so, do

  cd /boot/grub
  cat stage1 stage2 > /dev/fd0

and boot from that floppy.  If there is no floppy, I am not sure how
to achieve that easily. Perhaps it is not hard to create a "Grub CD";
I have never looked at the details of that.

If you manage to have a Grub prompt from a grub that runs "natively" or
"standalone" - not under a Linux kernel - then "find /grub/grub.conf"
should respond "(hd1,0)" - meaning it has been able to read the
directories and inodes, compute the sector numbers from the block
addresses and have the Bios load the right sectors in order to read the
/grub directory and locate the name "grub.conf".  You could follow up
with "root (hd1,0)" and "cat /grub/grub.conf" to verify further.  If
this works OK, then  "setup (hd1,0)" should do it. Or "setup (hd1)"
if at this point you prefer the hdc's MBR.

If you do all this, it would be usefull to learn even more about what
Grub sees under these circumstances.  Grub has a row of commands
that are poorly or not documented, but appear in the source.
"debug" toggles the setting of a "debug" global variable.  There are
a couple of "printf" statements that depend on that variable.

"geometry (hd1)" should output the geometry setting that Grub is
aware of. It can be used both in the Linux version and the standalone
version of the program. When running under Linux, this command can
also be used to set Grub's notion of the geometry:
"geometry (hd1) X Y Z", where X=number of cylinders, Y=number of heads,
and Z=number of sectors per track.  This may permit the setup to
work correctly even when running under Linux, if only you know the
correct values. (Assuming that the geometry is the problem.)
The correct values may possibly be found in the Bios setup.

-Enrique
.



Relevant Pages

  • Re: This also happened to me, easy to fix...
    ... don't log in as root. ... The partition that contains your linux kernel is most probably ... grub can boot ext3 or many other file systems so /boot doesn't have to ... have ANY ext2 file systems on his disk. ...
    (comp.os.linux.setup)
  • SCSI Emulation Directives in grub/menu.lst
    ... The system had ext2 file systems and used ... lilo and now has a ext3 journalling file system on the master drive. ... It also uses the grub boot loader and appears to be healthy. ... would like to continue to use scsi emulation as long as I use a 2.6 ...
    (Debian-User)
  • Re: grub and flying elephants
    ... > | Well Grub has shown me something I have never seen before so I need ... > | I copied the whole grub directory from a working machine and got ... > I hope you remembered to unmount all file systems before doing the tar ...
    (Fedora)
  • Re: FC5 fails to boot after install
    ... Mike McCarty wrote: ... the code to read file systems is read in. ... the GRUB program, ...
    (Fedora)
  • Re: Grub Installation Mini How-To
    ... "rootnoverify" is for when you point grub at a part of a disk that is ... >> map ... It's like with the "map" command, ... it doesn't actually install stage1_5 unless it's ...
    (comp.os.linux.setup)