PDA

View Full Version : [ubuntu] Can't Get GRUB To Boot Windows XP On USB HDD



Dynamata
December 29th, 2010, 06:53 AM
I had Windows XP installed on my PC then bought a new HDD, installed Windows 7 & Ubuntu 10.10 in dual boot, later I added the Windows XP HDD as an external USB then typed "update-grub".

At boot up the drive appears at the bottom of the GRUB menu but when I select Windows XP it gets as far as the XP splash screen, after a few seconds there is a flash of blue screen with some writing on it then the PC re-boots. Here is grub.cfg:


#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
insmod vbe
insmod vga
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set 02909981-c8dc-4a86-ac53-8bce0c3fdd60
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set 02909981-c8dc-4a86-ac53-8bce0c3fdd60
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.35-23-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set 02909981-c8dc-4a86-ac53-8bce0c3fdd60
linux /boot/vmlinuz-2.6.35-23-generic root=UUID=02909981-c8dc-4a86-ac53-8bce0c3fdd60 ro quiet splash
initrd /boot/initrd.img-2.6.35-23-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-23-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set 02909981-c8dc-4a86-ac53-8bce0c3fdd60
echo 'Loading Linux 2.6.35-23-generic ...'
linux /boot/vmlinuz-2.6.35-23-generic root=UUID=02909981-c8dc-4a86-ac53-8bce0c3fdd60 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-23-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set 02909981-c8dc-4a86-ac53-8bce0c3fdd60
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=02909981-c8dc-4a86-ac53-8bce0c3fdd60 ro quiet splash
initrd /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set 02909981-c8dc-4a86-ac53-8bce0c3fdd60
echo 'Loading Linux 2.6.35-22-generic ...'
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=02909981-c8dc-4a86-ac53-8bce0c3fdd60 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-22-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set 02909981-c8dc-4a86-ac53-8bce0c3fdd60
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set 02909981-c8dc-4a86-ac53-8bce0c3fdd60
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 22e892d6e892a795
chainloader +1
}
menuentry "Microsoft Windows XP Professional (on /dev/sdb1)" {
insmod part_msdos
insmod ntfs
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set 34d079a7d079704a
drivemap -s (hd0) ${root}
chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
:?

mikewhatever
December 29th, 2010, 08:00 AM
I suspect Grub has nothing to do with this problem. Windows can't boot from usb by default, and though, reportedly, there is a way to make it.
http://www.ngine.de/article/id/8/

Dynamata
December 29th, 2010, 10:32 AM
Seems like the method in the link requires a fresh install of Windows, while my drive already has Windows installed. Would eSata work? I just want to export my bookmarks & tabs from various browsers on the on the old HDD without having to swap drives.

mikewhatever
December 29th, 2010, 12:21 PM
Really not sure, but trying it out wouldn't hurt. The point I was making (somewhat vaguely) is that Grub seems to redirect the boot process to the Windows bootloader as it is supposed to. If you could somehow trick Windows into thinking that it's not booting from usb, it might work.

ottosykora
December 29th, 2010, 01:25 PM
>Would eSata work?<

even less then usb, XP has no naive drivers for sata included

Mark Phelps
December 29th, 2010, 05:12 PM
Seems like the method in the link requires a fresh install of Windows...

What the link actually described is creating a custom installation package for Windows XP, NOT just installing to a USB-mounted drive using the regular Windows CD.

So, if you're willing to do all that work to create a custom installation package (and it is a LOT of work!), then it's likely to work on a drive connected via eSATA -- providing -- you can find and integrate the needed drivers into the new install package.

Dynamata
December 29th, 2010, 06:29 PM
Thanks, think I'll just swap the drives. :neutral:

Kirboosy
December 29th, 2010, 06:53 PM
Thanks, think I'll just swap the drives. :neutral:

You can always just mount the drive as an external in Ubuntu and pull all your data off. Bookmarks are stored in the User folder. :)

Dynamata
December 31st, 2010, 05:56 AM
I've got 6 browsers with bookmarks & hundreds of tabs to recover, I hate Windows Documents & Settings so searching for profiles is a chore. Swapping drives & exporting might be the easier option.