• WinSXS cleanup manually instead of cleanmgr?

    Home » Forums » AskWoody support » Windows » Windows 7 » Windows 7 patches » WinSXS cleanup manually instead of cleanmgr?

    Author
    Topic
    #2002553

    Yeah, right, cleanmgr is the tool of choice for cleaning up the component store (winsxs) …

    Well I have one case where cleanmgr just errors out (after ~5 hours) and doesn’t do much anything. Going from the CBS logs, there’s a few individual updates that have missing metadata, possibly because the system ran out of disk space at some critical point some time ago. Others do have the appropriate metadata.

    (It’s a server with a fair amount of activity, including several applications that automatically manage their own disk space usage… independently of each other except for total usage on C: and no, I didn’t set it up.)

    Anyone know of a way to do winsxs cleanup by individual component with, say, PowerShell, so that it could work in this situation?

    It’s a Server 2008 R2 SP1 so I expect this part to work like 7 …

    Viewing 2 reply threads
    Author
    Replies
    • #2002644

      Have you tried

      DISM /online /Cleanup-Image /SpSuperseded and
      Dism.exe /online /Cleanup-Image /StartComponentCleanup

      Also, see Repair corrupt Windows image error

      --Joe

      • #2002803

        DISM /online /Cleanup-Image /SpSuperseded

        Yeah, that didn’t do much… after several runs and reboots have managed to shave about as much off the entire winsxs dir as the CBS.log file grew by while doing that. Still a few dozen GB too large to my tastes.

        and
        Dism.exe /online /Cleanup-Image /StartComponentCleanup

        That’s only from W8 / Server 2012 onwards I believe…?

        Anyhow, all it says is “Error 87 The startcomponentcleanup option is not recognized in this context…”

        /ScanHealth has been run, didn’t report problems. SoftwareDistribution was cleaned up already too.

    • #2002814

      There is a portable utility that I’ve been using on W7/8.1 and occasionally on W10 that has never failed, introduced to us by @MrBrian _MVP. The utility cleans out superseded components in the component store and winsxs clean up as well and a host of other very useful settings. Unfortunately it does not do selective removal 🙁

      For further info if interested, see this thread leading to the program.

      Windows - commercial by definition and now function...
    • #2003890

      cleanmgr is the tool of choice for cleaning up the component store (winsxs) …

      Still a few dozen GB too large to my tastes.

      Analyze and clean the WinSXS folder

      The size of the folder is not reported correctly however if you use Windows Explorer or third-party tools like WizTree to analyze its size.

      The reason for that is that it contains hardlinks which Explorer and third-party tools don’t take into consideration when calculating the WinSXS folder’s size (they count the hardlinked files even though they don’t reside in the WinSXS folder).

      These hardlinks point to files in other Windows directories, for instance c:\Windows\system32.

      https://www.ghacks.net/2016/03/14/analyze-the-winsxs-folder/

      How to cleanup the winsxs folder on Windows 7 (SP1)/ Windows 2008 / Windows 2008 R2 (SP1)

      https://www.microsoftpro.nl/2011/07/28/how-to-cleanup-the-winsxs-folder-on-windows-7-sp1-windows-2008-windows-2008-r2-sp1/

      • This reply was modified 5 years, 6 months ago by Alex5723.
      • #2003940

        The size of the folder is not reported correctly however if you use Windows Explorer or third-party tools like WizTree to analyze its size.

        The reason for that is that it contains hardlinks which Explorer and third-party tools don’t take into consideration when calculating the WinSXS folder’s size (they count the hardlinked files even though they don’t reside in the WinSXS folder).

        Hardlinks are just fine, they’re a feature I’m well familiar with… and Sysinternals du counts them just fine, as do some versions of TreeSize.

        It’s just, there are a whole bunch of even things like amd64_microsoft-windows-f..truetype-couriernew_31bf3856ad364e35_6.1.7601.*_none and only one of those sets is hardlinked with the actually in-use instance – and not even the latest version number of that; amd64_microsoft-windows-os-kernel_31bf3856ad364e35_6.1.7601.*_none has 90+ versions… and fortunately the latest version hardlinked to the in-use instance.

        And then there’s things like @{ARCH}_microsoft-windows-ieframe.resources_31bf3856ad364e35_@{IE_VERSION}.@{PATCH_BUILD}_@{LANG} …Hundreds of those on disk. Yes, {amd64, wow64, x86} TIMES multiple language variants TIMES each version number …sure it does need all three architecture variants of all languages of the latest version, but anyway it does all add up even if I haven’t managed to collect all published versions.

        And no, this thing doesn’t seem to have /AnalyzeComponentStore or /StartComponentCleanup in DISM.EXE … never managed to use them with older than 8.x / Server 2012…

        If it were just a W7 workstation I’d just reinstall and be done with it, but a server where reboots have to be scheduled in advance and all that is a bit different. Not impossible, just a lot of bother. Same with throwing more hardware at it.

        Times like this I really miss good old “swmodify -x patch_commit=true” … I mean, even if I had to call that individually for each patch fileset… BTDT, with a script… right, have to look at Dism++ some more…

    Viewing 2 reply threads
    Reply To: WinSXS cleanup manually instead of cleanmgr?

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: