Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub Error 13 - Dual boot Gentoo & Win2k problem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Ard Righ
Guru
Guru


Joined: 24 Jun 2002
Posts: 337
Location: Wellington, NZ

PostPosted: Sun Aug 18, 2002 11:57 am    Post subject: Grub Error 13 - Dual boot Gentoo & Win2k problem Reply with quote

I have been driven crazy trying to get grub to load Win2k on my machine, in dual-boot.

I just installed Gentoo, it went nicely. Installed grub, as per the x86 install guide, except when it came to boot into Win2k, it came up with the following error:

Quote:
Error 13: Invalid or unsupported executable format


I have tried everything I can think of to get it to work.

I have a /boot/grub/menu.lst file as follows:

Quote:

default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title=Gentoo Linux
root (hd0,0)
kernel /boot/bzImage root=/dev/hda5

title=Windows 2000
rootnoverify (hd0,2)
makeactive
chainloader +1


I updated grub to 0.92 (which I unmasked) from 0.90 (which is the default), and that didn't make a difference.

When I tried booting Win2k from the grub command line, it gets to the point where it begins to load Win2k, then says something along the lines of...

Quote:
<windows 2000 root>\system32\ntoskrnl.exe : file does not exist or corrupted


I checked, and the file does exist, so that has me stumped.

Is this a problem with Grub, or is Win2k the culprit ? Gentoo seems to boot fine, but dual-boot is dead.

Any ideas on what else I can try/do to get dual-boot to work ? Win2k is installed on an NTFS partition if it makes any difference. Would grub have less issues if Win2k was on FAT32 partition ?
Back to top
View user's profile Send private message
lampshade
n00b
n00b


Joined: 12 Aug 2002
Posts: 9

PostPosted: Sun Aug 18, 2002 1:31 pm    Post subject: Reply with quote

did you accedently fdsik /dev/hda1?
Back to top
View user's profile Send private message
El_Presidente_Pufferfish
Veteran
Veteran


Joined: 11 Jul 2002
Posts: 1179
Location: Seattle

PostPosted: Sun Aug 18, 2002 5:02 pm    Post subject: Reply with quote

Code:
 title=Windows 2000
rootnoverify (hd0,2)
makeactive
chainloader +1

Why do you have noverify, and makeactive?
i dual boot with windows 200 and i have neither
Back to top
View user's profile Send private message
hielvc
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2805
Location: Oceanside, Ca

PostPosted: Sun Aug 18, 2002 5:13 pm    Post subject: Reply with quote

It would help if you posted your partion table. It seems that hda1 is your "/boot", hda3 is win2k and hda5 is "/". Did you install grub to hd0 (mbr) or to hd0,1 ? have you tried just "chainloader +1"?
Also you might search for "win2k AND grub". Also when in grub and you give it a command like "root (hd0,1) or (hd0[TAB] for TAB complition it gives you feedback like file type. This info should jive with what you think is there or what fdisk or cfdisk reports.. For "win?" it will just be file type, but for grub or linux => stage 1 .... or bzIamge found.

hielvc
Back to top
View user's profile Send private message
clacour
n00b
n00b


Joined: 19 Apr 2002
Posts: 59
Location: Dallas, Tx USA

PostPosted: Sun Aug 18, 2002 6:52 pm    Post subject: Reply with quote

The grub commands you have look like the standard variety for booting the later versions of Windows, so I don't have any suggestions there.

The fact that it's NTFS might make a difference, but it shouldn't, since you're not reading anything from the filesystem, you're just loading the boot loader and letting it take over from there.

Try this:

1. Make a boot diskette for your Gentoo stuff, if you haven't already. (And test it, because it's going to be pretty important in a step or two.)

2. Make a copy of the current boot block:
Code:
 dd if=/dev/hda of=bootblock.safe bs=512 count=1


2. Use fdisk to make the active partition hda3.

3. Use a Windows boot diskette and do a "fdisk /mbr".

4. Boot. If W2k comes up fine, then I'm inclined to say it's got something to do with grub, but I'm stumped as to what. (See below for an alternative method that might work for you.)

If W2K does not come up, fix that problem (and I can't help you there -- I've used it, but I don't know it's innards well at all.)

5. Get back to "normal"
A) Boot from the Gentoo boot disk
B) Use fdisk to change the active partition back to what it was (if you care. As far as I know, Linux doesn't.)
C) Copy your saved boot block back to the MBR
Code:
 dd if=bootblock.safe of=/dev/hda bs=512 count=1



An alternate method, if W2K will run on its own, is to let it be the boot loader.

This is the method you'll mostly find if you do a Google search for "dual boot NT linux" or something similar, except they used the boot block created by lilo. I never did like that method, because any time you change your kernel (or anything else that would normally require running lilo) you have to go through the whole procedure all over again.

Grub doesn't have that problem, so this would be a pretty good fix -- get it working once and it should work from then on.

Search the web if you want a detailed procedure, but the meat of it is to take that boot block (the one I had you create as bootblock.safe) and put it in a file where W2K can get at it. It's not safe to write to NTFS, and NT/W2K can't read ext2 partitions, so you will either need a small FAT32-formatted partition (my recommended solution to a NT/Linux dual boot system) or a floppy.

One potential gotcha. I have read, and my experience so far confirms, that you can't have a boot block on NTFS and have it load right. My own experience is that you also can't have it anywhere but on the C: drive, so putting it on a small D: FAT32 partition won't work either.

If you decide to re-install as FAT32, try the regular grub stuff first. If it works, let the world know (and most especially the grub maintainers). I can't think of any reason why it would matter, but if it does, the rest of us would like to know about it.

Hope this helps.
Back to top
View user's profile Send private message
Ard Righ
Guru
Guru


Joined: 24 Jun 2002
Posts: 337
Location: Wellington, NZ

PostPosted: Sun Aug 18, 2002 8:44 pm    Post subject: Reply with quote

lampshade wrote:
did you accedently fdsik /dev/hda1?


No, /dev/hda1 is my linux /boot partition. Linux boots just fine.
Back to top
View user's profile Send private message
Ard Righ
Guru
Guru


Joined: 24 Jun 2002
Posts: 337
Location: Wellington, NZ

PostPosted: Sun Aug 18, 2002 8:47 pm    Post subject: Reply with quote

hielvc wrote:
It would help if you posted your partion table. It seems that hda1 is your "/boot", hda3 is win2k and hda5 is "/". Did you install grub to hd0 (mbr) or to hd0,1 ? have you tried just "chainloader +1"?
Also you might search for "win2k AND grub". Also when in grub and you give it a command like "root (hd0,1) or (hd0[TAB] for TAB complition it gives you feedback like file type. This info should jive with what you think is there or what fdisk or cfdisk reports.. For "win?" it will just be file type, but for grub or linux => stage 1 .... or bzIamge found.

hielvc


I have tried lots of combinations of things, but none of them seem to want to boot Win2K. I installed grub to MBR, as per installation guide:

Code:
Code listing 28

 # grub

 Code listing 29

 grub> root (hd0,0)
 grub> setup (hd0)
 grub> quit


OK here are the results of looking at the partitions in Gentoo.

When I run grub, and check out the tab completion, it says the filesystem is unknown ?!

Code:
grub> root (hd0,[tab]
  Possible Partitions are:
   Partition num: 0, Filesystem type ext2fs, partition type 0x83
   Partition num: 1, Filesystem type unknown, partition type 0x82
   Partition num: 2, Filesystem type unknown, partition type 0x7
   Partition num: 4, Filesystem type ext2fs, partition type 0x83
   Partition num: 5, Filesystem type unknown, partition type 0x7


So as you can see, grub doesn't recognise the NTFS partition filesystems for some reason.

Code:
 # fdisk /dev/hda1
 Command (m for help): p
 
 Disk /dev/hda: 255 head, 63 sectors, 2498 cylinders
 Units = cylinders of 16065 * 512 bytes

 Device    Boot  Start     End      Blocks     ID   System
 /dev/hda1   *       1      13      104391     83   Linux
 /dev/hda2          14     144     1052257     82   Linux swap
 /dev/hda3         145     667     4200997+     7   HPFS/NTFS
 /dev/hda4         668    2498    14707507+     f   Win95 Ext'd (LBA)
 /dev/hda5         668    1973    10490413+    83   Linux
 /dev/hda6        1974    2498     4217031      7   HPFS/NTFS


I want to know why grub doesn't recognise the NTFS partitions I have... I think that might be part of the problem right there.

[edit]make code output easier to read[/edit]
Back to top
View user's profile Send private message
Ard Righ
Guru
Guru


Joined: 24 Jun 2002
Posts: 337
Location: Wellington, NZ

PostPosted: Mon Aug 19, 2002 12:09 am    Post subject: Reply with quote

OMG I am an idiot :p

I found out why my changes to grub weren't doing anything... Gentoo unmounts /boot when the machine starts up.. so it was installing Grub twice, and I was editing the wrong files.

I booted Gentoo, removed the 2nd copy of grub, remounted /boot, unmerged grub (which was still 0.90), emerged grub 0.92, edited menu.lst again, and Win2k booted sweet first time through :D

Point of the story: Gentoo needs to get rid of the ancient version of Grub, and make the latest release 0.92 the default (0.92 is currently masked by Gentoo, you have to unmask it to use it). It will make dual-booting with Win2k/XP machines a lot easier :)

If I hadn't realised Gentoo was unmounting /boot when it loaded, I probably would have reinstalled from scratch :?
Back to top
View user's profile Send private message
abhishek
Retired Dev
Retired Dev


Joined: 28 Jun 2002
Posts: 393
Location: Los Angeles, CA

PostPosted: Mon Aug 19, 2002 9:36 am    Post subject: Reply with quote

Ard Righ wrote:
OMG I am an idiot :p

I found out why my changes to grub weren't doing anything... Gentoo unmounts /boot when the machine starts up.. so it was installing Grub twice, and I was editing the wrong files.

I booted Gentoo, removed the 2nd copy of grub, remounted /boot, unmerged grub (which was still 0.90), emerged grub 0.92, edited menu.lst again, and Win2k booted sweet first time through :D

Point of the story: Gentoo needs to get rid of the ancient version of Grub, and make the latest release 0.92 the default (0.92 is currently masked by Gentoo, you have to unmask it to use it). It will make dual-booting with Win2k/XP machines a lot easier :)

If I hadn't realised Gentoo was unmounting /boot when it loaded, I probably would have reinstalled from scratch :?

It'll get unmasked sometime, if not already(no idea cuz im not on a gentoo box). The comment that goes with it in the mask says why it's masked. normally things are maksed for testing, and shoulde be released soon.
Back to top
View user's profile Send private message
Ard Righ
Guru
Guru


Joined: 24 Jun 2002
Posts: 337
Location: Wellington, NZ

PostPosted: Mon Aug 19, 2002 11:27 am    Post subject: Reply with quote

data_the_android wrote:

It'll get unmasked sometime, if not already(no idea cuz im not on a gentoo box). The comment that goes with it in the mask says why it's masked. normally things are maksed for testing, and shoulde be released soon.


I believe it mentioned something about needing testing with xfs... but the package seems to be a fair way down the package.mask file, how long does it need testing for ? :)

Either way, the sooner they get grub tested, and using the latest version, I think the less threads with 'grub' in them will flood these forums ;)
Back to top
View user's profile Send private message
idiotprogrammer
Apprentice
Apprentice


Joined: 29 Jul 2002
Posts: 179
Location: Texas

PostPosted: Wed Aug 21, 2002 3:43 am    Post subject: how did you know /boot was installing GRUB twice? Reply with quote

How did you know /boot was installing GRUB twice?

how could you tell that gentoo was unmounting /boot when it loaded. didn't

Were you using the xfs kernel?

Has anybody found that using a later version of grub causes problems with xfs?

rj

(you wrote:)



I found out why my changes to grub weren't doing anything... Gentoo unmounts /boot when the machine starts up.. so it was installing Grub twice, and I was editing the wrong files.

I booted Gentoo, removed the 2nd copy of grub, remounted /boot, unmerged grub (which was still 0.90), emerged grub 0.92, edited menu.lst again, and Win2k booted sweet first time through icon_biggrin.gif

Point of the story: Gentoo needs to get rid of the ancient version of Grub, and make the latest release 0.92 the default (0.92 is currently masked by Gentoo, you have to unmask it to use it). It will make dual-booting with Win2k/XP machines a lot easier icon_smile.gif

If I hadn't realised Gentoo was unmounting /boot when it loaded, I probably would have reinstalled from scratch
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Wed Aug 21, 2002 3:49 am    Post subject: Re: how did you know /boot was installing GRUB twice? Reply with quote

idiotprogrammer wrote:
How did you know /boot was installing GRUB twice?

how could you tell that gentoo was unmounting /boot when it loaded. didn't
Following the defaults for the Install Guide, /etc/fstab does not mount /boot automatically. If you mount it manually and reboot, it will unmount. I'm not exactly sure what he means by /boot installing GRUB twice. If the /boot partition is not mounted, then /boot is just a mount point. Copying anything to it will not be seen by Grub. Grub looks on the /boot partition, not the /boot mount point which is usually under the / partition.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
idiotprogrammer
Apprentice
Apprentice


Joined: 29 Jul 2002
Posts: 179
Location: Texas

PostPosted: Wed Aug 21, 2002 5:40 am    Post subject: have a similiar problem Reply with quote

https://forums.gentoo.org/viewtopic.php?p=68727#68727

I have a similar problem.

Interestingly after I mount /boot, I have one identical directory inside another

/mnt/gentoo/boot/
(containing grub, etc)

and /mnt/gentoo/boot/boot
(containing grub, etc, the same as above)

so i have produced two 2 copies of bzImage, both identical. (i did a diff of both files)I can't speculate about how or why I did that. My setting in grub are right, I'm pretty sure.

rj
Back to top
View user's profile Send private message
flying_monkey
n00b
n00b


Joined: 22 Jul 2002
Posts: 33
Location: New Jersey

PostPosted: Wed Aug 21, 2002 3:46 pm    Post subject: re: similar problem Reply with quote

Hey, even I know that one. If you do
ls -l /boot
I'll bet you find that in there is a file called boot, which shows a link to . (the current directory). So
/mnt/gentoo/boot/somefile
is equivalent to
/mnt/gentoo/boot/boot/somefile
(which is also equivalent to
/mnt/gentoo/boot/boot/boot/somefile
ad infinitum :-) )
Smile)

No big deal. Some programs look for grub under /boot, some under /boot/boot.

Ed
Back to top
View user's profile Send private message
Ard Righ
Guru
Guru


Joined: 24 Jun 2002
Posts: 337
Location: Wellington, NZ

PostPosted: Thu Aug 22, 2002 11:53 am    Post subject: Re: how did you know /boot was installing GRUB twice? Reply with quote

idiotprogrammer wrote:
How did you know /boot was installing GRUB twice?

How could you tell that gentoo was unmounting /boot when it loaded. didn't

Were you using the xfs kernel?

Has anybody found that using a later version of grub causes problems with xfs?


As someone mentioned, /boot is not mounted when you login to Gentoo. It mentions it does it for security reasons... so /boot doesn't get corrupted if your system goes down etc.

And no, I don't use xfs at all, my partitions are ext3. The mask file does state grub 0.92 doesn't work with xfs, which is why people should be working on getting it tested :p

Also, in regards to the /boot/boot/boot stuff, I did see two versions of grub... even when /boot was not mounted, I still had a /boot/grub folder with all the relevant files in it, which I was editing at the time.
When I realised what was going on, I rm -rf /boot/grub and mkdir /boot so it was completely empty, then mount /boot so I can edit where grub was actually looking.

It does seem rather stupid to have a file linking to it's own location though... what is the point ?
If programs have been written to search for something in /boot/boot then they should be fixed.

Grub 0.92 looks for files in /boot/grub or more specifically /grub (ie splashimage=(hd0,0)/grub/splash.xpm.gz (since you know /grub is always going to be a sub-directory of /boot anyway).

Also, a point to note for the installation guide, Grub 0.92 appears to like grub.conf rather than menu.lst
Back to top
View user's profile Send private message
Lion
Apprentice
Apprentice


Joined: 23 Jun 2002
Posts: 207

PostPosted: Thu Aug 22, 2002 2:17 pm    Post subject: Why boot/boot? Reply with quote

Quote:
It does seem rather stupid to have a file linking to it's own location though... what is the point ?
If programs have been written to search for something in /boot/boot then they should be fixed.

I wondered about this, myself.

Then, I realized that installation instructions for grub showed filenames for kernel etc. in the form /boot/bzImage. When grub runs, it makes /boot the grub rootdirectory. So, for grub, the kernel name would be /bzImage, without the /boot.

By creating the symlink boot/ in the bootdirectory itself, naming for grub and the rest of the file system will correspond again.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum