Dual Boot XP Home and Ubuntu 8.04 with 2HD

Asked by Elijah

I already had windows xp home installed on one hard drive.
then installed ubuntu 8.04 on another.

when I try to set xp in grub and try to boot to xp it goes into system recovery.

Here is my fdisk -l :

Disk /dev/sda: 40.9 GB, 40982151168 bytes
255 heads, 63 sectors/track, 4982 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x19e0f1b7

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 4772 38331058+ 83 Linux
/dev/sda2 4773 4982 1686825 5 Extended
/dev/sda5 4773 4982 1686793+ 82 Linux swap / Solaris

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
240 heads, 63 sectors/track, 20673 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0xa70da70d

   Device Boot Start End Blocks Id System
/dev/sdb1 * 1 566 4278928+ b W95 FAT32
/dev/sdb2 567 20672 152001360 7 HPFS/NTFS

Here is my grub output :

# 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 3

## 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
# 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=6b24c162-3ef6-4e23-8999-3baf4d0ae2ed ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## 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

## 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 Windows XP
root (hd1,0)
makeactive
chainloader +1
map (hd0)(hd1)
map (hd1)(hd0)

title Ubuntu 8.04, kernel 2.6.24-16-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=6b24c162-3ef6-4e23-8999-3baf4d0ae2ed ro quiet splash
initrd /boot/initrd.img-2.6.24-16-generic
quiet

title Ubuntu 8.04, kernel 2.6.24-16-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=6b24c162-3ef6-4e23-8999-3baf4d0ae2ed ro single
initrd /boot/initrd.img-2.6.24-16-generic

title Ubuntu 8.04, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Tyro
Solved:
Last query:
Last reply:
Revision history for this message
Knut Karevoll (gnonthgol) said :
#1

Windows don't like to come on another hd then the first. Even if grub remaps the hds windows might find out with its own controller drivers.
You can try to rearange your hds so that windows becomes hda1 and ubuntu becomes hdb1. This require you to change your grub configuration and install grub again on the windows drive.

Revision history for this message
Elijah (elijah-fppeht) said :
#2

what should I change my current grub configuration to?

how do I install grub on windows xp?

Revision history for this message
Nathaniel (kuroryuu) said :
#3

I don't believe you can install grub on windows, but what you should try is what Knut suggested and switch the hard drives so that windows is the first drive, make sure to update your ubuntu drive references of course and install grub on the first hd

Revision history for this message
Elijah (elijah-fppeht) said :
#4

You say I cant install grub on windows but you say that needs to be the first HD. Let me rephrase the question. How do I install grub on the drive that windows is on which is the first HD.

Revision history for this message
ex-xp64 (ex-xp64) said :
#5

what happens when you change the windows root line in menu.lst:

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

(hd1,0)/sdb1 is a recovery partition. Xp is on (hd1,1)/sdb2

OTH, that may not work either since the boot files may actually be on the first partition (which may explain why recovery mode is being triggered)

The drive mapping you've included is the standard way to enable booting windows on a non-first hard disk

Revision history for this message
Elijah (elijah-fppeht) said :
#6

ex-xp64 I tryed the:

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

It says unrecognized string

Revision history for this message
Elijah (elijah-fppeht) said :
#7

When I look at the recovery partition on XP there just is a icon lock that says recovery. No other files unless the boot files are in with the recovery lock icon.

Revision history for this message
Best Tyro (ffnodig224) said :
#8

I`ve more or less the same configuration. On my /dev/sda I've installed Ubuntu (Linux system) and on my /dev/dsb2 (the NTFS system) I've installed Windows (Vista, but is is all the same). So no need to change your environment as long as you direct your BIOS to start from the Ubuntu disk (where the GRUB is loaded).

My /boot/grub/menu.lst under the new 2.6.24-17 kernel for the Windows environment reads:

title Windows Vista Ultimate
root (hd1,1)
savedefault
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1

So you are missing the 'savedefault' command and you really should have the chainloader +1 command your very last command! First the map commands, then the chainloader.

Hope this helps.
Greetings

Revision history for this message
Tyro (ffnodig224) said :
#9

One remark: since your boot sector is located on /dev/sdb1 (see the * in your fdisk listing and not on sdb2 as in my case) your command in menu.lst should read 'root (hd1,0)'.

Sorry for the inconvenience.
Succes

Revision history for this message
Elijah (elijah-fppeht) said :
#10

Got it working with this:

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

Also on my mapping there was no space between the "(hd0)nospacehere(hd1)" on either one. I guess it saw it as one string.

Thank you all very much for helping this noob out!

Revision history for this message
Elijah (elijah-fppeht) said :
#11

Thanks Tyri, that solved my question.

Revision history for this message
Tyro (ffnodig224) said :
#12

Ok, thats why this community is here! Good luke with it ;-))

Tyri