Skip to content

Instantly share code, notes, and snippets.

@hepto
Last active May 8, 2023 14:05
Show Gist options
  • Select an option

  • Save hepto/6bd7602eef2c8971da8e488e223a850c to your computer and use it in GitHub Desktop.

Select an option

Save hepto/6bd7602eef2c8971da8e488e223a850c to your computer and use it in GitHub Desktop.
Windows 10 Partition Creation
rem === https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/configure-uefigpt-based-hard-drive-partitions
rem === Run this from recovery / install prior to starting the install wizard to put the recovery partition at
rem === end of the drive, else the Windows installer will put it at the start and you won't be able to reclaim
rem === the space, if you choose.
rem === DiskPart /s F:\createpartitions.txt
select disk 0
clean
convert gpt
rem === create the EFI partition
create partition efi size=260
format quick fs=fat32
rem === create Microsoft reserved partition
create partition msr size=16
rem === create the main partition, but shrink by 500 for the recovery partition
create partition primary
shrink minimum=500
format quick fs=ntfs
rem === create the recovery partition
create partition primary
format quick fs=ntfs
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
gpt attributes=0x8000000000000001
rem === check all looks right!
list partitions
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment