Can't boot XP from GRUB

Asked by Lachlan Summer

I am attempting to install a dual boot XP and Ubuntu 9.04 system, not very successfully it seems!

I did have it working, but then needed to reinstall XP again (after Ubuntu). I've tried re-installing twice, with the same result.

I followed the guide here (suggested by sam in another question):

http://apcmag.com/how_to_dual_boot_linux_and_windows_xp_linux_installed_first.htm

XP worked fine, booting automatically before I restored and edited menu.lst to restore the GRUB bootloader, adding the following text to the very end of the file (after ### END DEBIAN AUTOMAGIC KERNELS LIST)

[b]title Windows XP
root (hd0,1)
makeactive
chainloader +1[/b]

However now XP will not Boot from GRUB. When I select XP from GRUB I get the following message:

[b]Error 13: Invalid or unsupported executable format

Press any key to continue ...[/b]

I'm not sure if it is related that I seem to have more partitions than the article indicates. When I open GParted I have the following:

/dev/sda1 ext 3 37.41GiB
/dev/sda2 linux swap 1.65 GiB boot
/unallocated 2.31 MiB
/dev/sda3 ntfs 33.32GiB
unallocated 4.61MiB
> /dev/sda4 extended 2.14GiB (this partition opens and closes to reveal the next one)
      /dev/sda5 linux-swap 2.14 GiB

The extra partitions meant XP installed on a drive letter lower than otherwise (G instead of F I think)

Can anybody help?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub Edit question
Assignee:
No assignee Edit question
Solved by:
marcobra (Marco Braida)
Solved:
Last query:
Last reply:
Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#1

Please tell if you are able to boot from installed Ubuntu...?

If yes, boot from installed Ubuntu and

Open a Terminal from the menu Applications → Accessories → Terminal and type:

sudo fdisk -l

give your user password when requested, you don't see nothing when you type it, then press enter.

Please select the terminal result copy and paste here.

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

Then type:

gedit /boot/grub/menu.lst

Please select all the just opened file contents and paste here.

Thank you

Revision history for this message
Lachlan Summer (lachlansummer) said :
#2

lachlan@Summer-Ubuntu-desktop:~$ sudo fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x24da24d9

   Device Boot Start End Blocks Id System
/dev/sda1 1 4884 39230698+ 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 * 4885 5099 1726987+ 82 Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3 5100 9450 34942320 7 HPFS/NTFS
Partition 3 does not end on cylinder boundary.
/dev/sda4 9451 9729 2241067+ 5 Extended
Partition 4 does not end on cylinder boundary.
/dev/sda5 9451 9729 2241036 82 Linux swap / Solaris

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

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=921a2379-eedc-405c-8e53-722ce7ab70b6 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=921a2379-eedc-405c-8e53-722ce7ab70b6

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## specify if running in Xen domU or have grub detect automatically
## update-grub will ignore non-xen kernels when running in domU and vice versa
## e.g. indomU=detect
## indomU=true
## indomU=false
# indomU=detect

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 9.04, kernel 2.6.28-15-generic
uuid 921a2379-eedc-405c-8e53-722ce7ab70b6
kernel /boot/vmlinuz-2.6.28-15-generic root=UUID=921a2379-eedc-405c-8e53-722ce7ab70b6 ro quiet splash
initrd /boot/initrd.img-2.6.28-15-generic
quiet

title Ubuntu 9.04, kernel 2.6.28-15-generic (recovery mode)
uuid 921a2379-eedc-405c-8e53-722ce7ab70b6
kernel /boot/vmlinuz-2.6.28-15-generic root=UUID=921a2379-eedc-405c-8e53-722ce7ab70b6 ro single
initrd /boot/initrd.img-2.6.28-15-generic

### END DEBIAN AUTOMAGIC KERNELS LIST

title Windows XP
root (hd0,1)
makeactive
chainloader +1

Revision history for this message
Lachlan Summer (lachlansummer) said :
#3

Oh, and yes Ubuntu boots fine.

Thanks for your help.

Revision history for this message
Best marcobra (Marco Braida) (marcobra) said :
#4

Open a Terminal from the menu Applications → Accessories → Terminal and type:

sudo gedit /boot/grub/menu.lst

give your user password when requested, you don't see nothing when you type it, then press enter.

At bottom of file modify the

title Windows XP
root (hd0,1)
makeactive
chainloader +1

to

title Windows XP
root (hd0,2)
makeactive
chainloader +1

Save and try to reboot

Revision history for this message
Lachlan Summer (lachlansummer) said :
#5

Works now.

Thank you so much (I almost had it figured out!).

Any idea why the extra partitions are there, if I need them, if not how to delete them?

Revision history for this message
Lachlan Summer (lachlansummer) said :
#6

Thanks marcobra (Marco Braida), that solved my question.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#7

Try using gparted to select then delete the

/dev/sda5

and then the

/dev/sda4

partitions

Please boot your pc entirely from the live cd and use the menu Systerm→Administration→Partition editor
to delete them.

As a suggestion why you not install the incoming Ubuntu 9.10 instead of 9.04 so you will have the top of edge of Ubuntu.

If you want some tips or info please tell

Hope this helps

Revision history for this message
Lachlan Summer (lachlansummer) said :
#8

/dev/sda4 and /dev/sda5 both appear with key icons next to them in gparted when booting from the live CD. I gather this means they are in use and the delete option is greyed out... however I tried your instructions after booting normally and it worked fine (now I have 2.14 GiB unallocated HDD on the other end of my NTFS partition though - is there a good use for this space?)

Is 9.10 already stable enough for normal use? Is it better to upgrade or do a fresh install? How would I do it? Like this it says here?

http://www.ubuntu.com/testing/karmic/alpha2#Upgrading%20from%20Ubuntu%209.04

Thanks again.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#9

I suggest you to install the Ubuntu 9.10 using the daily live image is stable enough to be used...

Here the release schedule https://wiki.ubuntu.com/KarmicReleaseSchedule

http://cdimage.ubuntu.com/daily-live/20091018/

Here the file to download and to burn to download it now please open a terminal and type:

wget http://cdimage.ubuntu.com/daily-live/20091018/karmic-desktop-i386.iso

then check the md5sum of downloaded iso

md5sum karmic-desktop-i386.iso

the result must be

c6a2544f122fd1f9edafef96a6e52219 *karmic-desktop-i386.iso

Then please use Ubuntu brasero to burn it... burn at lower speed brasero can do...

Then boot from Ubuntu karmic live cd and delete all exixteing Ubuntu partititons using the
System→administration→Partition editor

Then install it...

Hope this helps

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#10

Then please open a new question to get help if you have some issue... ( i think you will have not) to install Karmic.

Installing Karmic you will get benefit of new features
http://www.ubuntu.com/testing/karmic/beta#New%20features%20since%20Ubuntu%209.04

Best regards

Revision history for this message
Lachlan Summer (lachlansummer) said :
#11

Thanks so much :)