Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Problems booting Windows from Grub
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Schwinni
Apprentice
Apprentice


Joined: 02 Sep 2004
Posts: 214
Location: quadrant1.earth. germany.wuerzburg

PostPosted: Tue Oct 28, 2008 10:00 am    Post subject: [Solved] Problems booting Windows from Grub Reply with quote

Hi all,

I installed Gentoo on my brother's notebook.
The situation was:
2 (primary) partitions, both NTFS, one for the system and one for data.

I changed the partitions to make space for Gentoo by shrinking C: and D: and moving D: to the end of the disk.
That all worked.
Then I created one primary for swap and another for Gentoo itself.

The situation now is:
/dev/sda1 NTFS (Windows XP)
/dev/sda2 swap
/dev/sda3 ext3 (Gentoo) (yes, I know, no extra partition for boot and home... :wink:)
/dev/sda4 NTFS (user data)

The Gentoo installation went fine and everything concerning Linux works fine (except the FN keys, but that is something for another thread).

The problem is with Windows:
For Windows I created an entry in Grub:
Code:
title Windows XP
rootnoverify (hd0,0)
makeactive
chainloader +1


When trying to boot that entry I get
Code:
13 : Invalid or unsupported executable format


I already booted to the recovery console from the Windows CD and did a FIXBOOT.
Windows asked me to install the boot code to G: (the CD itself recognized C: as the system partition).
Of course I said no, and made a FIXBOOT C:.
That didn't help - same error.

Then I booted the computer with the PartedMagic CD (http://partedmagic.com) and saw that /dev/sda3 had the boot flag.
So I set the boot flag to /dev/sda1.
OK, another try with the recovery console and FIXBOOT:
This time Windows told me to install the boot code to C: - nice.

But that didn't help either. :cry:

I always get this freaking error 13.

What am I doing wrong?

Many thanks in advance,
Chris


Last edited by Schwinni on Sun Nov 02, 2008 4:44 am; edited 1 time in total
Back to top
View user's profile Send private message
Schwinni
Apprentice
Apprentice


Joined: 02 Sep 2004
Posts: 214
Location: quadrant1.earth. germany.wuerzburg

PostPosted: Tue Oct 28, 2008 10:01 am    Post subject: Reply with quote

Oh sorry, wrong forum I think.
Should me moved to Installing Gentoo....
Back to top
View user's profile Send private message
Schwinni
Apprentice
Apprentice


Joined: 02 Sep 2004
Posts: 214
Location: quadrant1.earth. germany.wuerzburg

PostPosted: Fri Oct 31, 2008 2:14 pm    Post subject: Reply with quote

I have found out something else:
Every time when Gentoo is booted the "boot" flag is set /dev/sda3.
Why is that?
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Fri Oct 31, 2008 3:58 pm    Post subject: Reply with quote

Can you post the entire contents of grub.conf ?

BTW, using grub's "makeactive" command is almost always a mistake. The Windows installer makes the correct partition "active", and this should never need to be changed after that.
Back to top
View user's profile Send private message
Schwinni
Apprentice
Apprentice


Joined: 02 Sep 2004
Posts: 214
Location: quadrant1.earth. germany.wuerzburg

PostPosted: Fri Oct 31, 2008 4:09 pm    Post subject: Reply with quote

Thanks for being the first to answer! :D

cyrillic wrote:
Can you post the entire contents of grub.conf ?

I'm still at work, but I will do that later.

Quote:
BTW, using grub's "makeactive" command is almost always a mistake. The Windows installer makes the correct partition "active", and this should never need to be changed after that.

The funny thing is, that when I make /dev/sda1 active using a LiveCD or whatever /dev/sda3 is active after the next startup of Gentoo.
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Fri Oct 31, 2008 4:22 pm    Post subject: Reply with quote

Try changing the Windows part of grub.conf to this.
Code:
title Windows XP
chainloader (hd0,0)+1

And make sure you don't have "makeactive" in any other parts of grub.conf
Back to top
View user's profile Send private message
Schwinni
Apprentice
Apprentice


Joined: 02 Sep 2004
Posts: 214
Location: quadrant1.earth. germany.wuerzburg

PostPosted: Fri Oct 31, 2008 8:33 pm    Post subject: Reply with quote

OK, I followed your advice and removed the makeactive and added (hd0,0) to the chainloader statement.
The error message is away now, but it still doens't boot.
Grub just shows me
Code:
Windows XP
chainloader (hd0,0)+1
and stays in this state.

Here is the partition layout:
Code:
 # fdisk -l

Platte /dev/sda: 120.0 GByte, 120034123776 Byte
255 Köpfe, 63 Sektoren/Spuren, 14593 Zylinder
Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes
Disk identifier: 0x77777777

   Gerät  boot.     Anfang        Ende     Blöcke   Id  System
/dev/sda1   *           1        3134    25173823+   7  HPFS/NTFS
/dev/sda2            3135        3265     1052257+  82  Linux Swap / Solaris
/dev/sda3            3266        7181    31455270   83  Linux
/dev/sda4            7182       14593    59536890    7  HPFS/NTFS


and here grub.conf:
Code:
default 1
timeout 30
#splashimage=(hd0,0)/boot/grub/splash.xpm.gz


title Windows XP
rootnotverify (hd0,0)
#makeactive
chainloader (hd0,0)+1


title Gentoo Linux 2.6.27-r1
root (hd0,2)
kernel /boot/kernel-2.6.27-gentoo-r1 root=/dev/sda3 acpi_sleep=s3_bios video=uvesafb:1280x800-32,mtrr:3,ywrap


title Gentoo Linux 2.6.27-r1 (rescue)
root (hd0,2)
kernel /boot/kernel-2.6.27-gentoo-r1 root=/dev/sda3 init=/bin/bb


Best regards
Chris
Back to top
View user's profile Send private message
jcat
Veteran
Veteran


Joined: 26 May 2006
Posts: 1337

PostPosted: Sat Nov 01, 2008 12:04 am    Post subject: Reply with quote

I would change your XP grub entry to be more standard again (remove the extra hd0,0 entry, but still leave the makeactive statement out)

Code:
title Windows XP
rootnotverify (hd0,0)
chainloader +1


You can see from your fdisk output that sda1 is active, so it should be fine.

Try booting again after making that small change to grub.conf

If it still won't boot windows, you should try and repair the installation again with the correct disk marked as active. See how you go.

Failing that, Gentoo is boot. Just use that!! :twisted:



Cheers,
jcat
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 515
Location: San Diego, California USA

PostPosted: Sat Nov 01, 2008 12:15 am    Post subject: Reply with quote

Maybe you're installing GRUB wrong? It should be:

Code:

root (hd0,2)
setup (hd0)


You didn't do "setup (hd0,0)" did you? That would be bad.
Back to top
View user's profile Send private message
Schwinni
Apprentice
Apprentice


Joined: 02 Sep 2004
Posts: 214
Location: quadrant1.earth. germany.wuerzburg

PostPosted: Sat Nov 01, 2008 12:31 am    Post subject: Reply with quote

No, no worries, I installed Grub into the MBR.

But it seems like the Windows partition is f***ed up anyway:

I found an old boot CD from Paragon Partition Manager and let the boot code (of the Windows partition) repair with it.
After that Grub booted Windows, but I got the message that ntoskrnl.exe is missing. LOL
Seems it was broke, so I expanded it from the Windows CD.
After that it booted a bit further and the computer restarted then. Booting to safe mode shows, that some more files are loaded now, but I cannot read fast enough to see which file fails.
Since chkdsk from the Windows CD finds no errors, I'm gonna do a repair of Windows.
Of course I'll have to install Grub again afterwards...
Back to top
View user's profile Send private message
jcat
Veteran
Veteran


Joined: 26 May 2006
Posts: 1337

PostPosted: Sat Nov 01, 2008 4:11 am    Post subject: Reply with quote

I hate to admin to knowing anything about Windows (I'm always trying to block out the pain!), but have you looked for the missing boot files on your NTFS data partition (/dev/sda4)?

I think (from memory) if you somehow manage to set up a partition other than C: as the system/boot drive (or something like that) from within Windows disk manager, it will put all important Windows boot files on that partition.




Cheers,
jcat
Back to top
View user's profile Send private message
Schwinni
Apprentice
Apprentice


Joined: 02 Sep 2004
Posts: 214
Location: quadrant1.earth. germany.wuerzburg

PostPosted: Sun Nov 02, 2008 4:44 am    Post subject: Reply with quote

I reinstalled Windows and it boots now.
Something was really broken.

I still have to add (hd0,0) to the chainloader statement, but I don't care - it boots... :P
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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