-   Linux - Newbie (
-   -   Dual boot: Ubuntu 8.04 and XP. XP won't boot now - loops back to Ubuntu (

Slowbey 01-02-2009 10:16 AM

Dual boot: Ubuntu 8.04 and XP. XP won't boot now - loops back to Ubuntu
Dear all,
I have been using Ubuntu 8.04 and XP on a single partitioned hard drive for about four months now without problems. Ubuntu is the default option if I do nothing at the opening menu.

I booted up yesterday and went into the XP option. This time, it went through a process checking the hard drive sector by sector and correcting apparent "errors".

Now when I try to get into XP it loops back into the Ubuntu userid screen and I can't seem to access XP at all.

I would like to keep the dual booting if at all possible, but would prefer to avoid the pain of reinstalling one or both of the OS.

Any suggestions would be most welcome.

Many thanks

arckane 01-02-2009 10:39 AM

Do you know which bootloader you use? I assume grub here, so please give us the info in the file /boot/grub/menu.lst


CQ1ST 01-02-2009 10:50 AM

unfortunately this is looking like a windows problem
if your grub/menu.lst is looking like:
title WindowsXP
root (hd0,0)
chainloader +1
and grub hands the bootstraps over to a windows kern. then you'll have to do something like :: boot windows>press F8 and choose (maybe if the other options fail) safe mode??> then run
chkdsk c: /R /F ??? (which it should say "lets reboot to do that")
(and now you may need to boot into recovery console with your xp disk)
maybe :: Running Chkdsk from the Recovery Console?

this'll recover mbr if it's lost
but "this'll recover grub 'after' windows claims it all back

otherwise I'd suggest that you talk to some one who knows and uses windows really

3rods 01-02-2009 10:56 AM

Did you happen to install any 3rd party apps that may have accessed the boot loader for XP? (i.e. Norton Ghost, Partition Magic)

Your menu.lst file should have something like this under the "Other Operating Systems" area:


title Microsoft Windows XP Professional
root (hd0,0)
chainloader +1

The root (hd0,0) points to the first partition in the first physical drive; if you installed Ubuntu before XP, it might be on a different partition.

CJS 01-02-2009 11:20 AM

I agree with CQ1ST and 3rods, it sounds like most likely you have a Windows problem and not a Grub problem. But in order to get a better picture of your setup, how about opening a terminal (Applications > Accessories > Terminal) and do:

cd ~/Desktop && wget '' && sudo bash boot_info_script.txt
That will create a "RESULTS.txt" file in the same directory from where the script is run, namely your desktop; please copy/paste the contents of that file to your next post, highlight the copied text, and click the pound sign # graphic in the Ubuntu forum message box so that the text will get "code" tags put around it. The results of that script will help clarify your setup and maybe shed some light on your Windows booting problem.

Slowbey 01-02-2009 06:00 PM

Here's the output of the results.txt file as requested.
Hope this helps.


============================= Boot Info Summary: ==============================

 => Drive sda does not have a valid partition table.
 => Drive sdb does not have a valid partition table.
 => Drive sdc does not have a valid partition table.
 => Drive sdd does not have a valid partition table.
 => Grub is installed in the MBR of /dev/sde and looks on the same drive in
    partition #2 for its boot files.

sde1: _________________________________________________________________________

    File system:      ntfs
    Boot sector type:  Windows XP
    Boot sector info:  According to the info in the boot sector, sde1 has
                      287483111 sectors, but according to the info from
                      fdisk, it has 287483112 sectors.
    Operating System:  Windows XP
    Boot files/dirs:  /boot.ini /ntldr /NTDETECT.COM

sde2: _________________________________________________________________________

    File system:      ext2
    Boot sector type:  Unknown
    Boot sector info: 
    Operating System:  Ubuntu 8.04.1
    Boot files/dirs:  /boot/grub/menu.lst /etc/fstab /boot /boot/grub

sde3: _________________________________________________________________________

    File system:      swap

=========================== Drive/Partition Info: =============================

Drive sda: _____________________________________________________________________

fdisk -lu /dev/sda:

sfdisk -V /dev/sda:

/dev/sda: No medium found

sfdisk: cannot open /dev/sda for reading

Drive sdb: _____________________________________________________________________

fdisk -lu /dev/sdb:

sfdisk -V /dev/sdb:

/dev/sdb: No medium found

sfdisk: cannot open /dev/sdb for reading

Drive sdc: _____________________________________________________________________

fdisk -lu /dev/sdc:

sfdisk -V /dev/sdc:

/dev/sdc: No medium found

sfdisk: cannot open /dev/sdc for reading

Drive sdd: _____________________________________________________________________

fdisk -lu /dev/sdd:

sfdisk -V /dev/sdd:

/dev/sdd: No medium found

sfdisk: cannot open /dev/sdd for reading

Drive sde: _____________________________________________________________________

fdisk -lu /dev/sde:

Disk /dev/sde: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders, total 390721968 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x2b915dcc

  Device Boot      Start        End      Blocks  Id  System
/dev/sde1  *          63  287483174  143741556    7  HPFS/NTFS
/dev/sde2      288559530  390716864    51078667+  83  Linux
/dev/sde3      287483175  288559529      538177+  82  Linux swap / Solaris

Partition table entries are not in disk order

sfdisk -V /dev/sde:

partition 2: start: (c,h,s) expected (1023,254,63) found (1023,0,1)
partition 3: start: (c,h,s) expected (1023,254,63) found (1023,0,1)
/dev/sde: OK

blkid -c /dev/null: ____________________________________________________________
/dev/sde1: UUID="2AC8E42BC8E3F2CD" TYPE="ntfs"
/dev/sde2: UUID="e8e3a797-252e-4490-b39d-7f377bf2484c" TYPE="ext2"
/dev/sde3: TYPE="swap" UUID="06f9c1e4-9870-444c-ba2e-4965f981e7ea"

=============================== "mount" output: ===============================
/dev/sde2 on / type ext2 (rw,relatime,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.24-22-generic/volatile type tmpfs (rw)
securityfs on /sys/kernel/security type securityfs (rw)
gvfs-fuse-daemon on /home/david/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=david)
/dev/sde1 on /media/disk type fuseblk (rw,nosuid,nodev,noatime,allow_other,blksize=4096)
Unknown BootLoader  on /dev/sde2

00000000  f6 f6 f6 f6 f6 f6 f6 f6  f6 f6 f6 f6 f6 f6 f6 f6  |................|

================================ sde1/boot.ini: ================================

[boot loader]



[operating systems]

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition" /fastdetect /NoExecute=OptIn

=========================== sde2/boot/grub/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)

# 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

## 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=e8e3a797-252e-4490-b39d-7f377bf2484c ro

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

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

## 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.1, kernel 2.6.24-22-generic
root                (hd0,1)
kernel                /boot/vmlinuz-2.6.24-22-generic root=UUID=e8e3a797-252e-4490-b39d-7f377bf2484c ro quiet splash
initrd                /boot/initrd.img-2.6.24-22-generic

title                Ubuntu 8.04.1, kernel 2.6.24-22-generic (recovery mode)
root                (hd0,1)
kernel                /boot/vmlinuz-2.6.24-22-generic root=UUID=e8e3a797-252e-4490-b39d-7f377bf2484c ro single
initrd                /boot/initrd.img-2.6.24-22-generic

title                Ubuntu 8.04.1, kernel 2.6.24-21-generic
root                (hd0,1)
kernel                /boot/vmlinuz-2.6.24-21-generic root=UUID=e8e3a797-252e-4490-b39d-7f377bf2484c ro quiet splash
initrd                /boot/initrd.img-2.6.24-21-generic

title                Ubuntu 8.04.1, kernel 2.6.24-21-generic (recovery mode)
root                (hd0,1)
kernel                /boot/vmlinuz-2.6.24-21-generic root=UUID=e8e3a797-252e-4490-b39d-7f377bf2484c ro single
initrd                /boot/initrd.img-2.6.24-21-generic

title                Ubuntu 8.04.1, kernel 2.6.24-16-generic
root                (hd0,1)
kernel                /boot/vmlinuz-2.6.24-16-generic root=UUID=e8e3a797-252e-4490-b39d-7f377bf2484c ro quiet splash
initrd                /boot/initrd.img-2.6.24-16-generic

title                Ubuntu 8.04.1, kernel 2.6.24-16-generic (recovery mode)
root                (hd0,1)
kernel                /boot/vmlinuz-2.6.24-16-generic root=UUID=e8e3a797-252e-4490-b39d-7f377bf2484c ro single
initrd                /boot/initrd.img-2.6.24-16-generic

title                Ubuntu 8.04.1, memtest86+
root                (hd0,1)
kernel                /boot/memtest86+.bin


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

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title                Microsoft Windows XP Home Edition
root                (hd0,0)
chainloader        +1

=============================== sde2/etc/fstab: ===============================

# /etc/fstab: static file system information.
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
proc            /proc          proc    defaults        0      0
# /dev/sda2
UUID=e8e3a797-252e-4490-b39d-7f377bf2484c /              ext2    relatime,errors=remount-ro 0      1
# /dev/sda3
UUID=06f9c1e4-9870-444c-ba2e-4965f981e7ea none            swap    sw              0      0
/dev/scd0      /media/cdrom0  udf,iso9660 user,noauto,exec,utf8 0      0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0      0

================================== sde2/boot: ==================================

total 53988
drwxr-xr-x  3 root root    4096 2008-12-22 21:50 .
drwxr-xr-x 21 root root    4096 2008-12-14 20:16 ..
-rw-r--r--  1 root root  422607 2008-04-10 17:51 abi-2.6.24-16-generic
-rw-r--r--  1 root root  422838 2008-10-22 04:12 abi-2.6.24-21-generic
-rw-r--r--  1 root root  422838 2008-11-24 22:47 abi-2.6.24-22-generic
-rw-r--r--  1 root root  79964 2008-04-10 17:51 config-2.6.24-16-generic
-rw-r--r--  1 root root  80062 2008-10-22 04:12 config-2.6.24-21-generic
-rw-r--r--  1 root root  80062 2008-11-24 22:47 config-2.6.24-22-generic
drwxr-xr-x  2 root root    4096 2008-12-14 20:16 grub
-rw-r--r--  1 root root 7833064 2008-10-28 12:55 initrd.img-2.6.24-16-generic
-rw-r--r--  1 root root 7350068 2008-04-22 23:01 initrd.img-2.6.24-16-generic.bak
-rw-r--r--  1 root root 7462082 2008-12-14 20:16 initrd.img-2.6.24-21-generic
-rw-r--r--  1 root root 7464483 2008-10-29 21:38 initrd.img-2.6.24-21-generic.bak
-rw-r--r--  1 root root 7462535 2008-12-22 21:50 initrd.img-2.6.24-22-generic
-rw-r--r--  1 root root 7461712 2008-12-14 20:17 initrd.img-2.6.24-22-generic.bak
-rw-r--r--  1 root root  103204 2007-09-28 11:06 memtest86+.bin
-rw-r--r--  1 root root  899892 2008-04-10 17:51
-rw-r--r--  1 root root  905617 2008-10-22 04:12
-rw-r--r--  1 root root  905617 2008-11-24 22:47
-rw-r--r--  1 root root 1904248 2008-04-10 17:51 vmlinuz-2.6.24-16-generic
-rw-r--r--  1 root root 1920760 2008-10-22 04:12 vmlinuz-2.6.24-21-generic
-rw-r--r--  1 root root 1921176 2008-11-24 22:47 vmlinuz-2.6.24-22-generic

=============================== sde2/boot/grub: ===============================

total 212
drwxr-xr-x 2 root root  4096 2008-12-14 20:16 .
drwxr-xr-x 3 root root  4096 2008-12-22 21:50 ..
-rw-r--r-- 1 root root    197 2008-10-28 12:55 default
-rw-r--r-- 1 root root    15 2008-10-28 12:55
-rw-r--r-- 1 root root  8056 2008-10-28 12:55 e2fs_stage1_5
-rw-r--r-- 1 root root  7904 2008-10-28 12:55 fat_stage1_5
-rw-r--r-- 1 root root    16 2008-10-28 12:55 installed-version
-rw-r--r-- 1 root root  8608 2008-10-28 12:55 jfs_stage1_5
-rw-r--r-- 1 root root  5446 2008-12-14 20:16 menu.lst
-rw-r--r-- 1 root root  5014 2008-12-14 20:16 menu.lst~
-rw-r--r-- 1 root root  7324 2008-10-28 12:55 minix_stage1_5
-rw-r--r-- 1 root root  9632 2008-10-28 12:55 reiserfs_stage1_5
-rw-r--r-- 1 root root    512 2008-10-28 12:55 stage1
-rw-r--r-- 1 root root 108356 2008-10-28 12:55 stage2
-rw-r--r-- 1 root root  9276 2008-10-28 12:55 xfs_stage1_5

=============================== StdErr Messages: ===============================

/dev/sda: No medium found

sfdisk: cannot open /dev/sda for reading
/dev/sdb: No medium found

sfdisk: cannot open /dev/sdb for reading
/dev/sdc: No medium found

sfdisk: cannot open /dev/sdc for reading
/dev/sdd: No medium found

sfdisk: cannot open /dev/sdd for reading

CJS 01-02-2009 06:19 PM

It looks like your problem is truly with Windows, because it appears your Grub is configured correctly to boot Windows. The script did find that one of the NTFS file system parameters in the Windows boot sector is ever-so-slightly off, so you could repair that with "testdisk", because it might make a difference. To use testdisk, first make sure the Ubuntu Universe repository is enabled in System > Admin > Software Sources, and then download and run testdisk with the following commands:

sudo apt-get install testdisk
sudo testdisk

After starting testdisk, choose "No log", choose the correct HDD and "Proceed", choose "Intel", choose "Advanced", select the Windows partition, choose "Boot", then choose "Rebuild BS"; if testdisk gives you a warning that the "Extrapolated boot sector and current boot sector are different", then choose "Write". After you are done doing the "Rebuild BS" in testdisk, reboot and let me know exactly what happens when you boot Windows XP from the Grub menu. We can work from there.

Slowbey 01-03-2009 11:14 AM

Thanks for your previous thoughts. I have run the testdisk programme and it gave the hard drive a clean bill of health.

After the XP screen and the moving blue bar appear, the screen switches to the famous blue screen, which says:


C0000021 Bad image checksum
Image shlwapi.dll is possibly corrupt. The header check sum does not match computed checksum.

Unfortunately none of the methods I know to capture the screen seem to be working, so this is the result of repeated re-boots.

The computer then takes me back to the grub menu screen.
Hope you can help with this one.

Best wishes

CJS 01-03-2009 11:40 AM

Do you have your Windows Install CD? If so, I would boot that, go to the "recovery console" and do:

chkdsk /r
And run the chkdsk command as many times as it takes until it reports no errors. Then try to boot Windows again, and if you have the same problems, I would boot your Windows Install CD, choose "Install Windows" from the main menu, and after that choose the option to do a "Windows Repair." I think that's your best bet short of reinstalling Windows at this point. Let me know how it goes.

Slowbey 01-05-2009 03:44 AM

Thanks for the very quick response.
I have tried what you suggested but the process is recording "unrecoverable errors" on the partition when I run chkdsk, giving me no further guidance and just going back to the C:> prompt.

I am currently trying to reinstall XP on that partition, as the repair route was unsuccessful. If this fails, I may have to go over to a "linux only" machine.
Best wishes

All times are GMT -5. The time now is 03:12 AM.