[SOLVED] Server 2016 (1607) RestoreHealth missing components

I'm fixing these servers as and when I find them. The one I fixed earlier this week went from 63GB WinSxS down to 8GB.
Did you use any (third-party) toolkit/script to clean-up or compress the WinSxS folder?

Step 1.
Warning: This fix was written specifically for this system. Do not run this fix on another system.
  • Save any work you have open, and close all programs.
  • Download the attachment SFCFix.zip and save it to your desktop.
  • Drag the SFCFix.zip file over the SFCFix.exe executable and release it.
650c22f99662d-6190d993a26f3-SFCFix-Zip-Eng.gif

  • SFCFix will launch, let it complete.
  • Once done, a file will appear on your desktop, called SFCFix.txt.
  • Post the logfile (SFCFix.txt) as attachment in your next reply.


Step 2. Run the following DISM command and post the result. If it fails attach a new copy of the CBS log.
Code:
DISM /online /cleanup-image /RestoreHealth
 

Attachments

Here's the next fix:

Step 1.
Warning: This fix was written specifically for this system. Do not run this fix on another system.
  • Save any work you have open, and close all programs.
  • Download the attachment SFCFix.zip and save it to your desktop.
  • Drag the SFCFix.zip file over the SFCFix.exe executable and release it.
650c22f99662d-6190d993a26f3-SFCFix-Zip-Eng.gif

  • SFCFix will launch, let it complete.
  • Once done, a file will appear on your desktop, called SFCFix.txt.
  • Post the logfile (SFCFix.txt) as attachment in your next reply.


Step 2. Run the following DISM command and post the result. If it fails attach a new copy of the CBS log.
Code:
DISM /online /cleanup-image /RestoreHealth
 

Attachments

I will see if I can upload a copy of the WinSXS folder of my VM to use as source with DISM, it seems you'll need a number of uncompressed files...
 
That would be brilliant if you could! I was going to ask how and where you are sourcing these from. I had though that if I build a VM and install the same features that it would have all the files I need but this wasn't the case.

Should I hold off posting the next one for now?
 
Let's hope it will speed up some things since DISM reported only 1 or 2 files after each run... 🤞
 
I have a suspicion that it is going to take a few runs, but will keep you posted and show the before and after results.
I really appreciate the continued help and things I'm learning about working with these things.
 
So I ended up scripting a loop for this, it took roughly 50 or so RestoreHealth executions to allow StartComponentCleanup to complete as expected.
Code:
Function WriteLastLines () {
    param (
        [array] $InputArray
    )
    $lineCount = 0
    [array]::Reverse($InputArray)
    ForEach ($line In $InputArray) {
        If ($line.StartsWith("[")) {Break}
        $lineCount++
    }
    [array]::Reverse($InputArray)
    For ($i=($InputArray.GetUpperBound("") - $lineCount);$i -le ($InputArray.GetUpperBound(""));$i++) {
        Write-Host $InputArray[$i]
    }
}

$clean = "The component store has been corrupted."
$restore = "The restore operation completed successfully."
while ($clean.Contains("The component store has been corrupted.") -And $restore.Contains("The restore operation completed successfully.")) {
    $counter++
    Write-Host "$(Get-Date -Format "yyyy-MM-dd HH:mm:ss") | $counter | Restore"
    $restore = @(dism /online /cleanup-image /restorehealth /Source:E:\winsxs /LimitAccess)
    WriteLastLines $restore
    Write-Host "$(Get-Date -Format "yyyy-MM-dd HH:mm:ss") | $counter | Clean"
    $clean = @(dism /online /cleanup-image /startcomponentcleanup)
    WriteLastLines -InputArray $clean
    PAUSE
}

With this done ResetBase could go through and the repository was suitably reduced.
Before
Before

After
2024-04-21 12_04_52-SYSFREPRD01 (sysadmin) - RD Tabs.png

Never mind the space, but the difference this makes to machine performance is huge... I really love getting these machines sorted properly.
Thanks @Maxstar, for the awesome help!
I would really like to learn more about the component based servicing stuff and be more of a contributor to these forums (than a help requestor).
 
Hi,

You're welcome. Glad you have managed to resolve the issues with this server... (y)

To learn more about Windows Update and if you want to become a volunteer here you can sign-up for the Windows Update Academy.

I will mark this thread as solved.
 

Has Sysnative Forums helped you? Please consider donating to help us support the site!

Back
Top