View previous topic :: View next topic |
Author |
Message |
Schwinni Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 02 Sep 2004 Posts: 214 Location: quadrant1.earth. germany.wuerzburg
|
Posted: Tue Oct 28, 2008 10:00 am Post subject: [Solved] Problems booting Windows from Grub |
|
|
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... )
/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.
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 |
|
![](templates/gentoo/images/spacer.gif) |
Schwinni Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 02 Sep 2004 Posts: 214 Location: quadrant1.earth. germany.wuerzburg
|
Posted: Tue Oct 28, 2008 10:01 am Post subject: |
|
|
Oh sorry, wrong forum I think.
Should me moved to Installing Gentoo.... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Schwinni Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 02 Sep 2004 Posts: 214 Location: quadrant1.earth. germany.wuerzburg
|
Posted: Fri Oct 31, 2008 2:14 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
cyrillic Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/8174739453e52fd5e9aef6.jpg)
Joined: 19 Feb 2003 Posts: 7313 Location: Groton, Massachusetts USA
|
Posted: Fri Oct 31, 2008 3:58 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Schwinni Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 02 Sep 2004 Posts: 214 Location: quadrant1.earth. germany.wuerzburg
|
Posted: Fri Oct 31, 2008 4:09 pm Post subject: |
|
|
Thanks for being the first to answer!
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 |
|
![](templates/gentoo/images/spacer.gif) |
cyrillic Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/8174739453e52fd5e9aef6.jpg)
Joined: 19 Feb 2003 Posts: 7313 Location: Groton, Massachusetts USA
|
Posted: Fri Oct 31, 2008 4:22 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Schwinni Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 02 Sep 2004 Posts: 214 Location: quadrant1.earth. germany.wuerzburg
|
Posted: Fri Oct 31, 2008 8:33 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
jcat Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/8613556479655c309323.jpg)
Joined: 26 May 2006 Posts: 1337
|
Posted: Sat Nov 01, 2008 12:04 am Post subject: |
|
|
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!!
Cheers,
jcat |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
gentoo_ram Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 25 Oct 2007 Posts: 515 Location: San Diego, California USA
|
Posted: Sat Nov 01, 2008 12:15 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Schwinni Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 02 Sep 2004 Posts: 214 Location: quadrant1.earth. germany.wuerzburg
|
Posted: Sat Nov 01, 2008 12:31 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
jcat Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/8613556479655c309323.jpg)
Joined: 26 May 2006 Posts: 1337
|
Posted: Sat Nov 01, 2008 4:11 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Schwinni Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 02 Sep 2004 Posts: 214 Location: quadrant1.earth. germany.wuerzburg
|
Posted: Sun Nov 02, 2008 4:44 am Post subject: |
|
|
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... ![Razz :P](images/smiles/icon_razz.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|