Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
(SOLVED) WinXP bootmanager calling GRUB doesn't work
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
DarkSpir
Tux's lil' helper
Tux's lil' helper


Joined: 04 Feb 2005
Posts: 112

PostPosted: Thu Apr 26, 2012 4:52 am    Post subject: (SOLVED) WinXP bootmanager calling GRUB doesn't work Reply with quote

Okay, here's the story:

I finished my new HTPC box, single drive, one partition for everything, amd64 Gentoo, grub installed to /dev/sda. Works fine. Then I thought "If I install windows on a second drive, I could also play games on the hardware..." So I throw in another drive and tried to install windows on it... I tried because windows want to install its bootloader to the first drive.

Solution: I opened the case (again) and switched the drives. The windows drive is now the first one and Gentoo is installed on the second one. After that I fixed the grub.conf to root=/dev/sdb1 and the mount in /etc/fstab with the minimal install cd scolding myself for forgetting to do that beforehand. :) My partition scheme is simple: sda: sda1 Windows partition, sdb: sdb1 Gentoo Root partition. No swap, no /boot/, no nothing.

Windows installs now, boots and runs. But in order to boot Gentoo, I have to change the startup priority of the two drives in the BIOS. And I thought "There HAS to be a better way doing this." So I googled, gained some knowledge (obviously not enough, otherwise I wouldn't write this right now) and copied the installed GRUB bootloader to a file:
Code:
dd if=/dev/sdb of=/mnt/windows/bootsect.lin bs=512 count=1


And I added the GRUB file to the windows boot.ini:
Code:
c:\bootsect.lin="Gentoo Linux"


Now everytime I try to load GRUB from the windows bootloader it simply returns:
Code:
GRUB GRUB GRUB GRUB Read Error


I'm now officially out of ideas. I have no idea what I did wrong and how to make this work. Can somebody help me with this, please?


Last edited by DarkSpir on Thu Apr 26, 2012 6:48 pm; edited 1 time in total
Back to top
View user's profile Send private message
The Doctor
l33t
l33t


Joined: 27 Jul 2010
Posts: 969

PostPosted: Thu Apr 26, 2012 4:58 am    Post subject: Reply with quote

Why not simply install grub on the drive the bois wants to boot from (or change the drive) and chain load the windows bootloader from grub like so (assuming grub legacy):
Code:
title Windows Vista
rootnoverify (hd1,0)
makeactive
chainloader +1


For refferance, my gentoo is on sda and grub recognizes it as root(hd0,0). sdb is (hd1,0) with windows vista installed.
_________________
First things first, but not necessarily in that order.
Back to top
View user's profile Send private message
gentoo_zz
n00b
n00b


Joined: 23 Apr 2012
Posts: 1

PostPosted: Thu Apr 26, 2012 3:17 pm    Post subject: Reply with quote

U can use grub to boot windows xp.Installing grub on the whole hard disk(MBR),and use grub to boot xp.install xp first and then install linux.
Back to top
View user's profile Send private message
DarkSpir
Tux's lil' helper
Tux's lil' helper


Joined: 04 Feb 2005
Posts: 112

PostPosted: Thu Apr 26, 2012 6:39 pm    Post subject: Reply with quote

Okay, I just deleted what I've written so far since I recognize my mistake. Windows is installed on the first disk, Gentoo on the second disk. To load GRUB from the second disk I swapped the drives in the bios boot priority settings. So GRUB recognizes Gentoo installed on (hd0,0) and the Windows NTFS partition on (hd1,0). So far so good.

Code:
rootnoverify (hd1)
chainloader +1
boot


This calls the Windows bootloader... and it simply returns "Fehler beim Laden des Betriebssystems" which roughly translates to "Error loading operation system".

My guess is when I installed Windows I had to do it on the first (and only) partition of the first drive. I swapped the drive with Gentoo and the empty, new drive by switching the plugs on the mainboard. Windows was happy and installed itself on the first drive. Now, to load GRUB from the MBR of the second drive I changed the boot priority in the bios configuration to "Boot from second drive first, then from the first drive". It loads GRUB. Like I said above, GRUB thinks the Gentoo drive is (hd0) now (but physically /dev/sdb after booting) and the Windows drive is (hd1) (physically /dev/sda after booting). I can call the Windows bootloader on (hd1) but I think it looks for the boot.ini on (hd0) and fails with that since it can't read the XFS partition there (and wouldn't find boot.ini there even if it could read XFS). And as Microsoft does things: GRUB would say "Error: I tried <this> and <that> happened so I gave up" but the Windows bootloader just says "General Error. Have fun guessing what happened here".

This is a mess... :/
Back to top
View user's profile Send private message
DarkSpir
Tux's lil' helper
Tux's lil' helper


Joined: 04 Feb 2005
Posts: 112

PostPosted: Thu Apr 26, 2012 6:47 pm    Post subject: Reply with quote

It's DONE! I finally found a working solution. You have to map the two drives against each other:
Code:
title Windows XP
map (hd0) (hd1)
map (hd1) (hd0)
chainloader (hd1,0)+1


And that's it. The Windows boot loader (which is called NTLDR) loads and works. The rootnoverify-way works if you install linux and windows together on the same drive.

Source: http://morecode.wordpress.com/2007/02/17/dual-booting-between-windows-and-linux-on-separate-hard-disks/
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1483

PostPosted: Mon Apr 30, 2012 7:30 am    Post subject: Reply with quote

Another approach is to boot Grub via Windows. This works with
Windows 2000 and XP, but I haven't tried it with later versions.
First install Grub, and then edit the BOOT.INI file in Windows
root directory to something like the following:

[boot loader]
timeout=10
default=c:\linux.bin
[operating systems]
c:\linux.bin="Linux Bootloader"
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Professional" /fastdetect

where linux.bin is an image of the first 512 bytes of Grub's boot partition.

The system then gives you two successive menus, the first Windows, the
second Grub. With suitable timeouts, five or ten seconds, this doesn't
delay bootup much, and has the advantage of not touching the drive's MBR.
On laptops (mine at least) that sometimes causes problems.


Will
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