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.

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 Hard Disk (UEFI)
Follow these commands in sequential order to clean the hard disk and configure UEFI partitions.
| DiskPart Command | Description |
|---|---|
| Diskpart | Launches the disk partition utility |
| Select Disk 0 | Selects Disk 0, the only disk in the machine |
| Clean | Erases all partition data from the disk, rendering it non-functional. |
| Convert gpt | Converts the selected disk to GPT format |
| Create partition efi size=200 | Creates a EFI system partition of 200 MB |
| Assign letter=s | Assigns the newly created EFI partition as S: |
| Format quick fs=FAT32 | Formats the EFI partition as FAT32 |
| Create partition msr size=128 | Creates a MSR system partition of 128 MB |
| Create Partition Primary | Creates a primary partition on Disk 0 |
| Select Partition 3 | Select the last created partition |
| Active | Marks the newly created partition as Active |
| Assign letter=c | Sets the new partition as C: |
| Format quick fs=NTFS | Formats the new primary partition as NTFS |
| Exit | Quits 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 Command | Description |
|---|---|
| Diskpart | Launches the disk partition utility |
| Select Disk 0 | Selects Disk 0, the only disk in the machine |
| Clean | Erases all partition data from the disk, rendering it non-functional. |
| Create Partition Primary | Creates a primary partition on Disk 0 |
| Select Partition 1 | Select the newly created partition |
| Active | Marks the newly created partition as Active |
| Assign letter=c | Sets the new partition as C: |
| Format quick fs=NTFS | Formats the new primary partition as NTFS |
| Exit | Quits Disk Utility |



