Thursday 29 November 2007

Windows Vista - Using the DiskPart Command to Create a Bootable USB Flash Drive

One of the neat additions to the DiskPart command in Windows Vista is the ability to work directly with USB flash drives.

Plug a flash drive into an XP box, run diskpart from the command prompt and:
  • list disk [Enter]
One will not see the flash drive listed. On Windows Vista though, we do see it listed and can work with it.

Because of that, we now have a method of creating a bootable USB Flash drive with very little grief for our WinPE environment.

The previous method still could still be used: System Builder Tip: Creating a Bootable USB Drive (previous blog post).

Here is the process:
  • On a Vista system plug in the USB flash drive to an available USB port (ReadyBoost compatible is best)
  • Start-->diskpart [Enter] (UAC Prompt)
  • list disk (USB flash drive will show in the list - Disk 1 for this example)
  • sel disk 1
  • clean
  • create par primary
  • sel par 1
  • act
  • format fs=fat32 quick (note that USB HDDs will need to be NTFS)
  • assign
  • exit
A screenshot of the process:


Setup of 2GB Flash Drive for WinPE Boot
We now have an active partition formatted with the FAT32 files system on the USB Flash drive.

From there we can copy the DOS system files onto it for the minimal memory setup required by a BIOS update, or we can copy the WinPE boot files and WinPE boot image onto it to boot to WinPE.

Things just got a little simpler. :)

UPDATE 2010-02-04: Added the "Assign" and "Quick" to the above steps. One to get the drive letter and the other to avoid a long wait for the format.

Philip Elder
MPECS Inc.
Microsoft Small Business Specialists

*All Mac on SBS posts are posted on our in-house iMac via the Safari Web browser.

4 comments:

Anonymous said...

Instead of create par primary,
you could use cre par pri!
It's shorter and sounds better too.

Michael Sync said...

Where can we get those DOS file? Is there any DOS file in Vista? Thanks in advance.

Philip Elder Cluster MVP said...

Michael,

We have lots of DOS disks around. TechNet also has versions for download.

If you have a floppy, I think you can still format with system using the right click menu on an inserted floppy in XP.

Philip

Anonymous said...

I keep seeing these instructions on how to use Diskpart to format the USB stick but I'm confused on one part. During which step does the Master Boot Record and the Boot Sector get written to the stick ? I don't see how it could boot without them. These same instructions are given for making a Win 7 USB stick installation drive but again I don't see how without an MBR or Boot Sector the Win 7 installation will start. One person said to use the Bootsect.exe program in the boot folder of a Vista or Win 7 DVD to write the Boot Sector but no one else including you includes that step. Also, why does it have to be FAT32. Why not use NTFS ?