Sunday, November 14, 2010

Booting [Windows] on another drive from [Grub 2]

I faced tremendous problems getting Windows to boot. Almost all tips from the net referred to the second code snippet below which landed me in a BSoD. However I have finally found a way to make this works. Put the following in /etc/grub.d/40_custom
menuentry "Windows 7" {
 set root=(hd1)
 chainloader +1
}
If the above code doesn't work, then use
menuentry "Windows 7" {
 drivemap (hd1) (hd0)
 drivemap (hd0) (hd1)
 set root=(hd1)
 chainloader +1
}
Of course, replace the drive numbers respectively. (hd0) being the first hard disk and (hd1) being the second, ... and so on. How this works is that, if the OS(to be booted from Grub 2) recognizes booting from a second disk/changed hard disk, then use the first code snippet. The second code snippet is used for OSes which can't boot from the second disk, and the drivemap command actually maps hd0 to hd1(actually you can try with this line only) and cheats the OS into thinking that it is booting from the first hard disk instead. Something like that. However somehow you can't "cheat" Windows 7 so... it BSoDs. So probably the second code snippet is for Windows XP which is somehow stupider(I think?). I never have to booting Windows XP this way so, I don't really know.

No comments:

Post a Comment