This page contains a walkthrough of the steps required to create a bootable USB stick using the command-line DiskPart tool. Commands include wiping the disk before creating and formatting a new partition and making the partition active. As these commands could potentially result in data loss, ensure that the correct disk is selected. See here for more information about diskpart usage.
Windows 7\8\8.1\10 or Server 2008\2012\2016\2019 or WinPE 3.*\4\5.*\10.* DiskPart can be used to complete the steps below.
The drive will need to be manually selected. Use the command List disk to show all available disks -
Having identifed the correct disk as disk 1 by using the List disk command, lets select it by running the command select disk 1. WARNING - ensure that the correct disk is selected -
To double check the correct disk has been selected, use the command detail disk to display more detailed attributes -
Use the clean command to wipe the disk - a limited number of sectors will be erased, removing all partition information and effectively wiping the whole disk. Alternatively use the command clean all to write zeros to every sector on the disk, securely erasing it. WARNING - ensure you have selected the correct disk before running this command -
To create a primary partition using all available disk space, use the command create partition primary -
Use the active command to make the partition bootable -
To (quick) format the selected partition with a FAT32 file system, with a volume label GRUB4DOS, use command format fs=fat32 label=GRUB4DOS quick. Where fs= selects the file system to be used (options are fat32, ntfs), label= is the volume label to assign to the drive, and quick completes a quick format -
To mount the new partition (to assign a drive letter) as Drive X, use the command assign letter=x -
Document date - 29th June 2019