Friday, November 13, 2009

Dual Boot USB stick with Windows 7 and Ubuntu 9.10 (Karmic Koala)

introduction

I setup on doing a dual boot (or hopefully dual boot + dual install) of Windows and Ubuntu on USB stick. This proved to be more challenging than I would expect, so I'll try to outline what my conclusions are and how to make dual boot stick.

Let's start with the basics, unlike Vista, Windows 7 optimizes driver installation when it boots, preventing it from booting from USB stick on different machine (or different type of the machine) than it was installed on. This yields a simple result that one probably does not want to install Windows 7 on USB drive, but only to have bootable install partition.

Ubuntu's option to make bootalbe USB drive asks for amount of persistent space that you can use to keep your data on USB drive, thereby really making USB drive a full install without a need to additional partition with "full install".

This leads us to needing only bootable Ubuntu and bootable Windows 7 install. While it may be possible to boot Ubuntu from windows bcd bootloader, I opted for opposite direction thus booting into Ubuntu boot screen that has an option to start Windows 7 installer.

My first few attempts to get syslinux (Ubuntu installer to boot Windows from same partitino were unsuccessful). My next few attempts to get windows to boot from second USB partition were as well unsuccessful and at the end I found this prescription that works.

the prescription
1. Boot into Ubuntu Live CD
2. Start GParted and create two primary partitions (first at least 2.5Gb, and second at least 1.1Gb)
3. Format both partitions as FAT32
4. Boot into Windows
5. Note drive letter of your USB drive's first partiton (example Q:)
6. Go to Windows 7 installer DVD (or folder where you extracted ISO using 7-zip)
7. Go to boot folder and from command line (with Administrative privilegies) run:
bootsect /nt60 Q: /mbr
8. Extract Windows 7 DVD files to your USB drive (example Q: drive)
9. Boot back into Ubuntu
10. Make bootable usb drive (option from Administration menu)
11. Get chain.c32 from syslinux and copy to /isolinux folder
12. Get ldlinux.sys from syslinux and copy to / folder [this may be optional step]
13. Edit text.cfg and add at the end:
MENU LABEL Windows 7
COM32 /syslinux/chain.c32
APPEND hd0 1 ntldr=/BOOTMGR
14. Dual boot your Windows 7 Installation

Happy dual booting...

6 comments:

  1. 7: Go to boot folder
    I cant seem to find a folder "boot"

    ReplyDelete
  2. boots up fine but and I get the menu, but I get "disk error" when I try and run the windows side.

    ReplyDelete
    Replies
    1. I am not sure if Ubuntu by now changed boot loader. I think it did... And this was working w/ w7 I think w8 may be a bit different.

      Delete
  3. What an useful tips with dual boot procedures, I have heard some information about it, but now this have increase my knowledge about these kind of installations.

    ReplyDelete