Adding Windows XP to the GRUB boot list

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
AudioCanine

Adding Windows XP to the GRUB boot list

Post by AudioCanine »

Up until very recently I was running Windows XP on my Acer Aspire 4315 (laptop) and after some browsing, decided to dual boot Linux Mint. I went about partitioning off a space for Windows and had it running fine. I then burnt a copy of the Mint live CD, used the mint partitioner to make room for it and then installed it. Mint boots fine and runs great, the problem is with Windows. After booting in Mint I noticed that Windows was not listed in the boot list but figured that it wasn't a big issue and went off to add an entry for Windows in /boot/grub/menu.lst. I added as follows to the file:

title Windows XP Professional SP3
root (hd0,0)
savedefault
makeactive
chainloader +1


This didn't work. When I select this option from the boot list it says "Error 13: Invalid or unsupported executable format".

Now from the very little I've gathered blundering at this all night, the issue would be that the entry "root (hd0,0)" is referencing the wrong partition and that I need to change the entry so that it points to the right one. Because I'm not sure what I'm talking about, I'm going to leave this to you, the experts, and go to sleep. Any and all help is greatly appreciated on my long journey to understanding Linux.

Best of luck,
- The Audio Canine
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Aging Technogeek

Re: Adding Windows XP to the GRUB boot list

Post by Aging Technogeek »

AudioCanine;

First of all, welcome to Mint.

About your problem - run Partition Editor and post a copy of your partition table so we can see what you've got. Be careful not to hit "New Partition Table" or "Edit Partition" unless you want to reinstall both XP and Mint.
AudioCanine

Re: Adding Windows XP to the GRUB boot list

Post by AudioCanine »

I've taken a capture of Partition Editor, here it is:

Image

Now I'm familiar with partition tables and can name off and define most of what's here but I did notice one thing that confused me. Normally my Windows partition is a stand alone NTFS partition but it appears to be listed here as a sub partition of an extended partition. I've never seen this before... I should probably now go on to explain that my normal computer setup is to have a Windows boot partition, a Linux boot partition and an NTFS partition filled with assorted files and apps that is not marked to boot. My plan currently is to get Windows to boot and then create that shared partition from the Windows partitioner.

Thank you very much for taking the time to help me :)

- The Audio Canine
Aging Technogeek

Re: Adding Windows XP to the GRUB boot list

Post by Aging Technogeek »

You can try changing your grub entry to point to (hd0,4). This is the partition that Windows is occupying..

I do find it odd that Windows is in an extended partition since you say you didn't set it up that way. Also odd is that dev/sda4 is shown as the boot location. Normally, Grub just overwrites the Windows bootloader in (hd0,0) also known as (dev/sda1).

When you installed Mint, did you use the Advanced settings button in step 6 to direct Grub to install to (hd0,3) ?
AudioCanine

Re: Adding Windows XP to the GRUB boot list

Post by AudioCanine »

No, in fact I didn't. I clicked the advanced tab but never played with the settings in it. I've also tried changing (hd0,0) to (hd0,4) and to every other number between 0 an 6 but to no avail. Same or similar errors ensue.
Aging Technogeek

Re: Adding Windows XP to the GRUB boot list

Post by Aging Technogeek »

AudioCanine;

I think I've got it figured out. When you established the primary partition for Mint and labeled it dev/sda3 instead of dev/sda2, the partitioner set up the extended partition dev/sda1 with dev/sda5 inside it. When you tell Grub to boot (hd0,0), it goes to dev/sda1 and finds no bootable entry. Hopefully the Windows bootloader went into dev/sda5 along with Windows. In this case, redirecting Grub to (hd0,4) will boot Windows.

The bad possibility is that when the extended partition was set up, the Windows bootloader was destroyed. If this happened, you can try entering Windows recovery mode and running "fixmbr". This hopefully would repair the Windows bootloader. But first try the (hd0,4) fix. If that works all else is academic.

While I was writing this you posted your response to my last post so most of this is obsolete. It sounds like the Windows mbr was destroyed when the extended partition was created. If you are running Vista, you can recreate the mbr using Easy BCD http://www.pcworld.com/downloads/file/f ... ml?&page=9 . If you are running XP, it may not be so easy.

Sorry, but I really don't know enough about Windows repair to help any further.
AudioCanine

Re: Adding Windows XP to the GRUB boot list

Post by AudioCanine »

Sadly I'm running Windows XP. I get the feeling the Windows boot loader was in fact destroyed (I've searched for the boot.ini file and can't find it anywhere on the NTFS partition). My thoughts as to a final solution is to put my Windows XP install CD back in, format the entire HDD and try it all again. Now if I am to go about this course, should I install Windows or Mint first?

Thanks again for all the help :)

- The Audio Canine
Aging Technogeek

Re: Adding Windows XP to the GRUB boot list

Post by Aging Technogeek »

The procedure is much simpler if Windows is installed first. As I thought about your situation today I came to the conclusion that your original Windows install must have been on a logical partition. This would have been converted to an extended partition as soon as you set the first primary partition for Mint. This is probably what wiped out your mbr. If/when you reinstall Windows just run the install disk and let Windows install to the whole disk in a primary partition. Then when you install Mint, choose logical partitions . This selection automatically creates the needed extended partition. Grub should install to (hd0,0) over the Windows mbr and set up your dual boot menu by default.

EDIT

Hold off on reinstalling until you read this post, with it you may be able to save your installation. When the procedure talks about installing Grub into your Linux partition, just substitute your Windows partition.

http://forums.linuxmint.com/viewtopic.p ... &sk=t&sd=a

The procedure also references the nano text editor. Mint 6 normally uses Gedit but things are done similarly (except to save in gedit just click the floppy disk icon in the toolbar). And the command in Mint is gksu gedit /boot/grub/menu.lst (that's a lower case L not a 1)
AudioCanine

Re: Adding Windows XP to the GRUB boot list

Post by AudioCanine »

Sorry I took so long to update. I decided to try to fix the issue of the Windows partition being extended by formatting it, repartitioning and reinstalling Windows to the new partition. This, I am happy to say, worked great and Windows is now located on the first partition (C:\ or /dev/sda1). I then thought back to you asking me if I had gone into the advanced settings in the installation process and decided that (at least in my mind) it makes more sense for grub to be installed on my Mint partition so I reinstalled Mint to the second partition (/dev/sda2) and through the advanced settings in the installation process, I directed it to install grub to /dev/sda2. I am happy to say that both Windows XP and Linux Mint 6 are happily coexisting on my laptop and function perfectly. Here is what my partition table looks like now.

Image

Thank you so much for all your help and especially your patience ^.^

- The Audio Canine
Locked

Return to “Installation & Boot”