Windows Server 2008: low disk space (SBS 2008 and SBS 2011)

Details

Created: 27 December 2011

The introduction of Windows Server 2008 brought a lot of remarkable changes compared to Windows Server 2000 / 2003; the most apparent one is its grown appetite for hard drive space. Out of the box Windows Server 2008 consumes a great amount on C-Drive. However it's only the beginning because a 2008 server often accumulates dozens of gigabytes on top of the post-installation size within one year. Low disk space issues and especially running out of spacle can lead to a wide variety of unpleasant consequences including crashing and database corruption.

It makes sense to deploy a small (free) utilty Folder Size which would help you identify what takes the most space on your C-Drive. At that point we can start recovering hard drive space. Even if you have a couple gigabytes available it could easily constitute a "low space problem". For instance an Exchange server would complain and refuse email traffic if it has less than 2GB available on C-drive due to its queue related data-paths (provided that Exchange databases are residing on a different partition). Having said that, we usually find a 10GB threshold to be a reasonable minimum criteria for free hard drive space.

Here we list potential remedies for disk space recovery. Of course, one shouldn't blindly implement any of the instructions below unless it's clearly understood what's being sacrificed or disabled! These recipes are merely a collection of useful actions that worked for us in the past; Allora does NOT guarantee that it'd work smoothly in your case and we take no responsibility for any undesired consequences (use at your own risk!)

Hibernation File

It's a bit unclear why a server would have a need to hibernate however this feature is turned ON by default and it's taking gigabytes of space (the actual number depends on the size of the physical memory). Luckily it's a trivial task to turn it off via Command Prompt:

Memory Swap File

Hopefully your system has plenty of physical memory and it hardly has to appeal to the Swap file. Although it's possible to disable it altogether we wouldn't recommend doing so by any means. What makes more sense is to transfer the Page file ( c:\pagefile.sys ) to another partition where your system has more space (d-drive, etc). In a nutshell you'd do it this way: right click "Computer" and choose Properties; then switch toAdvanced -> Performance / Settings -> Advanced / Virtual Memory -> Change. Disable the swap file on the C-Drive and create one on D. You can find detailed instructions with illustrations at this link.

Windows Error Reporting

We should disable this feature first (provided that you indeed do NOT wish to participate in Microsoft's Error reporting program that helps improving the quality of the software):

jump toAdministrative Tools, and then clicking Server Manager.

On the Server Manager home page, expand the Resources and Support area at the bottom.

Click Configure Windows Error Reporting and switch it off.

Now you can safely remove all report files that potentially got accumulated under: C:\programdata\microsoft\windows\wer\reportqueue

SharePoint Databases

Over time SharePoint Databases increase in size considerably. It's fairly easy to remedy this problem provided that you are running SQL Server Express and have Management Studio deployed. Here's a great article with simple step-by-step instructions:

If we deal with a plain Windows Server 2008 we'd consider an alternative path:

Moving content

One can find a utility named WsusUtil located under WSUS Tools folder(Program Files\Update Services\Tools). The command for moving the content has this syntax:wsusutil movecontentcontentpath logfileYou'd need to create the "contentpath" first. Once the utility is finished the old folder can be deleted. Full instruction set by Microsoft can be found atthis page.

Moving dataThis can be done using the SBS 2008 recipe referenced above. Alternatively we could use a command prompt approach spelled here

Component Store

C:\windows\WinSXS folder is essential to Windows 2008 operations (more on its purpose in this article) and we can only remove a relatively small redundant portion of its data. COMPCLN.EXE is a utiltiy that comes with SP1, SP2 and R2. Typically it'd reduce 1-2GB of WinSXS size by removing files necessary for de-installation of a Service Pack.

Old Log Files

There are various log files pertaining to Windows components such as IIS or Active Directory as well as 3-rd party applications. Before cleaning up any of the logs files it's wise to compress and backup them up for potential audit or troubleshooting purposes.

First we must introduce an invaluable tool that is extremely useful for routine clean-up tasks and other maintenance tasks: CCleaner by Piriform (download CCleaner). It allows cleaning up IIS log files under Advanced section. Temporary directories, Memory dump files are selected for removal automatically which might free up a considerable amount of disk space.

A collegue of ours recommended a short script borrowed from SBSfaq.com that we quote below:

@echo off

rem Script to clean up disk space on SBS 2008 servers

rem Downloaded from SBSfaq.com

rem V1.0 - March 28th, 2010

rem Certificate Services Logs

net stop "Active Directory Certificate Services"

del c:\windows\system32\certlog\*.log

del c:\windows\system32\certlog\*.chk

del c:\windows\system32\certlof\*.jrs

net start "Active Directory Certificate Services"

rem IIS Log Files

Del C:\inetpub\logs\LogFiles\*.log /f /s

It's best used as a "quick&dirty" express recovery from low disk space issues VS an automated routine task because you don't want to delete log files indiscreetly.

SBS Native Wizards

Windows SBS Console comes with several Data migration wizards under Server Storage section. We already dealt with one of these earlier in the WSUS chapter. In our approach running all of them became an intricate part of the initial SBS setup.

Of course it is assumed that you have at least two Volumes on your server (C-drive and D, E, etc) If not we'd humbly recommend a complete reinstall for a number of good reasons that nevertheless falls out of the scope of this article.If you'd rather outsource this taks and have an Allora technician working it out for you - please don't hesitate to contact us and schedule a service appointment.