I got a call from a colleague who was asking why the Windows directory on a Windows Server 2008 R2 machine was taking up almost 40GB of disk space. I checked one of my servers and noticed almost the same – about 30GB on mine. He noticed more readily than I did because his Windows install was on a partitioned drive where the C volume was only 60GB. I, however, do not practice partitioning drives. If I want more volumes, I get more drives.
After some research, we noticed that the WinSXS fold was the culprit. He was about to delete the folder when I asked him to stop. I found it hard to believe this folder was so large just for the fun of it so I did some research. I found many blogs and so forth that “tried” to explain the WinSXS folder, but most failed horribly. As always, if you want the low down you have to go to the source. I found this post on the Microsoft Ask The Core Team blog that did a fantastic job of explaining the WinSXS folder. I highly recommend giving this post a full read. You should also subscribe to the Ask The Core Team blog.
There are some things you can do to combat this problem. I recommend the following:
- Do not partition out a single drive into multiple partitions. If you want your OS on one volume and your data on another volume, then get multiple drives and place one set of drives in one volume for the OS and the rest of the drives in a volume for data. For example, you could do a RAID 1 for the OS and a RAID 5 for data. This way, you’ll always have plenty of room for the OS. Partitioning one drive into multiple volumes, in my opinion, makes little sense any more.
- Install only those applications you need on the computer. The more applications you install, the more your C drive will fill up. The same is true for Windows features. Install only those you need.
- Run the disk cleanup wizard.
- You can free up some space by removing the roll back files for the last service pack you installed.
That last point bears some discussion. When you install a service pack for Windows, you can always uninstall it. This is made possible by the fact that Windows stores copies of the original files replaced by the service pack in the WinSXS folder. If you have been running the service pack for a while and are very confident you will never need to uninstall it, you can remove the backup files which will make the service pack permanent (you can’t remove it). On one of my systems, this freed up 10GB of disk space.
For Windows Server 2008 and Windows Vista after installing Service Pack 1:
Open a command prompt and run the command VSP1CLN.EXE. This file is found in the %windir%\system32\ directory.
For Windows Server 2008 and Windows Vista after installing Service Pack 2:
Open a command prompt and run the command COMPCLN.EXE. This file is found in the %windir%\system32\ directory.
For Windows Server 2008 R2 and Windows 7 after installing Service Pack 1:
Open a command prompt and run the command DSIM.exe /online /Cleanup-Image /spsuperseded
Again, be reminded that should you run any of the commands above, the service pack will become permanent. You will not be able to uninstall it. However, you will free up some pretty significant disk space. Be certain to test on a test machine before running this on a production computer.