grub to boot windows

Hello,

I am using debian-5.0.0(lenny) . I installed windows xp(a hacked version) on a usb stick. this stick works perfectly well and boots off a windows system successfully.
but on linux it is finding problems to do so.

So I finally decided to put a grub entry to boot off the usb HDD.

So here are the short details . Please have a look.

My menu.lst

title           Debian GNU/Linux, kernel 2.6.26-2-686
root            (hd0,0)
kernel          /vmlinuz-2.6.26-2-686 root=/dev/sda3 ro
initrd          /initrd.img-2.6.26-2-686

title           Debian GNU/Linux, kernel 2.6.26-2-686 (single-user mode)
root            (hd0,0)
kernel          /vmlinuz-2.6.26-2-686 root=/dev/sda3 ro single
initrd          /initrd.img-2.6.26-2-686

title           Xen 3.2-1-i386 /Debian GNU/Linux, kernel 2.6.26-2-xen-i386
root            (hd0,0)
kernel          /xen-3.2-1-i386.gz
module          /vmlinuz-2.6.26-2-xen-686 root=/dev/sda3
module          /initrd.img-2.6.26-2-xen-686

title           WINDOWS XP
rootnoverify    (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
chainloader     +1

My device.map file is this

cat /boot/grub/device.map 
(hd0)    /dev/sda
(hd1)    /dev/sdb

and finally the output of fdisk -l is as follows

localhost:/home/gaurav# fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf8000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          16      128488+  83  Linux
/dev/sda2   *          17         502     3903795   82  Linux swap / Solaris
/dev/sda3             503       19457   152256037+  83  Linux

Disk /dev/sdb: 320.0 GB, 320072933376 bytes
64 heads, 32 sectors/track, 305245 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Disk identifier: 0x000c6cde

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       52000    53247984    7  HPFS/NTFS
/dev/sdb2           52001      305244   259321856    f  W95 Ext'd (LBA)
/dev/sdb5           52001      305244   259321840    7  HPFS/NTFS
localhost:/home/gaurav# 

well so after choosing Windows XP at the grub menu, it prints this to the console

Booting           WINDOWS XP
rootnoverify    (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
chainloader     +1

and then halts . apparently not responding at all.

the same usb hdd boots successfully off a windows system but its facing some problem off this.
My bios perfectly supports usb boot as I have installed debian over the usb through netinstall-iso image and unetbootin.

I am using dell-1520 notebook.

If anyone faced a similar situation, Please let me know.

Thanks,
Regards,

Gaurav.

I'd do the (re-)mapping first:

map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
makeactive
chainloader +1
boot

Hello ,

Thnx . Let me try that.

Regards,
Gaurav.

---------- Post updated at 03:52 PM ---------- Previous update was at 03:30 PM ----------

Hello,

I tried that, but I am at the same position.

but I feel too that it wont cause any difference because if you enter the grub shell ( by typing grub ) and you enter the directives one my one like root (hdx,y) , map (hda,b) (hdc,d), chainloader +1 etc etc and then boot. So it takes in all the commands at once and resolves them before booting them. Kind of Two-Pass Assembler.

Thanks again.
I will keep on trying.

Regards,
gaurav.

One further thing to check: when booting, enter the GRUB shell from the menu (by pressing 'e'), and try to verify that the system can see the USB disk. Because a BIOS being able to boot off an USB drive doesn't mean that the bootloader can see it too, or even at the same location as the booted system.

Hi Pludi,

the

cat /boot/grub/device.map 
(hd0)    /dev/sda
(hd1)    /dev/sdb

shows that grub idenfies sdb as hd1 by its own notation.

Regards,
Gaurav.

I don't mean the device map, as that is generated with a running system, mapping the devices by whatever way Linux maps them. If you generate it another time, with another external disc connected, it might well be that your Windows disc is suddenly /dev/sdc or hd2. So the interesting part would be what GRUB itself sees it as.

Background: I've had a SATA disc identified as /dev/sda or hd0 with Linux running, but couldn't boot from it as GRUB saw it after an IDE disk at hd1. So none of the entries matched anymore.

Hi pludi,

This sounds complicated. If thts true, then its probably impossible to figure out what grub sees sdb as. But I feel the most obvious is that the first external disk is detected as sdb and grub sees it most likely as (hd1) afaik. The rest follows as sdc sdd.and so on.

"Background: I've had a SATA disc identified as /dev/sda or hd0 with Linux running, but couldn't boot from it as GRUB saw it after an IDE disk at hd1. So none of the entries matched anymore.
Reply With Quote"

what was /dev/sda mapped to in device.map ? was it hd0 and still grub saw it as hd1?

Kind Regards,
Gaurav.

On second thought, this makes me wonder why you are trying to (re-)map at all?

Anyway, the Super Grub Disk helped me solving a similar "disk puzzle" (some time ago, though) ...

No. From within Linux, the device map was generated as /dev/sda = hd0 and /dev/hda = hd1. However, from the BIOS and the GRUB boot menu, /dev/hda was hd0, and /dev/sda was hd1. An additional problem was that I told GRUB to install into the MBR of the first disk (at that time /dev/sda), and on the next boot I was presented with an "OS not found" error.