0

I have various Windows Servers (2012 R2), and I am running out of disk space. Can anyone give me suggestions what to delete? Which folder is lots of space and safe to delete?

Steffen Maier
  • 537
  • 4
  • 7
  • 3
    A question to ask yourself "Why are these drives being filled up?" Rather than fight the effect, figure out the cause. Run a windirstat and show us the results if possible, we can see if anything is out of the ordinary How big are the drives that Server2012R2 is installed on – colbyt Dec 13 '16 at 20:25
  • 1
    What roles have been installed on the Servers? If you have WSUS, for example, the content downloads can be huge. Have you changed any default logging or pagefile sizes? If the server has been in use for some time (particularly if you took it through upgrades of the OS - which aren't generally recommended), you may be looking at update uninstall content which can be cleaned up via DISM. – Matthew Wetmore Dec 14 '16 at 16:26

5 Answers5

5

As a simple, first step you can install the "Desktop Experience" package and run the Disk Cleanup utility. With this utility you can safely remove quite a bit of old stuff.

EDIT: the "Disk Cleanup" utility can be installed even without installing the entire "Desktop Experience", rather copying two specific files (as explained here).

shodanshok
  • 47,711
  • 7
  • 111
  • 180
  • Run that utility then hit "clean up system files", which can get rid of a lot of system guff. It misses a lot, you can go into appdata temp type directories and clean up a lot of things. You can also delete restore points. – Tim Dec 13 '16 at 21:18
  • Adding Desktop Experience will expose your server to more Windows Updates that can exacerbate both the diskspace issue as well as incurring more frequent updates. – Matthew Wetmore Dec 15 '16 at 06:10
  • Packages and updates added by "Desktop Experience" are few, so I doubt it will make a great differences in used space. Moreover, he can remove it after running the "Disk Cleanup" utility. Finally, this utility can be used even *without* installing "Desktop Experience", albeit you had to work with individual files. I've updated my answer to reflect this. – shodanshok Dec 15 '16 at 08:06
1

When cleaning up unneeded files on a Windows Server I use this checklist:

  • The obvious %Windir%\Temp, User temp folders, etc.
  • Remove unneeded user profiles
  • %Windir%\Logs, particularily %Windir%\Logs\CBS. The Windows Modules Installer service should maintain this folder automatically, compressing into CAB files old logs, etc. but sometimes this does not happen. I usually delete any .CAB files in this folder that are >1 month old
  • If IIS is installed %Systemdrive%\inetpub\logs\LogFiles
I say Reinstate Monica
  • 3,132
  • 7
  • 28
  • 52
1

You don't specify which roles are installed, which are the most common sources of bloat. The answers provided, including these additional, are generic for Server.

In addition to those previously mentioned, here are some lesser known items:

  • Check your pagefile sizes.
  • From an elevated command prompt, run:
    dism.exe /online /cleanup-image /analyzecomponentstore
    Based on the information in analyzecomponentstore, you have some options that are not easily undone. Please read the information carefully in dism.exe /online /cleanup-image /?

    • /startcomponentcleanup is non-destructive and is a good maintenance step.
    • /rebase is a flag that you can add to the component cleanup but is not reversible.
  • If you have configured your server as you expect and do not plan to add additional features via DISM or Server Manager later, you can use PowerShell's Remove-WindowsFeature -Remove with a list of features. It will work against features either currently installed or not, and will remove the installation files from the SxS file for those features. This step is technically reversible, but not easily. If you're a novice server administrator and/or without backups and a disaster recovery plan, I wouldn't recommend going there on an active system. These are steps better done when setting up a new server.

Matthew Wetmore
  • 1,633
  • 12
  • 21
0

Install data deduplication feature if you are not referring to you system drive. It will drastically free up space

0

I load "TreeSize" on all of my servers, there is a free version you can download from the JamSoft site. I run in periodically to get a visual perspective or where all my data sits and what's taking up most of the space.

Sometimes I find that a user did a full backup of his PC to his share folder or that the SoftwareDistribution folder needs to be emptied out. Other times its just too many restore points or temp files in a folder you didn't expect to look in.

Download it, give it a try, it should answer your question in about 60 seconds.

user72593
  • 423
  • 2
  • 6
  • 14