I have a c:\ on a server that is filling up, most likely due to the accumulation of patches over the years.
I'm told by Microsoft PSS Support that it is unwise to simply delete the compressed uninstall directories within the \Windows directories. Considering that we have 100's of windows servers, this scattering of patches is consuming at significant amount of space on our SAN (these windows servers are in VMWare).
Can you tell me what I can do, besides the list below, to clean up space on the C:\ drive? I'm hoping that you may have more insight than the recommendation I received.
Don’t set your Virtual Memory pagefile.sys on C drive.(System Properties\Performance settings\Advanced\change Virtual memory)
Clear temp files (C:\windows\temp and C:\Users\%Username%\AppData\Local\Temp).
Don’t set your temporary Internet files on C drive.(Internet Options\Browsing history settings\move folder)
Move the Windows Search Service Database. If you have started Microsoft Search services, please move Windows.edb file to another drive.
( C:\ProgramData\Microsoft\Search\Data\Applications\Windows )
Compress folders to save disk space and use disk cleanup
Use mount point to mount an additional drive.
“Compln.exe” can only be used to clean Service Pack, such as (RTM and SP1). In your system Windows server 2008 r2, it don’t contain any service pack. It cannot clean the patches in your system.
???? (not sure what this idea is) "Microsoft provide the built-in tool – disk cleanup .(You need to install a feature called "Desktop Experience" to get Disk Cleanup.) "
What other things can be done to clean up your server and free up space?
Lastly, it would be nice to get an idea of what drive size you use for c:\ for whatever version of Windows you use.
I've used 'junction' by sysinternals to redirect folders like the software distribution directory, or windows search. You can also use the built in mklink command, but junction works on older versions of windows and can be standardized against in automated deployment scripts.
It works wonders for getting a server install running off of a space restricted EEEpc.
For more information on mklink: directory junction vs directory symbolic link?
For a step by step guide regarding specifically the patches directory, try this blog. Entry is appended below with some formatting modifications:
(You may optionally copy the .old directory's contents into the new location).
In the interest of preserving the information in case the TechNet article moves, here is how to "activate" the Microsoft disk cleanup utility on server 2008 or 2008 R2:
Server 2003: We use 15GB C: drives for these now. We used to use 10GB ones, but the patch-dirs ate us out of house and home. We're not spinning up many of these any more, but if we do, 15GB is it.
Server 2008 & 2008R2: Microsoft itself is saying that 30GB is the number you should be aiming at. Seeing as how they made the patch-dirs nigh undeleteable with these server versions, I'm not going to doubt them. Currently we make our C: drives 20GB, but that's because we made our VM templates before this guidance emerged. We need to change it. 40 is probably better once you factor in 3rd party installers that resolutely stash things on C: no matter what you tell them.
IIS logs and Windows Error Reports.
Find a program like SpaceMonger to find the space hogs.
If it's 2008 R2, you can attempt to run
dism /online /cleanup-image /spsuperseded
. That will get back some space if you've installed SP1 since the initial install. If it was slipstreamed, I doubt you'll get any space back, however.A little less known but worth mentioning: Windows Update stores the updates it downloads in
C:\Windows\SoftwareDistribution\Download
; and they are not deleted after having been installed, thus the folder can grow to be quite large over time.After new updates are installed, you can safely empty that folder and reclaim some disk space.
There are two more clean up commands that help reducing system, of course after running them such updates will not be able to be uninstalled.
For Service Packs:
dism /Online /Cleanup-Image /SPSuperseded /HideSP
For Windows UpDates:
dism /Online /Cleanup-Image /StartComponentCleanup /ResetBase
Both can take a lot of time to run.
Just some advice:
That commands do a big clean up on Service Packs and on WinSXS folder respectively. They only delete/remove files not needed anymore (assuming you will not want to uninstall Service Packs/Updates that are already installed).
Please note that they do not block future Services Packs / updates from being uninstalled.
The main idea of them is: They remove what is needed to uninstall the updates that are installed and old system files versions that are not in use anymore.
Just check the Microsoft website description to know more.
To automate this process you can find PowerShell script on link below.
How to Clean up the WinSxS Directory and Free Up Disk Space
Also, on link above you will find steps for
disk cleanup(cleanmgr.exe)
how to:1) install
2) run
3) use