Configuring a Hard Disk with Diskpart and Windows PE (Windows Embedded Standard 2009)

4/23/2012

To configure your target device's hard disk for deployment, you can use the Diskpart command prompt utility, which manages your hard disks. It is used to add, edit, or remove partitions on your hard disk.

Note

You should back up any data on the disk before you use Diskpart because the utility reconfigures hard disk partitions

Diskpart can be used to configure a device that does not have an operating system (OS), and is included with the Windows Pre-Installation Environment (Windows PE). After booting Windows PE, you can configure the hard disks on your system. For more information, see Windows Preinstallation Environment.

Note

Do not use Diskpart to configure a CompactFlash device. Because of the way Windows XP reports disk geometry on CompactFlash devices, repartitioning your CompactFlash device may display it inoperable. Contact your CompactFlash manufacturer if you need help repartitioning the device.

Diskpart is also available as a component (Disk Management Command Line Utility), which can be added to a run-time image. The Disk Management Command Line Utility requires the following additional components:

  • Disk Management Services
  • Disk Management Basic Volume Runtime
  • Disk Management Dynamic Volume Runtime

More information about how to use Diskpart is available at this Microsoft Web site.

Note

Windows PE is located on Windows Embedded Standard CD-ROM Disc 1, or a separate Windows PE disc, depending on whether you have the Full Price Product or the Upgrade Product.

To use Diskpart to configure a hard disk

  1. Start Windows PE or your run-time image on the device.

  2. At the command prompt, type diskpart. The Diskpart command prompt opens.

  3. Type ? to display the Diskpart help.

  4. Use the Diskpart commands to list the current configurations, select a disk, and edit a partition. For example, to create a 400 MB primary partition on the second disk in your system, use the following Diskpart commands:

    list disk
    select disk 1
    list partition
    create partition primary size=400
    
  5. After you configure the hard disk, stop the utility by typing exit.

  6. Restart the system.

  7. Format any newly created partitions with the format command.

    Note

    The Diskpart utility includes an override option, which can be used to delete a Microsoft Reserved (MSR) partition or other protected partition. Use extreme caution when you use the override option.

    You can also create a script for Diskpart with the commands needed to deploy mass systems. By booting Windows PE and bringing the device up on the network, you can run a Diskpart script with the following command:

    diskpart /s <script name>
    

For more information, see Connecting a Device to a Network with Windows PE.

See Also

Concepts

Windows Preinstallation Environment