none
How to reduce size of C:\Windows\winsxs folder in windows 2008 R2?

    Question

  • Hello,

    Is there any way to reduce size of C:\Windows\winsxs folder in windows 2008 R2

    simular to 

    DISM /online /Cleanup-Image /SpSuperseded

    ?

    Many thanks

    Friday, May 20, 2011 12:21 PM

All replies

  • Hello, Vasily K.

     

    You read this?

    Regards.


    Oscar Abad -- MCITP Enterprise Administrator // MCITP Server Administrator
    Friday, May 20, 2011 12:53 PM
  • Yes, I did but It does not work for windows 2008 R2 even if you install and use cleanmgr.
    this article was the most usefull: __http://blogs.technet.com/b/joscon/archive/2011/02/15/how-to-reclaim-space-after-applying-service-pack-1.aspx

    but it does not work for windows 2008 R2 without sp1.

    Friday, May 20, 2011 12:55 PM
  • Review this.

    Maybe....


    Oscar Abad -- MCITP Enterprise Administrator // MCITP Server Administrator
    Friday, May 20, 2011 1:05 PM
  • Hi,

     

    The only way to safely reduce the size of the WinSxS folder is to reduce the set of possible actions that the system can take – the easiest way to do that is to remove the packages that installed the components in the first place.  This can be done by uninstalling superseded versions of packages that are on your system.  Service Pack 1 contains a binary called VSP1CLN.EXE, a tool that will make the Service Pack package permanent (not removable) on your system,  and remove the RTM versions of all superseded components.  This can only be done because by making the Service Pack permanent we can guarantee that we won’t ever need the RTM versions.

     

    For the detailed information, please refer to the following Microsoft TechNet blog:

     

    What is the WINSXS directory in Windows 2008 and Windows Vista and why is it so large?

    http://blogs.technet.com/b/askcore/archive/2008/09/17/what-is-the-winsxs-directory-in-windows-2008-and-windows-vista-and-why-is-it-so-large.aspx

     

    Regards,


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Wednesday, May 25, 2011 5:14 AM
  • Hi,

     

    The only way to safely reduce the size of the WinSxS folder is to reduce the set of possible actions that the system can take – the easiest way to do that is to remove the packages that installed the components in the first place.  This can be done by uninstalling superseded versions of packages that are on your system.  Service Pack 1 contains a binary called VSP1CLN.EXE, a tool that will make the Service Pack package permanent (not removable) on your system,  and remove the RTM versions of all superseded components.  This can only be done because by making the Service Pack permanent we can guarantee that we won’t ever need the RTM versions.

     

    For the detailed information, please refer to the following Microsoft TechNet blog:

     

    What is the WINSXS directory in Windows 2008 and Windows Vista and why is it so large?

    http://blogs.technet.com/b/askcore/archive/2008/09/17/what-is-the-winsxs-directory-in-windows-2008-and-windows-vista-and-why-is-it-so-large.aspx

     

    Regards,


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Article above was written in 2008, now it is 2011. Are you saying what there is still no legitimate way to fix it for windows server 2008/ 2008 R2?
    Thursday, May 26, 2011 3:01 PM
  • Hi,

     

    The WinSxS folder in both Windows Server 2008 and Windows Server 2008 R2 are working within the same mechanism.

     

    Regards,


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Friday, May 27, 2011 7:24 AM
  • Question was not answered properly.

    If there is no solution at least Microsoft could recommend to use minimum partitions for OS drive 50 GB for windows server 2008, otherwise it is misleading.

    Friday, June 17, 2011 12:35 PM
  • This is ridiculous.  Users should have the option of removing old components.

    The claim that the vast majority of the WINSXS directory doesn't actually take space is a lie.
    Our WINSXS directory is over 8.5 GB.  The amount of space used by hardlinks is 2.6 GB.
    On our basic IIS server, over 69% of the space taken by WINSXS is actually taken.

    Installing SP1 and then running the cleanup tool may help a bit, but it's not a permanent solution.
    A permanent solution would be to allow users to delete all that crap.
    The vast majority of users will never have a broken/missing component from an out-of-order install/uninstall process.  Those that do can simply (get this!) reinstall the component, either manually or by reinstalling the service/feature/role/software/update that gave it to them.

    The current system is just absurd.  Yes, it's nice to have a manifest of what version of what works with what.  No, it's not necessary to actually store the damned unused files on the system drive when everyone is using a small partition, in accordance with MS's recommendations!  Let people get the files on their own if they need them.  Windows update?  OS DVD?  Optional storage of OS DVD contents (similar to the i386 folder for XP)? Reinstalling the thing that gave them that component version?

    Of course, it's too late now.  What can be done now is an option to clear out unused components and prevent them from being stored in the future.  Put a big ol' warning on it that says "If you, or an update to a program/feature/service/etc., breaks something, you'll have to roll back!".

    Monday, June 20, 2011 7:11 PM
  • This is ridiculous.

    That's all that needed to be said.

    /would really love to help microsoft work out the kinks and install this win 8 .iso on my gaming+ssd rig
    //TOO BAD I'D HAVE TO BALEET EVERY PROGRAM JUST TO GET TO THE MINIMUM FRIGGIN SPACE REQUIREMENTS
    ///am guessing that i'd run out of space after installing vlc media player  *X|* brilliant work, os designers
    Wednesday, January 11, 2012 3:28 AM
  • Hi,

    This works in Server 2008 R2 only if you have SP1 installed, since it deletes the roll-back files. Basically you can't uninstall SP1 after running  DISM /online /Cleanup-Image /SpSuperseded.

    HTH

    A

    Friday, February 24, 2012 8:40 AM
  • Hi

    The DISM /online /Cleanup-Image /SpSuperseded command doesnt work if you used a Windows 2008 R2 with Sp1 included build. Nothing to remove...

    Same issue still applies for the WINSXS folder.

    Cheers

    David

    Sunday, March 18, 2012 8:22 PM
  • Okay maybe some background on the root of the problem would help.

    Windows XP (and Windows 2000) used a fast and great mechanism called Hotfix Installer (Update.exe) to install updates. Updates installed in very little time. If you wanted to further reduce update times on Windows XP, you could just temporarily stop the System Restore service and updates would install at crazy speeds. Note that this is not recommended for novice users who don't know advanced recovery methods, as some updates can sometimes cause your system to stop booting so you cannot even uninstall them. The method the Hotfix Installer used was simple, it just installed a new version of files to be updated at %windir%\system32 and %windir%\system32\dllcache (the Windows File Protection cache). For files that were in use, a restart copied them from dllcache to the system32 folder. This is simple file-based servicing. The hotfix installer (Update.exe) also supported various command line switches like /nobackup which means not to backup files it patches. Again, this is not recommended for novice users as some updates can screw your system even after the comprehensive testing Microsoft does before releasing them. But if you won't be uninstalling any updates (usually one only requires uninstalling updates if they cause problems), you could save a ton of disk space by not backing up the files it patched. The Hotfix Installer backed up files to C:\Windows\$Uninstall$KBxxxxxx folders so even if you did back up the files at install time, they could be safely deleted after a few days if no stability issues were found after using Windows with the newest updates applied. Update.exe also supported the very important and convenient ability to slipstream a service pack or update into the original Windows setup files using the /s switch.    

    .

    When Microsoft was developing Windows Vista, they realized that components had gotten too many interdepencies on each other and to service each file reliably without breaking another component that relied on it, Microsoft introduced what they called as Component Based Servicing (CBS). You can read all about it in a much more technical way at The Servicing Guy's blog. What CBS does basically is it installs all files of the entire operating system, including all languages into C:\Windows\WinSxS and then it hard-links files from there to C:\Windows\system32. This has the benefit of not having to insert the OS disc to add or remove any components, and some other advantages as well like offline servicing of a Windows Vista or Windows 7 image. But the design introduces a major disadvantage of taking up a lot of hard disk space. Whenever an update is installed, it no longer installs it to C:\Windows\system32 and C:\Windows\system32\dllcache like Windows XP's hotfix installer (Update.exe) did. Instead, it updates the files in C:\Windows\WinSxS. Now, Windows keeps multiple copies of the same file but with different version in WinSxS if it is used by more than one Windows component. The higher the number of components, that many number of times the file exists in C:\Windows\WinSxS. When a Windows Vista update (.MSU) is installed, the components get updated, each and every one, instead of the files and the worst part is it still maintains the older superseded previous versions of components in WinSxS so the user would be able to uninstall updates. Microsoft does say that some sort of "scavenging" or deleting older copies of components takes place but is scarce on the details. The scavenging seems to take place automatically at certain intervals in Windows 7 but not in Windows Vista. In Windows Vista, you have to add or remove any Windows component for the scavenging to take place. And Microsoft says the scavenging will free up some disk space but in practice, on my system, I see my free disk space only decreasing on Vista as I remove or add any component. Windows does not give the user an option to not backup the earlier versions of components like Windows XP's /nobackup switch in Hotfix Installer did. As as you install more and more updates on your system, they will take more and more disk space. This is one of the primary reasons Windows Vista and Windows 7 are so bloated. Another reason for them being so bloated is the DriverStore that these OSes store. All drivers that are shipped with the OS and the OEM ones which you download and which are installed for a particular system are staged in C:\Windows\System32\DriverStore. But let's not go there for now.

    .

    Now, an important thing to note is that the size of the WinSxS folder is not what Explorer or the dir command report, it is far less but is misreported by Explorer because it counts the hard links more than once when calculating size. That does not mean, the size of WinSxS is not causing real-world disk space problems on numerous Windows Vista/7 systems in use today. Microsoft's ingenious recommendation to this problem of ever growing disk consumption is to install fewer updates to keep the size of the servicing store under control. Of course, users cannot deny installing security updates and leave their system open to security holes. What they can do is install less optional updates, the ones that Microsoft releases on the fourth Tuesday of every month and also install less of the hotfixes that are available by request from a Knowledge Base article. In short, you have to trade the number of bugs fixed in the OS by installing hotfixes at the cost of enormous amounts of disk space. The whole servicing stack is a total downgrade to Windows XP's update.exe method. It causes heavy disk thrashing and slow logoffs/logons while Windows configures these updates at the Welcome Screen. Many systems are unable to boot because of failed updates. Another disadvantage of the "new" servicing stack (and the redesigned Setup mechanism of Windows Vista) is the inability to do a true slipstream of service packs and hotfixes.
    The time it takes to actually install these hotfixes online compared to Windows XP is also completely unacceptable. When you start installing an MSU update, it spends a lot of time determining whether the update applies to your system. Then, the update itself takes much longer to install compared to Windows XP's Update.exe (hours instead of minutes if you are installing dozens of updates through a script). Finally, that post-installation process ("Configuring updates... Do not turn off your computer") takes several minutes before shut down followed by a second post-installation process (configuration) upon restart before logon that also takes also several minutes and thrashes the disk.

    .

    I can install the entire SP3 for Windows XP in about 10 minutes after downloading the full installer. I can also install a slipstreamed-with-SP3 copy of Windows XP is about 45 minutes on a modern fast PC. In contrast, Windows Vista or Windows 7 do install relatively quickly (in just about 15-20 minutes) on a modern PC but installing the service packs and updates takes more time than anything on XP did. Not only can service packs not be slipstreamed, but Vista Service Packs are not even cumulative, which means if you clean install Windows Vista today, you have to install SP1 first which takes about 90 minutes, then SP2 which takes less time, then all the post-SP2 updates which do take hours to install. If you really HAVE to use Windows 7 or Windows Vista, you are stuck with this slow update non-sense as Microsoft does not even acknowledge that there is any slowdown or loss of functionality in the new servicing mechanism. The fact remains: MSU updates are slow as **** and take too much time and as Windows 7/Vista get older and Microsoft stops producing service packs, a clean install is going to take longer and longer to bring it up-to-date with all patches installed. Is is worth wasting your time on an OS whose servicing mechanism Microsoft completely screwed up? I once again recommend you read more about the servicing stack and how it operates at The Servicing Guy's blog:http://blogs.technet.com/b/joscon/. To fix this messed up servicing stack, Microsoft also offers a tool called CheckSUR for your system if it finds “inconsistencies in the servicing store”.

    .

    Microsoft's Windows Vista and Windows 7 products are not engineered with disk space in mind. It causes a problem, especially for SSDs which are still low capacity and very expensive. The only hope is that Microsoft again completely redesigns this servicing mechanism in a future Windows release so it would not cause this growing disk space consumption issue, speed up installation of updates by an order of magnitude, not slow down logon and logoff, not prevent systems becoming unusable because of failed updates being stuck at a particular stage and allow true slipstreaming.
    Microsoft's response to this is vague - they simply state "Windows 7's servicing is more reliable than Windows XP" but they cannot acknowledge it is a million times slower and still unreliable...slow to the point of being unusable and sometimes leaving systems in an unbootable damaged state. Of course they know all this too but can't admit it since it makes their latest OSes look poor. Moving from a very simple and fast update mechanism that worked to a complex one that requires endless “configuring” and repair through CheckSUR is a product engineering defect.

    Take a look at servicing-related complaints in Microsoft's own forums:

    1. Very slow install of updates to Windows 7
    2. Windows 7 - Updates are very slow
    3. Windows 7 Ultimate, it takes long time configuring updates
    4. "Preparing To Configure Windows. Please Do Not Turn Off Your Computer"
    5. Very slow update install at shutdown (Windows 7 Home Premium)
    6. Why does my computer run so slow when installing updates?
    7. Every time the computer is shut down, it always says installing update do not turn off your computer
    8. Computer is working slow and wants to do windows updates all the time
    9. Windows 7 Update install time taking a very long time
    10. Windows wants to install 6 updates every time I log off or put the computer in sleep mode
    11. Problem In Configuring Windows Updates at the time of Startup
    12. Computer really slow after latest updates
    13. Windows hangs up in "configuring updates"
    14. Why can't windows 7 install updates?
    15. Every time computer is shut down, receive Installing updates, do not shut off....
    16. How long does it take for the Windows 7 Home Premium updates take?
    17. Windows 7 "Installing Update 2 of 2" for 12 hours now
    18. Updates causes endless reboots
    19. Updates stuck installing for over 24 hrs. Computer does not boot
    20. Cannot load Windows 7 after installing 2 critical updates

    A proper solution to this problem would be to completely re-engineer and rewrite the servicing mechanism so it operates with the speed, reliability and pain-free operation of the XP servicing mechanism.

    I don't see this situation improving in Windows 8 either. Good luck with your Windows tablet taking hours to install service packs and updates. Now, do iPads take that long to install updates?

    Microsoft understated the real system requirements to keep a Windows 7/Vista system running. System requirements at install time may be 15 GB of free disk space but over time, this number increases to alarming levels as you install more service packs and post SP-updates. You can find out the real size of the WinSxS folder using a tool like cttruesize (ctts.exe) (download it from http://www.heise.de/software/download/cttruesize/50272 and run ctts -la -a -l C:\Windows to find the correct size minus the hard links which MS says causes Explorer to misreport the WinSxS folder size but the fact remains that even with the correctly calculated size of WinSxS, the disk space requirements of Windows 7 to keep it updated are unacceptable, especially for people's SSDs which are running out of disk space!

    Sunday, March 25, 2012 12:28 PM
  • Fantastic write up of how it all works, i actually found it interesting to know how ti all works
    Sunday, June 09, 2013 1:48 AM
  • compcln.exe reduced 13GB winsxs to about 11GB.  Not much, but every bit helps when the entire drive is 40GB. (2008 Server)
    Wednesday, August 14, 2013 4:09 PM
  • This is just sheer rubbish again from Microsoft, "Now, an important thing to note is that the size of the WinSxS folder is not what Explorer or the dir command report, it is far less but is misreported by Explorer because it counts the hard links more than once when calculating size" JUST WHOSE PROGRAM IS THIS????

    Microsoft are incapable of producing a Windows Sever Operating system without these school boy errors,  besides which the above is absolute rubbish, the space is correctly reported and reserved accordingly!  am slightly concerned that Server Admins, actually install Windows Update\Service Packs on servers anyway, that is despite Microsoft trying to force the switch back to automatic with every update, we as a community have to start to take proper action via the courts to get these things addressed, in the UK we have the Sale of Goods Act 1980, (2003) etc, this covers the buyer from receiving sub standard goods, or goods that are not fit for purpose, but we need to do this on mass.

    Microsoft will refuse to help anyone if it does not involve them getting a 'nice earner' out of it, Lets play this through the court

    Monday, September 09, 2013 8:24 AM