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.

Comment · Comments Feed · TrackBack

  1. Robert said,

    26 September, 2006 @ 14:22

    Worked a treat! A real life saver, thanks!

  2. 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.

  3. Leonardo said,

    9 November, 2006 @ 21:45

    Work great! Many thanks from Italy!

  4. 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

  5. Bas said,

    20 November, 2006 @ 18:18

    Worked a treat, thanks.

  6. Hari said,

    18 December, 2006 @ 13:12

    Thanks, we have been benefited by your advice!

  7. 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. :)

  8. Nate said,

    22 January, 2007 @ 05:02

    Outstanding. Standard GRUB syntax wouldn’t do it, but this did!

  9. fiNAL.Y said,

    22 January, 2007 @ 17:24

    Great ! It worked well, thanks !

  10. fabio said,

    26 January, 2007 @ 22:36

    It´s really a life saving information. Congratulations

  11. Phil said,

    8 March, 2007 @ 21:36

    Thanks! This little fixed saved me hours of frustration!

  12. 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!

  13. 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.

  14. 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.

  15. Min said,

    13 May, 2007 @ 12:56

    Thanks very much! Works without a problem n.n

  16. T-boz said,

    30 May, 2007 @ 19:44

    THANKS from denmark. Works like a charm :)

  17. John Turner said,

    25 July, 2007 @ 15:27

    Thanks a lot from over here too.

  18. Nick Humfrey said,

    24 September, 2007 @ 19:21

    Also exactly what I was looking for. Excellent, thanks!

  19. Hunac said,

    1 October, 2007 @ 20:58

    Thanks! Works fine.

  20. 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?


  21. Shaun said,

    30 September, 2008 @ 02:01

    Great :) thanks for that worked perfectly.

  22. Steve said,

    1 October, 2008 @ 17:34

    I used this and it worked fine. After using it for about a year, I deleted a great deal of data from the Windows drive. After this I defragmented my hard drive. All of this was done by just booting to Windows at the grub menu. It now says it will not mount the windows drive when rebooting and gives instructions to Ctrl+Alt+Dlt. Any idea what I have done and how to fix it?

  23. Ben said,

    2 March, 2009 @ 12:57


    Try removing the map lines.

    I used to get the CTL-ALT-DEL message until this post saved me. Maybe reversing the process will save you.

  24. Manish K Gupta from India said,

    11 March, 2009 @ 17:16

    Thanks Man,

    You saved my life. Its just brilliant. I was searching the forums on grub and it did not work, but this small change played the trick,

    A hundred thanks to you again….

  25. spooker said,

    4 April, 2009 @ 23:03

    thank you!! thank you!! thank you!! thank you!! thank you!! from romania

  26. Jeff said,

    12 May, 2009 @ 19:03

    Here is another URL that goes into more detail about dual-boot windows and linux, using two hard drives.


  27. Steve said,

    22 August, 2009 @ 21:38

    I forgot about this trick and spent a lot of time chasing my own tail. This was a big help, thanks.

  28. Tim said,

    24 September, 2009 @ 18:10

    This is it

    Works like a charm

    Thanks so much

  29. Ben Roberts said,

    30 November, 2009 @ 20:29

    Thanks for your excellent post – this is exactly what I was looking for :)

Leave a Comment