SUSE and Windows XP

Hi, I’ve got a problem. Today I installed openSUSE and GRUB does not see Windows XP Professional with Service Pack 2.
Here’s fdisk -l:

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2ddb2dda

Device Boot Start End Blocks Id System
/dev/sda1 2 7833 62910540 f W95 Ext’d (LBA)
/dev/sda2 7834 8025 1542240 82 Linux swap / Solaris
/dev/sda3 * 8026 10603 20707785 83 Linux
/dev/sda4 10604 14593 32049675 83 Linux
/dev/sda5 2 7833 62910508+ 7 HPFS/NTFS

So Windows is on sda5 but GRUB cannot see him.
Here’s menu.lst:

Modified by YaST2. Last modification on wto mar 30 18:38:56 CEST 2010

default 0
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,2)/boot/message
##YaST - activate

###Don’t change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.1 -
root (hd0,2)
kernel /boot/vmlinuz- root=/dev/disk/by-id/ata-Hitachi_HTS541612J9SA00_SB2D51EVG9XH0E-part3 resume=/dev/disk/by-id/ata-Hitachi_HTS541612J9SA00_SB2D51EVG9XH0E-part2 splash=silent showopts vga=0x317
initrd /boot/initrd-

###Don’t change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe – openSUSE 11.1 -
root (hd0,2)
kernel /boot/vmlinuz- root=/dev/disk/by-id/ata-Hitachi_HTS541612J9SA00_SB2D51EVG9XH0E-part3 showopts ide=nodma apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x317
initrd /boot/initrd-

Thanks for your help in advance.

Easiest way is to go to yast2>system>boot and choose ‘other>propose new config’.
Yast should pick up the windows partition.

I tried to do it but still the same problem.
I also tried to write to menu.lst:

title WinXP
root (hd0,4)
chainloader +1

and I’ve even changed root to rootnoverify but still Windows does not work. I checked files in Windows folder and they are okay, I don’t know what’s the problem ?

I was not aware of XP being able to boot from a logical partition.

My checks seem to suggest this feature may have become available at or later than SP2,still there may be some microsoft quirks in it.

Dvhenry is correct, windows XP requires its boot manager be on a primary partition. Best bet is to install windows first, then install suse. Unless you want to run it in a virtual machine.

windows XP requires its boot manager be on a primary partition
That is a common thinking but wrong, I’m booting XP with all files on a logical partition with no problems. Have done so with sp1 and up. Having said that, I would not recommend it due to XP will not run a clean or repair install with out a primary partition. Also not sure if the Recovery Console will have problems or not.

Would suggest using ‘testdisk’ to change XP back to a primary partition.

If you wish to keep XP on a logical partition, you will need to edit XP’s boot.ini file along with your menulst addition.
multi(0)disk(0)rdisk(0)partition(4)\WINDOWS=“XP” /noexecute=optin /fastdetect
multi(0)disk(0)rdisk(0)partition(3)\WINDOWS=“XP” /noexecute=optin /fastdetect

not 100% sure which one is correct, but likely partition(4).

The results from fdisk look very strange.

sda5 is the ntfs partition (windows) and it runs from cylinder 2 to 7833. But that’s also curiously wrapped in the extended partition (sda1). So sda1 is the first primary partition, an extended partition that is now wrapping what used to be the first primary partition. Kind of OK but really weird.

The other three Linux partitions occur at higher cylinder counts as the other three primary partitions, sda2, sda3, sda4.

I think that might be confusing Grub. Alternatively I think windows can’t boot from a boot.ini in a logical partition in an extended partition.


I’d be deleting the openSUSE installation and partitions and changing windows partition back to a primary partition as suggested by LostFarmer. Then I’d very carefully install openSUSE again after making sure there was completely empty space after the windows partition for the installer to use, and I’d check the partitioning proposed by the installer before allowing it to proceed.

@LostFarmer: very interesting this booting win xp from a logical partition. Can you post your fdisk here and also the boot.ini file from the win partition. I’d like to reproduce the situation you have (or similar) on a spare drive just for interest.

sure thing swerdna:

Disk /dev/hdc: 41.1 GB, 41110142976 bytes
255 heads, 63 sectors/track, 4998 cylinders, total 80293248 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xedf7edf7

   Device Boot      Start         End      Blocks   Id  System
/dev/hdc1              63    10249469     5124703+  12  Compaq diagnostics
/dev/hdc2        10249470    37801007    13775769    f  W95 Ext'd (LBA)
/dev/hdc3   *    37801008    40965749     1582371   83  Linux
/dev/hdc4        40965750    80276804    19655527+   c  W95 FAT32 (LBA)
/dev/hdc5        10249533    37800944    13775706    c  W95 FAT32 (LBA)

hdc1 is a restore partition from a different comp
hdc3 is a linux boot with both grub legacy and grub 2 files only
hdc4 is only a storage partition
hdc5 is XP on a fat32 partition but NTFS will normally be easier.

The MBR is from ‘testdisk’ , not grub. I have grub-legacy installed at hdc3 and grub-2 at hdc2.

I do have a second hdd with several XP’s ,98’s and 2 linux’s.

To test you will have to copy/clone from a working XP and if the hdd was used with XP the hdd ID # in the MBR will have to be zeroed out. (use dd to zero all mbr except partition table)

[boot loader]
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Part 1" /noexecute=optin /fastdetect
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="part2" windows/noexecute=optin /fastdetect
multi(0)disk(0)rdisk(0)partition(3)\WINDOWS="part3" /noexecute=optin /fastdetect 
multi(0)disk(0)rdisk(0)partition(4)\WINDOWS="part4" /noexecute=optin /fastdetect 
C:\Linux.bin="MEPIS "

I have partition(1)–(3) to find out just which one worked and have not removed them.

Dad2@mepis1:/mnt/hdc5$ ls
1linux.bin Documents and Settings mbr.bin pagefile.sys
aminf342.exe found.000 mbr…dsk Program Files
ati hiberfil.sys msdos.sys Recycled
autoexec.bat ibmtools sp3
boot.ini io.sys ntldr System Volume Information
config.sys linux.bin p4p800.rom windows

OK so correct me if I’m wrong: The MBR has code to pass you to hdc3 which activates Grub — and grub’s menu.lst contains a chainloader hand-off to hdc5 where boot.ini resides – and you use the fourth entry in boot.ini [multi(0)disk(0)rdisk(0)partition(4)] to boot windows, is that right?

swerdna-- correct, that is my current setup. Grub could have been put into the MBR. My menu.lst has

title XP
rootnoverify (hd0,4)
chainloader +1

If the hdd has only 1 primary partition the the correct boot.ini would be --partition(2). I do not know if XP will boot if it is not on the first logical volume, Win98 will have no problems.

Thanks for bringing this to my attention.

I copied a working xp partition into the extended partition at sda6 and edited it’s boot.ini changing that from …rdisk(0)partition(0) to …rdisk(0)partition(5) (which is actually sda6)

I had the root/boot partition of openSUSE at sda5 and edited the boot.lst of sda5’s Grub to include this chainloader to sda6:

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

And it worked.

So a transplanted windows xp will boot from Linux’s Grub using Grub’s chainloader entry, just as you said.

Thanks again!

And it worked.
and I’m hurt. :slight_smile:
Now I have a 2nd party proof and will link to this page when others prefer to discount what is not written on their favorite web site.

What I would like to know is why Suse installer likes to change a XP primary to logical volume. Once every couple months someone posts with the problem. I would call it a bug.

I believed what you said earlier. Just needed to discover whether I could do it too or if your experience came about through unusual circumstances that I couldn’t reproduce. The expression “and it worked” was more a statement of glee that it’s quite straightforward.

I’ve thought it likely a bug for quite a while but wasn’t very interested. Now that it has caught my interest, I will try to reproduce it on a test machine and see if there are specific actions that make it happen.

In principle, once you have got to boot.ini, there is no reason why not boot XP from a logical partition. When I was doing dual boot with NT years ago *, I had DOS on C: with boot.ini - but NT was on logical partition D:. The only reason boot.ini was on C: AFAICS is that this is where the DOS-Windows MBR expected it to be. For fun I copied the MBR using dd to my linux partition and I used to use Lilo [predecessor to GRU] to boot NT from that MBR. So is GRUB doing something reasonably clever with the DOS-Windows MBR? If you knew what you were doing it would be a small hack.

The other thing I could do was point NT’s boot.ini to a file which was a dd copy of the disk MBR and start Lilo from that and just boot lilo and the NT boot.ini bootmanager from each other in turn as many times as I wanted. So it could be that Microsoft have cahnged their booting to provide 2 MBR’s - firstly, 1 to boot the boot.ini manager and secondly a fuller MBR to boot post NT windows. If the boot.ini manager was not required than only the latter boot sector would be installed.

No real idea, this is just speculation.*

I tried to get it to reproduce the bug but can’t.

I tried to get it to reproduce the bug but can’t.
Not to surprised as it seems troublesome but not to often.

I decided to do some more testing, using a GHOST image replaced XP on hdc5 and could not get it to complete boot. Booted only to the light blue with dark blue top bottom screen. Upon more testing found out that hda4 FAT32 was the problem. Changed the file type 0C to 1C (hidden) and that fixed the problem. It seems if there are any primary partition of FATxx or NTFS then they must be hidden or XP will try to finish the boot up on any lower order partitions and fail. After a couple boot ups changing hda4 back to 0C did not cause any problem.

Likely will not know if the OP fixed their problem.:frowning:

You should be able to boot hdc4 from grub regardless of other fat/ntfs partitions, provided you use the correct map function. Instead of the map function you can edit the boot.ini file.