PDA

View Full Version : [ubuntu] 8.04LTS + XP DualBoot installation problem.



Ero
April 25th, 2008, 12:09 AM
I had XP and decided to install Hardy. Created swap of 2GB and a 14.3GB for ext3 with boot flag on. Installation went smooth. GRUB was install to the MRB. After that everything went down hill. I could not boot neither XP nor Hardy. I get an error message saying error loading OS. Using 7.10 Live CD to type this. I tried reinstalling Hardy but this time with boot flag off with everything else the same. This time I still cannot boot neither OS and get an error message saying "DISK BOOT FAILED, INSERT... AND PRESS ENTER".

CD passed the test.

Any help is appreciated.

dstew
April 25th, 2008, 12:56 AM
Your BIOS needs at least one partition to have the boot flag checked. That is why you are getting the boot disk failure message. Use the Gnome Partition Editor from the Live CD and check the boot flag on the XP partition. Ubuntu does not need the boot flag to be set, but it might help XP to boot.

As to why the grub menu items don't boot, we need to get some information. From a Live CD boot, open a terminal (Applications --> Accessories --> Terminal) and on the command line enter
sudo fdisk -lThat will display a list of the partitions on your hard disks. Post the list to the forum.

Can you see the Ubuntu partition on the desktop of the Live CD boot? If so, open it, and navigate to the /boot/grub directory. You should find there a file named menu.lst. Open the file with a text editor, and post the contents of the file to the forum.

Ero
April 25th, 2008, 01:34 AM
There is no boot flag set for the XP.


sudo fdisk -l:


Disk /dev/sda: 750.1 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x525b4bab

Device Boot Start End Blocks Id System
/dev/sda1 * 1 91201 732572001 7 HPFS/NTFS

Disk /dev/sdb: 300.0 GB, 300069052416 bytes
16 heads, 63 sectors/track, 581421 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Disk identifier: 0xb14b460c

Device Boot Start End Blocks Id System
/dev/sdb1 1 581418 293034640+ 7 HPFS/NTFS

Disk /dev/sdc: 74.3 GB, 74355769344 bytes
255 heads, 63 sectors/track, 9039 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x107a107a

Device Boot Start End Blocks Id System
/dev/sdc1 1 2613 20988891 7 HPFS/NTFS
/dev/sdc2 4590 9039 35744625 7 HPFS/NTFS
/dev/sdc3 2614 2856 1951897+ 82 Linux swap / Solaris
/dev/sdc4 2857 4589 13920322+ 83 Linux

Partition table entries are not in disk order

Disk /dev/sdd: 400.0 GB, 400088457216 bytes
16 heads, 63 sectors/track, 775221 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Disk identifier: 0x97785a0a

Device Boot Start End Blocks Id System
/dev/sdd1 1 209270 105472048+ 7 HPFS/NTFS
/dev/sdd2 209271 418540 105472080 7 HPFS/NTFS
/dev/sdd3 418541 627810 105472080 7 HPFS/NTFS
/dev/sdd4 627811 775217 74293128 7 HPFS/NTFS
ubuntu@ubuntu:~$




/dev/sdc is the drive where XP and Hardy are installed on.


Here's the menu.lst


# 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=1ba08e40-87f0-420b-a8f4-c8c50424f7fb ro

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

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

## 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 Ubuntu 8.04, kernel 2.6.24-16-generic
root (hd2,3)
kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=1ba08e40-87f0-420b-a8f4-c8c50424f7fb 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 (hd2,3)
kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=1ba08e40-87f0-420b-a8f4-c8c50424f7fb ro single
initrd /boot/initrd.img-2.6.24-16-generic

title Ubuntu 8.04, memtest86+
root (hd2,3)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sdc1
title Microsoft Windows XP Professional
root (hd2,0)
savedefault
makeactive
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1

dstew
April 25th, 2008, 01:13 PM
It looks like the menu.lst is set up properly. Set the boot flag on /dev/sdc1. Please post the exact error message if it does not boot.

Ero
April 25th, 2008, 06:36 PM
When I try to set the boot flag on /dev/sdc1 the Gnome Partition Editor crashes but the flag is on. When I reboot I can load XP without problems.

dstew
April 25th, 2008, 07:30 PM
When I try to set the boot flag on /dev/sdc1 the Gnome Partition Editor crashesThat's not good. Anyway, can you boot XP from the grub menu now? How about Ubuntu?

Ero
April 25th, 2008, 09:20 PM
can you boot XP from the grub menu now? How about Ubuntu?

I don't get the GRUB menu, I just log on to XP directly, as if XP was the only OS.

Btw, GRUB should be installed in (hd0) right? Do my HDs order matter? Because the HD that has XP and Ubuntu is /dev/sdc.

dstew
April 26th, 2008, 12:34 AM
Grub is in two pieces. The little boot loader you install in the MBR of the boot disk, which is usually (hd0). The other piece of grub is in the /boot/grub directory of your Ubuntu partition. When it is installed correctly, the grub boot loader will load the stage2 file from the /boot/grub directory, wherever it is, and then get the menu. The boot disk order only matters to the tiny boot loader in the MBR, because it is the BIOS that load it. But the boot loader, when you install it, is "hard wired" to look in the Ubuntu partition. If you switch the disks around, the boot loader will not be able to find the Ubuntu partition.

If it boots directly to XP, it is likely that the grub boot loader is not present any more in the MBR of the boot disk. You will have to re-install grub. It is pretty easy to do, and if you mess up you can re-install the Windows boot loader from the Windows recovery console (fixmbr command). To re-install grub, see this thread (http://ubuntuforums.org/showthread.php?t=224351).