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.
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
APPEND hd0 1 ntldr=/BOOTMGR
14. Dual boot your Windows 7 Installation
Happy dual booting...
Friday, November 13, 2009