Commands to find the free space within the EFI and Recovery partitions


zbook

Well-known member
Guru
VIP
Local time
11:41 PM
Posts
5,041
OS
Windows 10
When troubleshooting Windows upgrade failures the failure log files may report blocks due to deficient free space.

There may deficient space errors in one or more of these partitions:

EFI
system-reserved-partition
Primary
Recovery

The deficient space for the error message we-couldn-t-update-system-reserved-partition is frequently 3 MB.



Diskpart is useful for the primary partition.


What commands can be used before an upgrade attempt to determine the free space (MB) for each of these partitions?

EFI
system-reserved-partition
Recovery
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    Laptop
    Manufacturer/Model
    HP
    CPU
    Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
    Motherboard
    Product : 190A Version : KBC Version 94.56
    Memory
    16 GB Total: Manufacturer : Samsung MemoryType : DDR3 FormFactor : SODIMM Capacity : 8GB Speed : 1600
    Graphics Card(s)
    NVIDIA Quadro K3100M; Intel(R) HD Graphics 4600
    Sound Card
    IDT High Definition Audio CODEC; PNP Device ID HDAUDIO\FUNC_01&VEN_111D&DEV_76E0
    Hard Drives
    Model Hitachi HTS727575A9E364
    Antivirus
    Microsoft Defender
    Other Info
    Mobile Workstation
The Notebook I'm on now has 4 partitions and small unallocated space, DM gives space info only for 3 of the partitions. Some of the small partitions do not allow user access to them.

1741050506211.webp
When needing to manipulate them I do it by booting a Linux Mint LiveUSB and using the included GPARTED program to make resize changes without losing data.
 

My Computers

System One System Two

  • OS
    Win11 Pro RTM
    Computer type
    Laptop
    Manufacturer/Model
    Dell Vostro 3400
    CPU
    Intel Core i5 11th Gen. 2.40GHz
    Memory
    12GB
    Hard Drives
    256GB SSD NVMe M.2
  • Operating System
    Windows 11 Pro RTM x64
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Vostro 5890
    CPU
    Intel Core i5 10th Gen. 2.90GHz
    Memory
    16GB
    Graphics card(s)
    Onboard, no VGA, using a DisplayPort-to-VGA adapter
    Monitor(s) Displays
    24" Dell
    Hard Drives
    512GB SSD NVMe, 4TB Seagate HDD
    Browser
    Firefox, Edge
    Antivirus
    Windows Defender/Microsoft Security
You could use this to get partitions, then use the GPT types to get space information for each one.

Powershell:
Get-Partition | Format-Table -AutoSize -Property @('DiskNumber', 'Type', 'GptType', 'Guid')

Get-Partition | Where-Object { $_.GptType -eq '{c12a7328-f81f-11d2-ba4b-00a0c93ec93b}' } | Get-Volume | Format-Table -AutoSize -Property @('Size', 'SizeRemaining')
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 24H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Intel Core i7-1260P, 2100 MHz
    Motherboard
    NUC12WSBi7
    Memory
    64 GB
    Graphics Card(s)
    Intel Iris Xe
    Sound Card
    built-in Realtek HD audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840x2160 @ 60Hz
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Keyboard
    CODE 104-Key Mechanical with Cherry MX Clears
    Antivirus
    Microsoft Defender
  • Operating System
    Linux Mint 21.2 (Cinnamon)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC8i5BEH
    CPU
    Intel Core i5-8259U CPU @ 2.30GHz
    Memory
    32 GB
    Graphics card(s)
    Iris Plus 655
    Keyboard
    CODE 104-Key Mechanical with Cherry MX Clears
There are scripts such as healthcheck and whynotwin 11 that can be used for screening.

However these do not check free space.

I'm looking for commands to check the partition free space before the upgrades.
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    Laptop
    Manufacturer/Model
    HP
    CPU
    Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
    Motherboard
    Product : 190A Version : KBC Version 94.56
    Memory
    16 GB Total: Manufacturer : Samsung MemoryType : DDR3 FormFactor : SODIMM Capacity : 8GB Speed : 1600
    Graphics Card(s)
    NVIDIA Quadro K3100M; Intel(R) HD Graphics 4600
    Sound Card
    IDT High Definition Audio CODEC; PNP Device ID HDAUDIO\FUNC_01&VEN_111D&DEV_76E0
    Hard Drives
    Model Hitachi HTS727575A9E364
    Antivirus
    Microsoft Defender
    Other Info
    Mobile Workstation
Which numbers are for the free space for each

system-reserved-partition
Primary
Recovery





Code:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\WINDOWS\system32> Get-Partition | Format-Table -AutoSize -Property @('DiskNumber', 'Type', 'GptType', 'Guid')

DiskNumber Type     GptType                                Guid
---------- ----     -------                                ----
         0 Recovery {de94bba4-06d1-4d40-a16a-bfd50179d6ac} {d7da621b-1b7b-416c-bd23-49efbe24b66a}
         0 System   {c12a7328-f81f-11d2-ba4b-00a0c93ec93b} {0080d238-4ff5-42f9-bf68-9b9c80f5c2a1}
         0 Reserved {e3c9e316-0b5c-4db8-817d-f92df00215ae} {1e5456a1-7daf-43d9-9ac1-e014c63f4f82}
         0 Basic    {ebd0a0a2-b9e5-4433-87c0-68b6b72699c7} {16d3a9d3-9279-435b-9141-c65a6520f8d1}
         0 Recovery {de94bba4-06d1-4d40-a16a-bfd50179d6ac} {f22829ed-1f6d-4638-8b3f-8602d8a2a5f8}


PS C:\WINDOWS\system32> Get-Partition | Where-Object { $_.GptType -eq '{c12a7328-f81f-11d2-ba4b-00a0c93ec93b}' } | Get-Volume | Format-Table -AutoSize -Property @('Size', 'SizeRemaining')

     Size SizeRemaining
     ---- -------------
100663296      17553408


PS C:\WINDOWS\system32>
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    Laptop
    Manufacturer/Model
    HP
    CPU
    Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
    Motherboard
    Product : 190A Version : KBC Version 94.56
    Memory
    16 GB Total: Manufacturer : Samsung MemoryType : DDR3 FormFactor : SODIMM Capacity : 8GB Speed : 1600
    Graphics Card(s)
    NVIDIA Quadro K3100M; Intel(R) HD Graphics 4600
    Sound Card
    IDT High Definition Audio CODEC; PNP Device ID HDAUDIO\FUNC_01&VEN_111D&DEV_76E0
    Hard Drives
    Model Hitachi HTS727575A9E364
    Antivirus
    Microsoft Defender
    Other Info
    Mobile Workstation
This is a little better...


Powershell:
Get-Partition | Format-Table -AutoSize -Property @('DiskNumber', 'Type', 'GptType', @{Name = 'SizeRemaining'; Expr = { (Get-Volume -UniqueId "\\?\Volume$($_.Guid)\").SizeRemaining }}, @{Name = 'Size'; Expr = { (Get-Volume -UniqueId "\\?\Volume$($_.Guid)\").Size }})

Code:
DiskNumber Type     GptType                                SizeRemaining Size
---------- ----     -------                                ------------- ----
         0 Reserved {e3c9e316-0b5c-4db8-817d-f92df00215ae}
         0 Basic    {ebd0a0a2-b9e5-4433-87c0-68b6b72699c7} 1866624196608 2000381014016
         1 System   {c12a7328-f81f-11d2-ba4b-00a0c93ec93b} 233250816     268435456
         1 Reserved {e3c9e316-0b5c-4db8-817d-f92df00215ae}
         1 Basic    {ebd0a0a2-b9e5-4433-87c0-68b6b72699c7} 900102602752  998762344448
         1 Recovery {de94bba4-06d1-4d40-a16a-bfd50179d6ac} 313319424     1033891840
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 24H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Intel Core i7-1260P, 2100 MHz
    Motherboard
    NUC12WSBi7
    Memory
    64 GB
    Graphics Card(s)
    Intel Iris Xe
    Sound Card
    built-in Realtek HD audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840x2160 @ 60Hz
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Keyboard
    CODE 104-Key Mechanical with Cherry MX Clears
    Antivirus
    Microsoft Defender
  • Operating System
    Linux Mint 21.2 (Cinnamon)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC8i5BEH
    CPU
    Intel Core i5-8259U CPU @ 2.30GHz
    Memory
    32 GB
    Graphics card(s)
    Iris Plus 655
    Keyboard
    CODE 104-Key Mechanical with Cherry MX Clears
can the results be reported in specific units?

MB or GB?
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    Laptop
    Manufacturer/Model
    HP
    CPU
    Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
    Motherboard
    Product : 190A Version : KBC Version 94.56
    Memory
    16 GB Total: Manufacturer : Samsung MemoryType : DDR3 FormFactor : SODIMM Capacity : 8GB Speed : 1600
    Graphics Card(s)
    NVIDIA Quadro K3100M; Intel(R) HD Graphics 4600
    Sound Card
    IDT High Definition Audio CODEC; PNP Device ID HDAUDIO\FUNC_01&VEN_111D&DEV_76E0
    Hard Drives
    Model Hitachi HTS727575A9E364
    Antivirus
    Microsoft Defender
    Other Info
    Mobile Workstation
Powershell:
Get-Partition | Format-Table -AutoSize -Property @('DiskNumber', 'Type', 'GptType', @{Name = 'SizeRemainingGB'; Expr = { (Get-Volume -UniqueId "\\?\Volume$($_.Guid)\").SizeRemaining / 1GB }; FormatString = "{0:N2}"}, @{Name = 'SizeGB'; Expr = { (Get-Volume -UniqueId "\\?\Volume$($_.Guid)\").Size / 1GB }; FormatString = "{0:N2}"})

Code:
DiskNumber Type     GptType                                SizeRemainingGB SizeGB
---------- ----     -------                                --------------- ------
         0 Reserved {e3c9e316-0b5c-4db8-817d-f92df00215ae}
         0 Basic    {ebd0a0a2-b9e5-4433-87c0-68b6b72699c7} 1,738.43        1,863.00
         1 System   {c12a7328-f81f-11d2-ba4b-00a0c93ec93b} 0.22            0.25
         1 Reserved {e3c9e316-0b5c-4db8-817d-f92df00215ae}
         1 Basic    {ebd0a0a2-b9e5-4433-87c0-68b6b72699c7} 838.28          930.17
         1 Recovery {de94bba4-06d1-4d40-a16a-bfd50179d6ac} 0.29            0.96
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 24H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Intel Core i7-1260P, 2100 MHz
    Motherboard
    NUC12WSBi7
    Memory
    64 GB
    Graphics Card(s)
    Intel Iris Xe
    Sound Card
    built-in Realtek HD audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840x2160 @ 60Hz
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Keyboard
    CODE 104-Key Mechanical with Cherry MX Clears
    Antivirus
    Microsoft Defender
  • Operating System
    Linux Mint 21.2 (Cinnamon)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC8i5BEH
    CPU
    Intel Core i5-8259U CPU @ 2.30GHz
    Memory
    32 GB
    Graphics card(s)
    Iris Plus 655
    Keyboard
    CODE 104-Key Mechanical with Cherry MX Clears
Sorry, it's not a one-liner...
Code:
function DiskSize {
    param ([uint64]$Number)

    if ($Number -ge 1GB) { return ('{0:f2} GB' -f ($Number/1GB)) }
    if ($Number -ge 1MB) { return ('{0:f2} MB' -f ($Number/1MB)) }
    return ('{0:f1} KB' -f ($Number/1KB))
}

$SystemDisk = (Get-Disk | Where-Object {$_.IsSystem -eq $true}).Number
"Disk $SystemDisk (System Disk)"

Get-Partition -DiskNumber $SystemDisk |% {
    $Volume = Get-Volume -UniqueId "\\?\Volume$($_.Guid)\"

    [PSCustomObject]@{
        Partition = $_.PartitionNumber
        Type = $_.Type
        FileSystem = $(if ($_.Type -eq 'Reserved') { 'FAT32' } else { $Volume.FileSystemType })
        Health = $Volume.HealthStatus
        Status = $Volume.OperationalStatus
        Free = $(if ($_.Type -ne 'Reserved') { DiskSize $Volume.SizeRemaining } else { $null })
        Size = DiskSize $_.Size
    }
} | Format-Table -Property @{Label='Partition';Expression={$_.Partition};Alignment='Left'},Type,FileSystem,Health,Status,@{Label='Free';Expression={$_.Free};Alignment='Right'},@{Label='Size';Expression={$_.Size};Alignment='Right'}

Code:
Disk 0 (System Disk)

Partition Type     FileSystem Health  Status      Free      Size
--------- ----     ---------- ------  ------      ----      ----
1         System   FAT32      Healthy OK     222.54 MB 260.00 MB
2         Reserved FAT32                                16.00 MB
3         Recovery NTFS       Healthy OK     174.69 MB 700.00 MB
4         Basic    NTFS       Healthy OK      19.06 GB  53.04 GB
 

My Computer

System One

  • OS
    Windows 7
Code:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\WINDOWS\system32> function DiskSize {
>>     param ([uint64]$Number)
>>
>>     if ($Number -ge 1GB) { return ('{0:f2} GB' -f ($Number/1GB)) }
>>     if ($Number -ge 1MB) { return ('{0:f2} MB' -f ($Number/1MB)) }
>>     return ('{0:f1} KB' -f ($Number/1KB))
>> }
>>
>> $SystemDisk = (Get-Disk | Where-Object {$_.IsSystem -eq $true}).Number
>> "Disk $SystemDisk (System Disk)"
>>
>> Get-Partition -DiskNumber $SystemDisk |% {
>>     $Volume = Get-Volume -UniqueId "\\?\Volume$($_.Guid)\"
>>
>>     [PSCustomObject]@{
>>         Partition = $_.PartitionNumber
>>         Type = $_.Type
>>         FileSystem = $(if ($_.Type -eq 'Reserved') { 'FAT32' } else { $Volume.FileSystemType })
>>         Health = $Volume.HealthStatus
>>         Status = $Volume.OperationalStatus
>>         Free = $(if ($_.Type -ne 'Reserved') { DiskSize $Volume.SizeRemaining } else { $null })
>>         Size = DiskSize $_.Size
>>     }
>> } | Format-Table -Property @{Label='Partition';Expression={$_.Partition};Alignment='Left'},Type,FileSystem,Health,Status,@{Label='Free';Expression={$_.Free};Alignment='Right'},@{Label='Size';Expression={$_.Size};Alignment='Right'}
Disk 0 (System Disk)

Partition Type     FileSystem Health  Status      Free      Size
--------- ----     ---------- ------  ------      ----      ----
1         Recovery NTFS       Healthy OK     434.60 MB 450.00 MB
2         System   FAT32      Healthy OK      16.74 MB 100.00 MB
3         Reserved FAT32                                16.00 MB
4         Basic    NTFS       Healthy OK      34.64 GB 237.05 GB
5         Recovery NTFS       Healthy OK     244.52 MB 885.00 MB


PS C:\WINDOWS\system32>
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    Laptop
    Manufacturer/Model
    HP
    CPU
    Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
    Motherboard
    Product : 190A Version : KBC Version 94.56
    Memory
    16 GB Total: Manufacturer : Samsung MemoryType : DDR3 FormFactor : SODIMM Capacity : 8GB Speed : 1600
    Graphics Card(s)
    NVIDIA Quadro K3100M; Intel(R) HD Graphics 4600
    Sound Card
    IDT High Definition Audio CODEC; PNP Device ID HDAUDIO\FUNC_01&VEN_111D&DEV_76E0
    Hard Drives
    Model Hitachi HTS727575A9E364
    Antivirus
    Microsoft Defender
    Other Info
    Mobile Workstation
EFI 0.22 or 16.74 MB

Recovery 0.29 or 244.52 MB
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    Laptop
    Manufacturer/Model
    HP
    CPU
    Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
    Motherboard
    Product : 190A Version : KBC Version 94.56
    Memory
    16 GB Total: Manufacturer : Samsung MemoryType : DDR3 FormFactor : SODIMM Capacity : 8GB Speed : 1600
    Graphics Card(s)
    NVIDIA Quadro K3100M; Intel(R) HD Graphics 4600
    Sound Card
    IDT High Definition Audio CODEC; PNP Device ID HDAUDIO\FUNC_01&VEN_111D&DEV_76E0
    Hard Drives
    Model Hitachi HTS727575A9E364
    Antivirus
    Microsoft Defender
    Other Info
    Mobile Workstation
So basically you want to check the currently active partitions (via BCD) if there's more than one created?
 

My Computer

System One

  • OS
    Windows 7
If an upgrade is attempted and fails the failure may be identified in the failure log files.

Code:
2025-02-18 08:35:28, Info                  CONX   CFreeSystemPartitionDiskSpaceChecker: checked InsufficientSystemPartitionDiskSpace, found HardBlock.Not enough space on partition [\\?\GLOBALROOT\Device\HarddiskVolume1\] Required: 15 MB. Available: 12 MB.

This was insufficient by 3 MB.

If the partition size free spaces was able to be checked before upgrades there may be reduced upgrade failures.

So I'm looking for methods to check the free space in the four default partitions.
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    Laptop
    Manufacturer/Model
    HP
    CPU
    Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
    Motherboard
    Product : 190A Version : KBC Version 94.56
    Memory
    16 GB Total: Manufacturer : Samsung MemoryType : DDR3 FormFactor : SODIMM Capacity : 8GB Speed : 1600
    Graphics Card(s)
    NVIDIA Quadro K3100M; Intel(R) HD Graphics 4600
    Sound Card
    IDT High Definition Audio CODEC; PNP Device ID HDAUDIO\FUNC_01&VEN_111D&DEV_76E0
    Hard Drives
    Model Hitachi HTS727575A9E364
    Antivirus
    Microsoft Defender
    Other Info
    Mobile Workstation
Back
Top Bottom