Use a USB Drive for installing Windows and Linux

In the “why is this so hard?” department, it took about twenty minutes to prepare a USB flash drive as a boot and install device for Ubuntu 10.4. Instructions for this are found on the current download page and the result is a USB flash drive that can be used either to run an “live” version of Ubuntu that doesn’t alter any of the contents of hosted machines hard drive, or to install Ubuntu to that hosted machine’s hard drive, either as a replacement of the existing operating system, or alongside an existing one in a dual-boot configuration.

Why would I want to do this? On older machines it is conceivable that you might not have a working CD-ROM (for Linux), or a DVD (required for Windows 7 installations). We have a version of our set-top box without a CD-ROM drive so that the only way you can install things is either using a USB drive to boot, or to require a workable operating system to be present before downloading and installing applications via the network. The alternative to that is to remove the drive itself and install it in another machine….copy the files needed and then reinstall the drive.

I used the Ubuntu USB to convert some old windows machines that we had taken out of service from Windows XP to Ubuntu. It was both quicker an easier to perform the installs from the USB drive rather than using a CD. Worked like a charm after I wiped the old Windows using Darrik’s Boot ‘N Nuke The one catch on Dell machines is to hit F12 when booting up. This gives you menu to choose which device you want to use to boot the machine, i.e. USB drive, CD-ROM, or the usual hard drive. These machines are the Dell Optiplex GX720 in a small desktop case… a little larger than the $30 computers that I tried and failed to get off eBay awhile ago. Of the five that I obtained four are working fine… and one seems to have a noisy fan, but otherwise seems fine as well. They came with 1 meg of RAM, 40 gig hard drives, 2.8Ghz processors, and they are snappy with Ubuntu 10.04

USB Install for Windows 7

Which brings us to performing the same office for Windows 7. I’ve spent parts of two days trying to make this work… to converting our set-top box from Ubuntu to Windows. The reason for this is that we’re looking to run the most fully developed version of Skype on this little machine, and Skype for Linux is officially still in beta, and behind in several ways from the Windows version.

One thing that needs to be made very clear from the outset is that Microsoft doesn’t appear to support the notion of a “Live-CD” type of USB installation, where, you would essentially carry around a bootable USB Flash drive with a licensed version of Windows 7 that you could then stick into an available machine and run separately from whatever the machine normally runs. Instead they expect that the USB drive will be used exactly the way a bootable DVD disk would be used; as an installation medium for Windows 7.

After searching and trying a couple of different tools (one open source, which appears to be from Russia and didn’t work, a Microsoft tool which also didn’t appear to work, and several step by step scripts which also didn’t work, I finally found a script which did work. Because of all the possible variables; it could indeed mean that I got something else wrong with the other methods. You need:

1. An installation DVD for Windows 7.
2. A USB drive of 4 Gigabytes or larger capacity
3. A working Windows machine to host the items above

1. Plug in the USB drive and note the drive letter. (call it E: for our purposes)

2. Put the DVD in the DVD drive and note the drive letter (we’ll call it D: for our purposes).

3. Go to Start -> RUN, type cmd and then hit CTRL-SHIFT-Enter. This brings up the dialog asking for the admin password, and will then create a command line with administrator privileges

4. Type diskpart

5. Type list disk This show a list of the disks starting with 0. The USB disk will typically be the highest number. In our case, we have:
0 = local machine’s hard drive
1 = DVD drive
2 = USB drive

6. Type the following command to partition and format the USB drive
select disk 2
clean
create partition primary
list partition
(you should probably only see a single partion, and it will be labeled 1)
select partition 1
active
format fs=NTFS
assign
exit

7. Assuming the Windows 7 DVD is in the drive, now you need to copy the boot sector information from the DVD to the USB.

d:
cd d:\boot
bootsect /nt60 e:

8. Close the command window
9. Now, using Windows Explorer, you can copy the contents of the DVD to the USB drive. I made all the usual mistakes, trying to simply drag and drop the DVD icon on to the USB drive icon. Instead, you have to open two windows, one showing the contents of the DVD. and one showing the USB. Note too, that the DVD needs to be the expanded version of the .iso file…. it doesn’t work to simply copy the .iso file to the USB drive.

Once this is all done the USB drive should boot the target machine. In my case there is a fairly sophisticated BIOS setting in the machine that gives a preference to any bootable device which is connected to the USB connector. So, during the Windows setup, once the files are all copied, and before the machine automatically reboots you need to remove the USB drive before allowing Windows setup to continue.

The final straw in this saga appears to be drivers; Windows 7 doesn’t have sound drivers for this particular motherboard. So, now, I’m off in search of those.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s