0

I used Windows's MediaCreationTool21H2.exe to make a bootable USB flash drive to install Windows 10 on the SSD 2TB of my PC. The installation process starts by asking you which paritition you'd like to install Windows on.

At this point I divided my disk in 2, to install Windows on the first part. The tool asks you the size of the desired partition in "MB". There, I used "1,050,000 MB" as input, without really knowing if it was really MB or MiB...

From this, Windows actually takes some space to create some partitions (in order on the disk) :

  • 1 MiB for GPT/MBR
  • 100 MiB for System / EFI
  • 16 MiB for Microsoft Reserved Partition (MSR) / Hidden
  • [Windows Boot Partition / Primary GPT partition]
  • 509 MiB for Windows Recovery
  • [Unallocated]

I know my input was correctly interpreted as "1,050,000 MiB" which is the total size of the partitions Windows installation has created because : the 1st sector of the last partition x 512 (sector size) + 509 MiB x 1024^2 = 1,050,000 MiB x 1024^2

Now what I don't understand is why I have a "Partition gap" between the end of the Windows Boot Partition and the partition for Windows Recovery?

WinHex

It is not really an issue per se given the amount of lost space (714 240 B exactly), but I'd just like to understand :)

I thought may be it was because of some kind of alignment that the end of the Windows 10 partition must respect, but the start of the Windows Recovery partition (1,049,491 MiB exactly) is already a multiple of 512 (sector size), 2048, 4096, 8192, 1 MB, and alignment to 4 MB or 8 MB does not gives the difference I am looking for: 714 240 B = 697.5 KiB ≈ 0,68 MiB. So why Windows discards the space...

FIY: DISKPART and WMIC gives the same numbers than WinHex (except for the total size of disk since some raw space is not usable at its far end because of CHS coordinates limits)

11
  • My guess is the Windows installer does not have a predefined size for the recovery partition (or at least, the predefined size is not an interger in MiB). Then the size of main partition is derived with a formula like [ specified size - 1MiB head - 100MiB ESP - (non-whole-MiB recovery partition + 1MiB extra) ], then the recovery partition is made to start from the next MiB boundary from the end of the main partition til the end of the specified size to use.
    – Tom Yan
    Commented Apr 6, 2022 at 16:41
  • While I attempted to make a deduction, IMHO the question is quite pointless since you won't really get anything out of it. It's like asking why the size of the ESP is an integer in MiB but it's 100MiB instead of 128MiB -- with the answer being Microsoft does not have OCD.
    – Tom Yan
    Commented Apr 6, 2022 at 16:44
  • And in case you are so obsessed that you want to ask: why the size of the recovery partition is not predefined (or another similar question), it's probably because stuff in the recovery partition are relatively (i.e. when compared to those in the ESP) bigger and the size could vary/grow from time to time / depending on circumstances, so Microsoft decided to derive a size upon creation instead of always making it 16GiB or so.
    – Tom Yan
    Commented Apr 6, 2022 at 16:50
  • 1
    You say obsession, I'd say curiosity. That's how I discover and learn new things every day. Indeed I wasn't aware that the size of WinRE wasn't fixed, I simply haven't thought of that. Your suggested formula makes sense now I know that. Here, a gap is also mentioned tenforums.com/backup-restore/…
    – hymced
    Commented Apr 6, 2022 at 17:04
  • might have been an answer instead of a comment. if it wasn't implying I have OCD.
    – hymced
    Commented Apr 6, 2022 at 17:05

1 Answer 1

-1

(I can't answer the primary question of the odd 698KB unallocated space between the OS and WinRE partitions, as I'm unable to replicate the issue)


From this, Windows actually takes some space to create some partitions (in order on the disk) :

  • 1 MiB for GPT/MBR
  • 100 MiB for System / EFI
  • 16 MiB for Microsoft Reserved Partition (MSR) / Hidden
  • [Windows Boot Partition / Primary GPT partition]
  • 509 MiB for Windows Recovery
  • [Unallocated]
  • The 1MB space at the front of the drive occurs because the first partition [ESP] is aligned at 1024KB, created during Setup's windowsPE configuration pass with DiskPart command:
    cre par efi offset=1024
    

  • The Windows boot partition is the EFI [UEFI] or System (active) [BIOS] partition - a %SystemDrive% cannot be booted without the boot files on the EFI/System partition
    • While C: can be used as a boot drive in BIOS (not recommended), it cannot be used with UEFI because it requires partition GUID c12a7328-f81f-11d2-ba4b-00a0c93ec93b, whereas basic data partitions like C: have GUID ebd0a0a2-b9e5-4433-87c0-68b6b72699c7

  • The WinRE partition size cannot be predetermined unless the specific size of the Winre.wim for the specific version of Windows being installed is known, as the WIM [Windows IMage] for WinRE does grow with new OS versions and should have ~300MB of free space to absorb future increases in the WIM size (for current Windows versions, the Winre.wim is ~400MB)
    1. To determine the size of the Winre.wim, mount the install.wim || install.esd:
      (Open terminal via Shift+F10)
      ::# Get drive letter of Windows Install USB and partition to mount image on:
          Diskpart
            Lis Vol
            Exit
      
      ::# Get index for the OS version being installed from Install USB's install.wim || install.esd:
          Dism /Get-ImageInfo /ImageFile:"Z:\sources\install.wim"
      
      ::# Create mount folder on a partition other than X:
          MkDir "Z:\Mount"
      
      ::# Mount index of the OS being installed from the install.wim || install.esd:
          Dism /Mount-Image /ImageFile:"Z:\source\install.wim" /Index:6 /MountDir:"Z:\Mount" /ReadOnly
      
    2. Get Winre.wim size:
      Dir "Z:\Mount\Windows\System32\Recovery"
      
      ::# If Winre.wim not found:
          Dir /A:sh "Z:\Mount\Windows\System32\Recovery"
      
    3. Unmount install.wim || install.esd:
      Dism /Unmount-Image /MountDir:"Z:\Mount" /Discard
      


To avoid this in the future when not using the full drive for C:, I always recommend manually configuring the partitions in DiskPart within Setup, before selecting what partition to install to, by opening a terminal via Shift+F10:

  1. Select installation drive:
    (assumes data isn't being preserved, as clean wipes the partition table)
    DiskPart
    
    Lis Dis
    Sel Dis #
    Clean
    
    UEFI:
    Convert Gpt
    

  2. Create boot partition:
    • BIOS:
      Cre Par Pri Size=100 Offset=1024
      Format Quick Fs=NTFS Label=Boot
      Active
      
    • UEFI:
      Cre Par EFI Size=100 Offset=1024
      Format Quick Fs=FAT32 Label=EFI
      Cre Par Msr Size=16
      

  3. Create OS partition:
    (Multiply size wanted by 1024: 300*1024=307200)
    • BIOS:
      ::# if storing User Data directories on a partition other than C: (recommended), max size required is ~300GB
          Cre Par Pri Size=307200
          Format Quick Fs=NTFS Label=System
      
    • UEFI:
      ::# if storing User Data directories on a partition other than C: (recommended), max size required is ~300GB
          Cre Par Pri Size=307200 Id=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
          Format Quick Fs=NTFS Label=System
      

  4. Create WinRE partition: (defaulted to after the OS partition in v2004)
    (should have 300MB free - WinRE.wim is currently ~400MB in size)
    • BIOS:
      Cre Par Pri Offset=1024 Size=750 Id=27
      Format Quick Fs=NTFS Label=WinRE
      Exit
      
    • UEFI:
      Cre Par Pri Offset=1024 Size=750 Id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
      Format Quick Fs=NTFS Label=WinRE
      Gpt Attributes=0x8000000000000001
      Exit
      

  5. Close terminal and continue in Setup as normal
    • Partitions need to be created before Setup asks which partition to install too, otherwise Setup needs to be refreshed by going back a step in the Setup GUI, then forward again
14
  • Thank you for all theses details. Can you explain your bullet point about the RAW partition? what is it? how does it come into play with the gap? how did you estimate its size?
    – hymced
    Commented Apr 7, 2022 at 7:03
  • About the WinRE partition, why the 1024 KB offset? Could it just not start on the end boundary of the previous partition?
    – hymced
    Commented Apr 7, 2022 at 7:05
  • For the OS Partition, where does the 300GB limitation comes from? In my cas its way more? Why? I might install several 50GB+ games.
    – hymced
    Commented Apr 7, 2022 at 7:08
  • @hymced Apparently he derived this "RAW size" (which makes no sense at all) with 1050000 * 1024 / 1000. Let alone the fact that the formula is wrong (because 1050000 is in MiB but not KiB), I don't recall (recent) Windows actually shows/takes value in SI unit anywhere. What it does is that it calls/labels the values in binary units without the i (in other words, all the K/M/G...(B) you see/input in Windows are / will be treated as Ki/Mi/Gi...B). diskpart, PS-cmdlets, Disk Management, Windows Setup...same story for all of them.
    – Tom Yan
    Commented Apr 7, 2022 at 9:11
  • @hymced Offsetting the first partition by 1024KB [1MB] is sane partitioning, something Microsoft borrowed from Linux a few years back (this previously wasn't the default in Win <10). The max required OS partition size is ~300GB because if User Data [%UserProfile%\Documents, Downloads, etc.] is stored on a partition other than C: via each folder's properties' Location tab, it's highly unlikely 270GB will be exceeded by installed software (at least 10% of C: should always be free). For games, consider storing them on a dedicated partition initially/via a junction link [MkLink /j]
    – JW0914
    Commented Apr 7, 2022 at 12:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .