Dual Boot Windows with Grub
Here’s the magic formula to boot into a Windows (slave) hard drive from Grub. Windows thinks that it’s installed on the master, but I’ve moved it over to the slave position. Sadly it refused to boot from there. The trick is to tell the BIOS to remap the drives, and thereby fool Windows into thinking it’s on the master.
I’ve been doing this for years with LILO, but now I’ve moved on to use Debian Sarge, and I’ve been forced to work out how to do it with Grub. It’s not too difficult. Here’s the section I had to add to my /boot/grub/menu.lst file:
title Windows
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
chainloader +1
Once you’ve made the change just update Grub with this (Debian-specific) command:
# update-grub
…and then reboot.
Robert said,
26 September, 2006 @ 14:22
Worked a treat! A real life saver, thanks!
Steve said,
27 October, 2006 @ 02:40
Thanks from California! Saved me with my sister-in-law’s system — she’s trying Ubuntu and not quite ready to leave Windows completely behind. I hope for others’ sake you keep this page up for a long time.
Leonardo said,
9 November, 2006 @ 21:45
Work great! Many thanks from Italy!
nick said,
16 November, 2006 @ 22:22
cheers man, so handy and succinctly explained - i now have a dual boot asterisk PBX & windows 2003 domain controller! bit silly i know…
ta again
Bas said,
20 November, 2006 @ 18:18
Worked a treat, thanks.
Hari said,
18 December, 2006 @ 13:12
Thanks, we have been benefited by your advice!
Nicholas said,
26 December, 2006 @ 20:54
This post may be old but it’s still very useful. Thank you! I was just about to give up until I found this on Google. It works. :)
Nate said,
22 January, 2007 @ 05:02
Outstanding. Standard GRUB syntax wouldn’t do it, but this did!
fiNAL.Y said,
22 January, 2007 @ 17:24
Great ! It worked well, thanks !
fabio said,
26 January, 2007 @ 22:36
It´s really a life saving information. Congratulations
Phil said,
8 March, 2007 @ 21:36
Thanks! This little fixed saved me hours of frustration!
Viktor said,
17 March, 2007 @ 08:09
Thanks! I had windows installed, then I installed a second harddrive with linux. This saved me from having to change the bootorder in bios, every time. Many Thanks!
Asad Zia said,
12 April, 2007 @ 10:39
I had Windows and Linux installed on two separate hard drives, with Linux as master. This trick worked fine for me.
Erich Blume said,
7 May, 2007 @ 20:03
Thanks so much, this was exactly it.
One thing though - I don’t use Debian but “update-grub” shouldn’t be necessary. The whole point of grub is that it can read from linux partitions and so you don’t need to re-image the MBR every time you make a change like you had to with LILO.
Try it without the update-grub part some time and see if it works.
Min said,
13 May, 2007 @ 12:56
Thanks very much! Works without a problem n.n
T-boz said,
30 May, 2007 @ 19:44
THANKS from denmark. Works like a charm :)
John Turner said,
25 July, 2007 @ 15:27
Thanks a lot from over here too.
Nick Humfrey said,
24 September, 2007 @ 19:21
Also exactly what I was looking for. Excellent, thanks!
Hunac said,
1 October, 2007 @ 20:58
Thanks! Works fine.
Greg said,
8 November, 2007 @ 15:58
I have linux on my pc now. If I repartition the drive with Partition Magic, can I have linux on one partition and Windows on the other? What would I need to change with grub?
Thanks!