Walkthrough 2 - Part 1 (DiskPart)

Use Microsoft DiskPart to prepare the external drive. A quick note on DiskPart -

The following is a walkthrough of the steps required for creating a bootable external USB disk using DiskPart. The actions include wiping the disk before creating and formatting two new partitions - as this could potentially result in data loss, ensure that the correct disk is selected. DiskPart works by targeting an object (either a disk, volume or partition) - making it have "focus".

Proposed disk/partition structure -

Partition Size (GiB) Usage
1 1 Boot files and WinPE
2 - Windows To Go vhd file(s) and data/shared storage.

Recommendation - Remove all external disks except the one you plan to use - this should make disk selection easier.

 list disk  - use this command to list all available disks.

 select disk #  - select the disk from the list using the syntax select disk # (e.g. select disk 1). Size or other attributes should help to identify it.

 detail disk  - use this command to check that you have selected the correct disk. You can see from the output below that the disk Type: is USB, indicating that it's an external disk connected via the USB interface (the internal disk is likely to be Type: SATA).

 clean  - run this command when you are confident that you have selected the correct disk. This command will write zeros to a small part of the disk, removing the partition table. Alternatively, run the command clean all to write zeros to the whole disk - securely erasing all data. Be aware that running the clean all command can take hours depending on the size of the disk and USB speed.

 convert mbr  - ensure that the disk type is MBR (Master Boot Record). Windows will boot from an MBR type disk on UEFI systems as long as there is a partition with EFI boot files. Filesystem support varies between systems and manufacturers. A FAT32 partition should be supported on all systems in order to meet the UEFI specifications.

 create partition primary size=1024  - create a partition with a size of 1024 MiB / 1 GiB (this should be large enough for the boot files and WinPE - adjust size as required).

 active  - mark the partition as active / bootable. This is not required if booting on UEFI firmware, but is required if booting on BIOS systems and UEFI in compatibility mode (CSM).

 format fs=fat32 label=SSD1 quick  - format using the FAT32 filesystem. This should make the disk compatible on systems with UEFI or BIOS firmware. Edit the label as required.

 assign letter=r  - mount the partition as drive/volume R:\.

 create partition primary  - create another partition. As the size is not specified, it will span the rest of the disk.

 format fs=ntfs label=SSD2 quick  - format using the NTFS filesystem. Edit the label as required.

 assign letter=s  - mount the partition as drive/volume S:\.

 list partition .


Diskpart can be scripted. The following is a script file to automate the commands listed above (replace "select disk #" with the correct disk number) -

Save as D:\walkthrough2.txt and then run the following command from an elevated command prompt (run as Administrator). Adjust path and filename as required -

Output from running the command DiskPart /S D:\walkthrough2.txt

Document date - 6th July 2022