DiskPart Commands for SCCM OSD

Using DiskPart Commands for SCCM OSD

Last Updated

November 17, 2025

Posted In

In this basic guide, I will show you how to use diskpart commands for SCCM OSD. In Operating System Deployment (OSD), DiskPart commands are often used to configure disk partitions during the deployment process.

DiskPart is a command-line utility using which you can create, delete, and manage disk partitions. Occasionally, during operating system deployment, you may need to utilize diskpart commands to manually clean or format the hard drive.

One such example where diskpart commands come to the rescue is when your task sequence fails with error code 0x800700A1.  If the hard disk is unformatted or you have an MBR formatted disk on a machine that has been reconfigured to UEFI, the task sequence fails because it has nowhere to save the content to.

Install and Update Third Party Applications with Patch My PC
Install and Update Third Party Applications with Patch My PC

Note that using diskpart commands is not always necessary, however it can definitely help if you’re having problems with OSD. Consider reviewing the smsts.log file during task sequence failures, as it can provide valuable insights into the reasons behind your OSD failures.

How to use DiskPart commands during OSD

To use diskpart during OS deployment (OSD), first you must boot into the OSD environment. Ensure you have enabled the command support for your boot image. Open a command prompt by pressing the F8 key.

Use commands such as “list disk,” “select disk,” “clean,” “create partition primary,” “format,” and “assign letter” to prepare the target drive for the operating system installation.

DiskPart Commands for SCCM OSD
DiskPart Commands for SCCM OSD

DiskPart Commands for Hard Disk (UEFI)

Follow these commands in sequential order to clean the hard disk and configure UEFI partitions.

DiskPart CommandDescription
DiskpartLaunches the disk partition utility
Select Disk 0Selects Disk 0, the only disk in the machine
CleanErases all partition data from the disk, rendering it non-functional.
Convert gptConverts the selected disk to GPT format
Create partition efi size=200Creates a EFI system partition of 200 MB
Assign letter=sAssigns the newly created EFI partition as S:
Format quick fs=FAT32Formats the EFI partition as FAT32
Create partition msr size=128Creates a MSR system partition of 128 MB
Create Partition PrimaryCreates a primary partition on Disk 0
Select Partition 3Select the last created partition
ActiveMarks the newly created partition as Active
Assign letter=cSets the new partition as C:
Format quick fs=NTFSFormats the new primary partition as NTFS
ExitQuits Disk Utility

DiskPart Commands for SCCM OSD (Legacy)

Follow these commands in sequential order to clean the hard disk and set up Legacy partitions on it.

DiskPart CommandDescription
DiskpartLaunches the disk partition utility
Select Disk 0Selects Disk 0, the only disk in the machine
CleanErases all partition data from the disk, rendering it non-functional.
Create Partition PrimaryCreates a primary partition on Disk 0
Select Partition 1Select the newly created partition
ActiveMarks the newly created partition as Active
Assign letter=cSets the new partition as C:
Format quick fs=NTFSFormats the new primary partition as NTFS
ExitQuits Disk Utility

Leave a Reply

Your email address will not be published. Required fields are marked *

Prajwal Desai

Prajwal Desai is a highly accomplished technology expert and an 11-time Dual Microsoft MVP (Most Valuable Professional), specializing in Microsoft Intune, SCCM, Windows 365, Enterprise Mobility, and Windows. As a renowned author, speaker, and community leader, he is widely recognized for sharing his in-depth expertise and insights through his blog, YouTube channel, conferences, webinars, and other platforms.