# Partitions

#### Let's face it, letting Windows Setup absolutely sucks at creating Partitions.  Let's take for example this Unallocated Space on a Drive and see what happens when Windows 10 1903 is installed with BIOS (MBR) and UEFI (GPT)

![](https://3420392058-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LpnxLqvh8u2fEz86kIM%2F-LqgeXR20Y-VkmoOFjzT%2F-LqgeklpGAK5KV9Z87MA%2Fimage.png?alt=media\&token=f9b31cf1-27c9-4f35-9d4d-57238f35823a)

## BIOS MBR Windows Setup Defaults

#### On the outside, this doesn't look too bad, just two partitions.  WinRE is in System Reserved

![](https://3420392058-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LpnxLqvh8u2fEz86kIM%2F-LqgeXR20Y-VkmoOFjzT%2F-LqgfSr9uJV5kNY8F6uv%2Fimage.png?alt=media\&token=d7baa3be-752f-481e-bf39-997072c68b7d)

#### But by Microsoft's own guidance, that's not how it should look ...

![](https://3420392058-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LpnxLqvh8u2fEz86kIM%2F-LqgeXR20Y-VkmoOFjzT%2F-LqggBxB8L265aXSswJE%2Fimage.png?alt=media\&token=75f2f0e4-a047-4a43-a5c3-cee581894df0)

![](https://3420392058-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LpnxLqvh8u2fEz86kIM%2F-LqgeXR20Y-VkmoOFjzT%2F-LqggqmQ5GafMp6i9wSp%2Fimage.png?alt=media\&token=4c4f2b6e-f294-444b-86a4-efdbd70159e0)

#### And Microsoft even provides you with the code to do it (PowerShell????)

```
rem == CreatePartitions-BIOS.txt ==
rem == These commands are used with DiskPart to
rem    create three partitions
rem    for a BIOS/MBR-based computer.
rem    Adjust the partition sizes to fill the drive
rem    as necessary. ==
select disk 0
clean
rem == 1. System partition ======================
create partition primary size=100
format quick fs=ntfs label="System"
assign letter="S"
active
rem == 2. Windows partition =====================
rem ==    a. Create the Windows partition =======
create partition primary
rem ==    b. Create space for the recovery tools  
rem       ** Update this size to match the size of
rem          the recovery tools (winre.wim)
rem          plus some free space.
shrink minimum=500
rem ==    c. Prepare the Windows partition ====== 
format quick fs=ntfs label="Windows"
assign letter="W"
rem == 3. Recovery tools partition ==============
create partition primary
format quick fs=ntfs label="Recovery"
assign letter="R"
set id=27
list volume
exit
```

{% embed url="<https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/configure-biosmbr-based-hard-drive-partitions>" %}

## UEFI GPT Windows Setup Defaults

#### With GPT Partitions, things work

![](https://3420392058-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LpnxLqvh8u2fEz86kIM%2F-LqgeXR20Y-VkmoOFjzT%2F-LqghHFPNxFBK1Iz4hyv%2Fimage.png?alt=media\&token=8610d958-087b-4aaa-b475-c02becc6f6a4)

#### But again, Windows Setup doesn't play by the rules

![](https://3420392058-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LpnxLqvh8u2fEz86kIM%2F-LqgeXR20Y-VkmoOFjzT%2F-LqghWnd5o-KHi10uAEO%2Fimage.png?alt=media\&token=a0a0dbf9-5217-4a5b-be9a-b13faf521e70)

```
rem == CreatePartitions-UEFI.txt ==
rem == These commands are used with DiskPart to
rem    create four partitions
rem    for a UEFI/GPT-based PC.
rem    Adjust the partition sizes to fill the drive
rem    as necessary. ==
select disk 0
clean
convert gpt
rem == 1. System partition =========================
create partition efi size=100
rem    ** NOTE: For Advanced Format 4Kn drives,
rem               change this value to size = 260 ** 
format quick fs=fat32 label="System"
assign letter="S"
rem == 2. Microsoft Reserved (MSR) partition =======
create partition msr size=16
rem == 3. Windows partition ========================
rem ==    a. Create the Windows partition ==========
create partition primary 
rem ==    b. Create space for the recovery tools ===
rem       ** Update this size to match the size of
rem          the recovery tools (winre.wim)
rem          plus some free space.
shrink minimum=500
rem ==    c. Prepare the Windows partition ========= 
format quick fs=ntfs label="Windows"
assign letter="W"
rem === 4. Recovery tools partition ================
create partition primary
format quick fs=ntfs label="Recovery tools"
assign letter="R"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
gpt attributes=0x8000000000000001
list volume
exit
```

{% embed url="<https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/configure-uefigpt-based-hard-drive-partitions>" %}
