This documentation is archived and is not being maintained.

Sample: Configure More than Four Partitions on a BIOS/MBR-Based Hard Disk by using Windows PE and DiskPart

Updated: October 20, 2013

Applies To: Windows 8, Windows 8.1, Windows Server 2012, Windows Server 2012 R2

This topic shows how to configure disk partitions for a BIOS-Based computer, with more than four partitions, as described in the topic: Configure More than Four Partitions on a BIOS/MBR-Based Hard Disk.

This sample configuration includes three primary partitions and an extended partition. The primary partitions include two utility partitions and a system partition. The extended partition includes two logical partitions. These include the Windows partition and a recovery image partition. The following diagram shows this configuration:

Diagram of partitions: 3 Primary, 1 Extended

For image-based deployment, boot the computer by using Windows PE, and then use the DiskPart tool to create the partition structures on your destination computers. For more information, see Apply Images Using DISM.

Windows PE reassigns disk letters alphabetically, beginning with the letter "C", without regard to the configuration in Windows Setup. This configuration can change based on the presence of different drives, including USB flash drives.

In these DiskPart examples, the partitions are assigned the letters "U", "V", "S", "W", and "R" to avoid drive-letter conflicts. After the computer reboots, Windows PE automatically assigns the letter "C" to the Windows partition. The Utility1, Utility2, system, and recovery image partitions do not receive drive letters.

The following steps describe how to partition your hard drives and prepare to apply images. You can use the code in the sections that follow to complete these steps.

  1. Save the code in the following sections as a text file (PrepareMyPartitions.txt) on a USB flash drive.

  2. Use Windows PE to boot the destination computer.

  3. Use the DiskPart /s F:\PrepareMyPartitions.txt command, where F: is the letter of the USB flash drive, to partition the drives.

Save the following code as "PrepareMyPartitions.txt", and then run the script by using the DiskPart tool to automate the configuration of the Utility1, Utility2, system, extended, Windows, and recovery image partitions:

select disk 0
create partition primary size=100
format quick fs=ntfs label="Utility1"
assign letter="U"
set id=27
create partition primary size=200
format quick fs=ntfs label="Utility2"
assign letter="V"
set id=27
create partition primary size=100
format quick fs=ntfs label="System"
assign letter="S"
create partition extended
create partition logical size=75000
format quick fs=ntfs label="Windows"
assign letter="W"
create partition logical
format quick fs=ntfs label="Recovery image"
assign letter="R"
set id=27

After you create the partitions, you can use a deployment script to apply the Windows images on the newly created partitions. For more information, see Samples: Applying Windows, System, and Recovery Partitions by using a Deployment Script.

See Also