Tuesday, February 2, 2010

Disk Space Cleanup in Windows Server 2008

I've recently began setting up and working with Windows Server 2008 based (not R2) systems. After the initial install and full round of patches I was a bit surprised at the amount of consumed disk space. It turns out the c:\Windows\winsxs folder was over 10GB in (apparent) size! Gone are the days of being able to go into c:\Windows folder and deleting the $Uninstall folders to get that space back - assuming you didn't want to uninstall any of those patches. I'd like to point out that this folder should not be tinkered with haphazardly. Many of the items in it are hard links out to many critical OS files and rampantly deleting them will make you sad.

I ran across this article explaining the winsxs folder's purpose and subequently its size. It boils down to all the different installed / installable components(aka the good old i386 folder) of the OS are kept there along with patch backups. The arguments are for reliability and availability for things like removing patches, or adding features and roles without need the OS media.

A bit of searching turned up the built in Windows Component Cleanup (compcln.exe) tool which will do some patch cleanup for you. I got back around 1.7GB which was nice but still not enough for my liking. The next bit I turned up was this article by John Daskalakis explaining howto manually delete some of the larger sub-folders. Following that article I was able to reclaim another ~800MB.

Another folder that deserves attention, and is consistent with Window XP and Server 2003, is the C:\Windows\SoftwareDistribution\Download folder. If you have applied all available updates, this can be safely deleted by:
1) Stopping the Windows Update Service
2) Deleting the folder
3) Starting the Windows Update Service.
I reclaimed about 1.2GB from this.

All said and done almost 4GB of space reclaimed and no issues with the system. I still wasn't very comfortable with the overall amount of free space on the system drive so I had so I added 10GB and extended the volume to a total of 40GB (gotta love virtualization).

Stumble Upon Toolbar


litbea said...

thanks, man!

yassour said...

Thanks a lot,this was easy and very use full.