Sunday, 5 September 2010

Adding Windows Vista to make Ubuntu dual boot with two, separate hard drives

If making a dual-boot Windows/Ubuntu system, most of the advice is to install Windows first. However, I already have a nice shiny Ubuntu set-up and wanted to add Windows (Vista). If you can install Ubuntu and Windows on two separate hard drives then it's a breeze. Here's what I did:
  • Install an extra hard drive for Windows and temporarily disconnect the Ubuntu drive
  • Install Windows to the new hard drive using an install CD/DVD (or however)
  • Reconnect the Ubuntu hard drive (and ensure it's the 1st hard drive in the BIOS boot list)
  • Boot to Ubuntu. Run the following
    sudo grub-mkconfig --output=/boot/grub/grub.cfg
    This will detect the Windows drive and add a grub entry. Note this applies to grub2 (i.e. the new grub and not legacy-grub) as used by Ubuntu Lucid Lynx (10.06) and later.
That's it. Reboot and you should see boot item entries for Windows and Ubuntu.

You might find that your grub boot menu is a bit cluttered with old rubbish. See the following post on how to tidy that up.