Saturday, January 10, 2009

How to Make Bootable USB Flash Disk Drive to Install Windows 7 / Windows Vista / Windows Server 2008

This article describes how to prepare a USB flash disk to install Microsoft Windows 7 / Windows Server 2008 R2 / Windows Vista / Windows Server 2008 Operating System from the USB flash drive. Not only is this method convenient—carrying a flash drive is preferred to a DVD—it is much, much faster than installing from a DVD.

Microsoft Windows 7 is currently in beta and Microsoft is offering it for free to anyone to try out until August. If you installed Microsoft Windows Vista from a DVD, you know that it was very time consuming. Why not speed up the process by means of using a USB flash drive to install Windows 7? Also as netbook sales fever keeps rising above, where most of the smaller ones lack an optical drive, and on occasions when utilizing an external DVD drive is out of the question, if you have a Windows 7 ISO image, then it’s possible to install via USB; if you have a Windows 7 installation DVD on another computer equipped with an optical drive, this guide will work as well.

How to Use Microsoft Windows 7 USB/DVD Download Tool to Create Bootable DVD or USB Media [Updated October 26, 2009]

Windows 7 USB/DVD Download Tool creates and makes bootable DVD or USB flash/HDD from an ISO image. Microsoft provided Windows 7 USB/DVD Download Tool for download here.

... and if interested, that’s how the traditional workaround works:
Prerequisites

In order to use a USB flash drive or a USB portable hard disk drive to install Windows 7 or Windows Vista:

  1. The destination or target computer motherboard must support boot up via USB device. This support can be checked inside BIOS. Some also need a tweak to enable legacy USB support. (USB BIOS Legacy Support / Legacy USB Storage)
  2. A 4 GB (or bigger) USB flash memory. Portable external hard disks should also contain at least 3.5 GB of free storage space, because Windows 7 / Windows Server 2008 R2 installation images require about 3 GB of disk space. So USB flash disks of 4 GB, 8 GB, 16 GB, or more are usable.
  3. Microsoft Windows Operating System Installation Disk, as a DVD or ISO image
  4. Existing computer running Windows 7 or Windows Vista
Partitioning and Formatting the USB Flash Disk Drive

Next we want to prepare our flash drive. The Windows 7 Beta ISO image is a little less than 2.5 GB, so you are going to need a flash drive at least 4 GB in size. Be warned this will erase everything on your drive, so be careful.

Plug in your USB flash drive to USB port and move all the contents from USB drive to a safe location on your system. Make sure there’s nothing indispensable on the disk, because further it’s going to be repartitioned and formatted (cleaned). Now to keep the Windows 7 Setup happy, there should be a single primary active partition on the USB flash disk drive, formatted in NTFS file system. Format the USB hard disk or flash drive in NTFS file system format with Windows Explorer built-in Format utility, and then use Disk Management (diskmgmt.msc) to mark the partition as active. It’s also possible to use DISKPART command-line utility with the following steps:

Partitioning and Formatting the USB Flash Disk Drive Using DISKPART Utility

Open Command Prompt with administrator’s privileges using EITHER of the two methods described below:

  • Beginner: Right click on Start > All Programs > Accessories > Command Prompt and select “Run as administrator.”
  • Pro: Type cmd in the Start Menu search box and hit Ctrl + Shift + Enter.

Now with extreme care, type in the commands described below in the Command Prompt.

Run Microsoft DiskPart utility using the following command:

diskpart

Now to identify the number (Disk #) of the USB device disk drive, execute the following command:

list disk

Note down the disk number (e.g., Disk 2) of your USB flash drive. Next, type all the below commands one by one and press Enter. Here and in the screenshot I assume that my USB flash disk drive number is Disk 2. If you have say Disk 1 as your USB flash drive, then use Disk 1. Among the commands, the format process might take few moments.

select disk 2

clean

create partition primary

select partition 1

active

format fs=ntfs quick

assign

exit

Please note if there was an error while creating the primary partition, just add size=4000 (representing 4.0 GB, replacing your USB flash drive’s actual size) to the end of the create partition primary command, making it create partition primary size=4000.

DiskPart Commands Sample

Making the USB Flash Drive or External Hard Disk Bootable

To make the USB flash memory or the external USB HDD bootable, we’re going to use Microsoft Boot Sector Restoration Tool that comes as bootsect.exe utility locatable inside the boot folder of the Microsoft Windows Operating System Installation Disk. bootsect.exe updates the master boot code for hard disk partitions in order to switch between BOOTMGR and NTLDR.

Put the Windows 7 installation DVD into the optical drive, or if it’s in ISO image format, mount it using Daemon Tools (or similar virtual CD/DVD/BD-ROM drive powered with a virtual drive program) or feeblemindedly burn it to a DVD! Note down both your optical disk drive letter and your USB flash drive letter / external USB disk drive letter. Here and in the screenshots I assume that my optical disk drive letter and USB flash drive letter are d: and e: respectively.

Open Command Prompt as Administrator (or use the one remained open from the last step) and type in the following commands:

cd /d d:\boot

bootsect /nt60 e:

Bootcode was successfully updated on all targeted volumes.Target volumes will be updated with BOOTMGR compatible bootcode.

E: (\\?\Volume{c7ba47b0-fb1e-11df-a287-000a019990c4})

Successfully updated NTFS filesystem bootcode.

Bootcode was successfully updated on all targeted volumes.

Please note you can’t run the bootsect.exe from a 64-bit’s Windows image on a running 32-bit system and will be given the following error if attempted:

BootSect Compatibility ErrorThis version of D:\boot\bootsect.exe is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need a x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher.

The opposite is doable; you actually can run the bootsect.exe from an x86’s Windows image on a running x64 system, that’s because the 64-bit command processor can run both 32- and 64-bit codes.

Solution [Updated November 10, 2009]

It doesn’t matter whether your flash memory is made bootable using the bootsect.exe from either a 32-bit or a 64-bit Windows image. In other words, once the master boot code is set for a flash memory, it’s been made bootable for both 32-bit and 64-bit Windows images. For example, if you have a running 32-bit Windows 7, but you want to make a bootable Windows Server 2008 R2 x64 USB flash disk, first make the flash disk bootable using the bootsect.exe from a Windows 7 x86 ISO image / bootable DVD, then copy the content of the 64-bit Windows Server 2008 R2 to the flash memory.

Copying Windows Installation Setup Files and Folders to the USB Flash Memory

Use Windows Explorer to transfer all content from Windows 7 or Windows Vista DVD or ISO image to the USB flash drive or external USB hard disk drive. It’s also possible to use other file copy tool, or simply extract the ISO image contents to the USB drive. To get rid of problems such as the annoying Desktop.ini being unintentionally selected, you can alternatively use the following command inside CMD, where the source drive is d: and the destination drive is e: in the example:

xcopy d:\*.* e:\ /e /h /r /y

2 comments:

  1. Can't believe there are not other comments.. I have always wondered how to do this and stumbled upon it looking on how to mode NVidia Driver files. Thanks for you insight and for my next clean install I will give it a shot, and see how it goes.

    Either way way, thanks for all the great info and the the tips and tricks along the way to make it easier.. Wow, it came close on space with the 4 gig PNY Attache USB stick though because I installed an AIO (All In One) copy that has both x86 and 64X install capability from the ISO I had...

    So, I ended up having 225 Meg left.. LOL. Almost like it was meant to be :-) I will post back and let you know how it all worked out after my next install, and again! Thank you kindly for your time and effort, applied to you expanded knowledge base!

    ReplyDelete
  2. Thanks a lot for posting the solution regarding creating 64 bit bootable from a 32 bit USB.
    Thought I was screwed there for a minute.

    ReplyDelete




Copyright © 1999-2014 Komeil Bahmanpour. All rights reserved.

Reproduction is permitted provided that the source is acknowledged and a link is included to the relevant page.