Operating System - Linux
1753905 Members
9917 Online
108810 Solutions
New Discussion юеВ

Re: Can get grub to boot Windows disk

 
kenny chia
Regular Advisor

Can get grub to boot Windows disk

Hi
I just installed OpenSuSE 11.1 and it configured grub to boot Linux and Windows. Unfortunately it could not boot windows properly.

I have the following setup
/dev/sda1 - OpenSuSe Linux
/dev/sdb2 - Windows

Here is the relevant part of /boot/grub/menu.lst

title openSUSE 11.1 - 2.6.27.7-9
root (hd0,0)
kernel /boot/vmlinuz-2.6.27.7-9-pae root=/dev/disk/by-id/ata-ST3160815AS_6RX80V0Z-part1 resume=/dev/disk/by-id/ata-ST316
0815AS_6RX80V0Z-part3 splash=silent showopts vga=0x348
initrd /boot/initrd-2.6.27.7-9-pae

###Don't change this comment - YaST2 identifier: Original name: windows###
title Windows
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd0,0)
makeactive
chainloader +1

During boot up menu I select Windows and it gives the following output

map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd0,0)
makeactive
chainloader +1

GRUB Loading Stage2Read Error

Currently the only way to boot windows is to disconnect the cable to /dev/sda or Linux and power up the PC
How should I configure grub to boot windows properly?







All Your Bases Are Belong To Us!
6 REPLIES 6
Matti_Kurkela
Honored Contributor

Re: Can get grub to boot Windows disk

Does the partition /dev/sdb1 exist? What's on it?

If Windows is on the _second_ partition of /dev/sdb, then perhaps the "rootnoverify" command should be:

rootnoverify (hd0,1)

If this does not help, please show us the output of:

fdisk -l /dev/sdb

MK
MK
kenny chia
Regular Advisor

Re: Can get grub to boot Windows disk

Hi Mk
It still does not work. Here is the output

map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd0,1)
makeactive
chainloader +1

Error 13: Invalid or unsupported executable format

Here is my fdisk output.. Yeah the partition setup is quite strange

linux-a298:~ # fdisk -l /dev/sdb

Disk /dev/sdb: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x343f15eb

Device Boot Start End Blocks Id System
/dev/sdb1 1 31 248976 83 Linux
/dev/sdb2 * 32 3473 27647865 c W95 FAT32 (LBA)
/dev/sdb3 3474 4748 10241437+ 83 Linux
/dev/sdb4 4749 4865 939802+ f W95 Ext'd (LBA)
/dev/sdb5 4749 4865 939771 82 Linux swap / Solaris
All Your Bases Are Belong To Us!
Huc_1
Honored Contributor

Re: Can get grub to boot Windows disk

I think it should be as follows in /boot/grub/menu.lst

title openSUSE 11.1 - 2.6.27.7-9
root (hd0,0)
kernel /boot/vmlinuz-2.6.27.7-9-pae root=/dev/disk/by-id/ata-ST3160815AS_6RX80V0Z-part1 resume=/dev/disk/by-id/ata-ST316
0815AS_6RX80V0Z-part3 splash=silent showopts vga=0x348
initrd /boot/initrd-2.6.27.7-9-pae

###Don't change this comment - YaST2 identifier: Original name: windows###
title Windows
rootnoverify (hd0,0)

chainloader +1

-----------------------------

Hope this helps.

enjoy, life.

Jean-Pierre Huc
Smile I will feel the difference
Huc_1
Honored Contributor

Re: Can get grub to boot Windows disk

You may also want to add the following option to the top of the menu.lst file

default=0
timeout=20

or

defaut=1 if you want windows to boot per default!

timeout is 20 seconds so to leave you time to type a and start an other "default" or start the grub command interface.

Enjoy, life.

Jean-Pierre Huc
Smile I will feel the difference
kenny chia
Regular Advisor

Re: Can get grub to boot Windows disk

Hi Huc
Your grub settings does not work as my windows partition is at /dev/sdb2..
All Your Bases Are Belong To Us!
Matti_Kurkela
Honored Contributor

Re: Can get grub to boot Windows disk

I think "Error 13: Invalid or unsupported executable format" shows improvement of sorts: the original error message indicated that GRUB was trying to run a copy of GRUB (probably something installed on /dev/sdb1). That would cause an infinite loop, if successful.

The new error message indicates GRUB is trying to do something that makes a bit more sense, but failing.

The mapping between /dev/sda & /dev/sdb and the respective GRUB identifiers (hd0) and (hd1) may not be the obvious one.

What is the output of "cat /boot/grub/device.map"?

Just for reference, what is the output of "fdisk -l /dev/sda"? Yes, it should not be touched at all when booting Windows, but your highly customized system is obviously confusing GRUB.

If your BIOS is set to boot from /dev/sdb, it may be that GRUB's (hd0) is actually /dev/sdb and the map commands are actually not needed. If GRUB's device.map file reflects that, it is possible that your active OpenSuSE 11.1 bootloader is currently on /dev/sdb1.

When your system is in GRUB boot menu, press "c" to access GRUB command prompt. Run "find ntldr" and see what it displays. The command may take a while to complete. That should be the most reliable way to find out the actual BIOS disk ordering used by the actual GRUB bootloader (as opposed to the guesswork of the GRUB installer listed in /boot/grub/device.map).

If you get us all this information, I think I might have a chance of solving this puzzle.

MK
MK