Open Disassembler0 opened 5 years ago
CMD: reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" /v "ShippedWithReserves" /t REG_DWORD /d "0" /f
PS: Set-ItemProperty -LiteralPath "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" -Name "ShippedWithReserves" -Value 0 -Type DWord -ErrorAction SilentlyContinue
this does not work. I have a cleanly installed Windows 10 1903, free space of 20GB on the system disk and still can't disable the reserved space.
This worked for me:
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" -Name "BaseHardReserveSize" -Value 0 -Type QWord -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" -Name "BaseSoftReserveSize" -Value 0 -Type QWord -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" -Name "HardReserveAdjustment" -Value 0 -Type QWord -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" -Name "MinDiskSize" -Value 0 -Type QWord -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" -Name "ShippedWithReserves" -Value 0 -Type DWord -ErrorAction SilentlyContinue
After that I have clicked on Clean now in Storage settings and the reserved space disappeared from the listing.
However I have no idea:
1) If it really deallocated the space or if it just hid it from UI
2) What some of those values under ReserveManager
registry key mean
3) How to run the cleanup from script or how to achieve the same result as the cleanup does
4) If it is safely reversible simply by setting the original values
I have tried to reset it using the original values via
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" -Name "BaseHardReserveSize" -Value 5368709120 -Type QWord -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" -Name "BaseSoftReserveSize" -Value 1610612736 -Type QWord -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" -Name "HardReserveAdjustment" -Value 522039296 -Type QWord -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" -Name "MinDiskSize" -Value 21474836480 -Type QWord -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" -Name "ShippedWithReserves" -Value 1 -Type DWord -ErrorAction SilentlyContinue
and after reboot my reserved storage shows 110 MB. I can only assume that it will eventually grow when the space is needed, but I haven't confirmed that either.
Super this works. I have back 7GB available. Thank you very much
Some small update for fellow researchers. The reserve is indeed a NTFS feature. In can be seen in overall statistics via
fsutil fsInfo ntfsInfo C:
It can be queried to see the individual "buckets"
fsutil storageReserve query C:
where
And it can be queried for individual file listing
fsutil storageReserve findByID C: *
There doesn't seem to be any subcommands for direct manipulation of reserves via fsutil
.
The Storage Sense which triggers the resize does quite a lot. So far I have been able to completely rule out involvement of cleanmgr.exe which is executed by it and I have string suspicion that the resize is triggered by some code in C:\Windows\System32\SettingsHandlers_StorageSense.dll
or one of libraries which it loads. I'll poke around a bit more later.
The registry keys are read by StorSvc service in following order:
This service uses library C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.18362.110_none_5f52ccdc58d07895\ReserveManager.dll
which exposes following entry points:
Looks like I'm on the right track. Also looks like this won't be possible without P/Invoke :(
https://blogs.windows.com/windowsexperience/2019/01/09/announcing-windows-10-insider-preview-build-18312/
https://blogs.technet.microsoft.com/filecab/2019/01/07/windows-10-and-reserved-storage/
Find if this can be disabled or reduced. It's a NTFS feature, so it might not be that easy :/