How to Clean up the WinSxS Directory and Free Up Disk Space on Windows Server 2008 R2 with New Update


  1. Get KB2852386 for Windows 2008R2 and Windows 7 from below locations: http://www.catalog.update.microsoft.com/Search.aspx?q=2852386 https://www.microsoft.com/en-us/download/details.aspx?id=42739
  2. Server needs to be rebooted after this update installed.
  3. Install Desktop Experience feature. When installing Desktop Experience, it does require additional features. Select the button to Add Required Features and click Next and then Install.
  4. A reboot is required to finalize the install.
  5. Run cleanmgr.exe. Several options are provided for cleanup, including a new option for Windows Update Cleanup.
  6. Just like the Windows 7 cleanup, mileage will vary. Also like Windows 7, the actual cleanup occurs during the next reboot. After the reboot, taking a look at the WinSxS directory, it has shrunk.

Other options:
If you have applied SP1 and have not cleaned up afterwards, I’d highly recommend doing so by running the following command from an administrative command prompt:
dism /online /cleanup-image /spsuperseded
Specifying the /spsuperceded switch or choosing to remove service pack backup files will remove the ability to uninstall the service pack. If you haven't done it before, it is certain to free up some space.

The command to accurately determine the size of the component store on Windows Server 2012 R2 is as follows:
Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore

Running this command analyzes the component store to determine the size and whether cleanup is recommended.

Back to our cleanup.

In the above screen shot, it’s stated that component store cleanup is recommended. We can manually cleanup the component store on Windows Server 2012 R2 by running the following command:

Dism.exe /online /Cleanup-Image /StartComponentCleanup

When this runs, Windows cleans up the previous versions of the component that was updated. In other words, it is doing exactly what our update does for Windows Server 2008 R2 SP1. It removes previous versions of the files updated by Windows Updates.

If you’re in all out spring cleaning mode and want to perform super deep cleanup, you can use the /resetbase command with the /startcomponentcleanup to remove all superseded versions of every component in the component store:

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

This removes the ability to uninstall any updates applied until this point in time.

And don’t forget the ability to completely remove any role or feature which also reduces the size. Take a look at one of my earlier blogs for more details on Features on Demand:  http://blogs.technet.com/b/askpfeplat/archive/2013/02/24/how-to-reduce-the-size-of-the-winsxs-directory-and-free-up-disk-space-on-windows-server-2012-using-features-on-demand.aspx .
Ref: https://blogs.technet.microsoft.com/askpfeplat/2014/05/13/how-to-clean-up-the-winsxs-directory-and-free-up-disk-space-on-windows-server-2008-r2-with-new-update/

Comments

Popular posts from this blog

vRA/vRO workflows

How to generate HPS Report for Windows