LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   grub: windows on logical partition (https://www.linuxquestions.org/questions/linux-software-2/grub-windows-on-logical-partition-607114/)

festhead 12-16-2007 08:48 AM

grub: windows on logical partition
 
hi,

how do I boot into windows with grub?
my windows is installed on hda7, which is a part of hda4 (logical partition)

i (re-) installed windows after linux (i know...), and fixed the mbr already, but the new windows is not accessable

thx!

TSquaredF 12-16-2007 08:56 AM

Hello, festhead.
I won't claim to be an expert on this, because I normally install windows in hda1, as recommended. That said, however, you can remap partitions in GRUB (read 'info grub') to make windows think it is running on the first partition.
Regards,
Bill

David1357 12-16-2007 10:23 AM

Quote:

Originally Posted by festhead (Post 2992200)
how do I boot into windows with grub?
my windows is installed on hda7, which is a part of hda4 (logical partition)

Before you do what I describe below, copy "/boot/grub/menu.lst" to "/boot/grub/menu.lst.good" or the equivalent.

My Windows entry in "/boot/grub/menu.lst" looks like this:
Code:

title          Microsoft Windows XP Home Edition
root            (hd0,0)
savedefault
makeactive
chainloader    +1

If you change (hd0,0) to (hd0,7), you will be able to boot Windows. You might have to toggle the "bootable" flag using fdisk.

syg00 12-16-2007 12:22 PM

Ain't gunna work.
Even though you installed Windoze to a logical partition, the actual loader code (ntldr, boot.ini) has to be in a primary partition.
That's what you need to chainload to.

David1357 12-17-2007 08:21 AM

Quote:

Originally Posted by syg00 (Post 2992341)
Even though you installed Windoze to a logical partition, the actual loader code (ntldr, boot.ini) has to be in a primary partition.
That's what you need to chainload to.

I forgot about needing to change the "boot.ini" file. Your "boot.ini" will look like this:

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Windows XP Home" /noexecute=optin /fastdetect
You need to change the "partition(X)" to "partition(7)". I have never heard of this "primary" partition restriction.

David1357 12-17-2007 04:17 PM

Quote:

Originally Posted by syg00 (Post 2992341)
Ain't gunna work.
Even though you installed Windoze to a logical partition, the actual loader code (ntldr, boot.ini) has to be in a primary partition.
That's what you need to chainload to.

If I read the GRUB manual correctly, you set the current root device to hda7 with the "root (hd0,7)" line. The Windows bootloader is in the first sector of a Windows partition. The "chainloader +1" tells GRUB to read the first sector of the current partition. As long as the "boot.ini" file is modified to use the correct partition, (e.g. multi(0)disk(0)rdisk(0)partition(7)\WINDOWS), everything should work.


All times are GMT -5. The time now is 06:43 AM.