Where did all my hard drive space go?

May 7, 2011 by . 6 comments

This is the first part of a three part article, for parts two and three go to Part 2 and Part 3

 

A common problem with Windows is that no-one really knows how much space you need before you install it. Microsoft themselves recommend a minimum of 16GB of hard disk space before trying to install Windows, but that doesn’t take into account any of the growth when you install applications or any of the other things that go on “behind the scenes”

Some people dread the Unexpected free disk space disappearance

On my Windows 7 PC, the free disk space has gone down by 1GB even though I haven’t downloaded or installed any new files and I haven’t downloaded any updates or other things? What could have made the disk space go down for apparently no reason? Is this the result of some sort of a spy program that is undetectable?

The problem is that in Windows there are so many reasons as to why disk space suddenly disappears and when you are using an SSD where you are paying a premium for every last gigabyte it can be quite concerning. Some of the key culprits are the following items:

  • System Restore,
  • Page & Hibernation files,
  • Windows Update,
  • Recycle Bin
  • WinSxS
  • Program Installers, and last but by no means least
  • Programs themselves.

This is nowhere near an exhaustive list and by no means rules out a malware infection but these items tend to account for the sudden and rather annoying disappearance of several gigabytes of precious free space.

Due to the sheer quantity of things that can be taking up space I’m going to split this post into three posts, “System options you can change”, “System Options you should leave alone” and “Clearing up program data.”

We’ll begin with things you can change quite easily to clear out old and useless data.

System options you can change

System Restore

System Restore is a feature that not everyone knows about, is useful because it means you can effectively restore all the settings, drivers and programs in your system to how they were days, weeks or even months ago.

A side effect of this feature is that in Windows Vista and Windows 7, you get a feature called “Previous Versions.” This often overlooked feature can be an absolute lifesaver if you have spent the last month writing a long document only to discover that all of a sudden it has been replaced with garbage. If your computer has been creating restore points properly and regularly then chances are you may only loose a day or two of work, rather than the whole document. In order to use it all you need to do is right-click any file and then select “Restore previous versions” and it will list all versions that have been kept, you can even open and browse folders from particular dates to find an exact file.

The downside to these features is that they can make a horrifyingly large percentage of your hard drive disappear without you even installing or changing anything. Every time a new restore point is created it will start keeping copies of new changed files and eat up your hard drive space.

Generally it is limited to 10% of your hard drive space by default and you can wipe old restore points or even further restrict the amount of space it uses but less space means less restore points and thus less ability to restore files or return your system to a prior state.

The main problem with System restore is that the files it uses are in a protected system folder called “System Volume Information” and in general users are prevented from seeing how much space has been taken up.

If you want to know how much space System Restore is using on Windows 7 then, as an administrator, simply click the Windows Start menu icon, enter “SystemPropertiesProtection.exe” in the search box and press Enter. After that you can simply click a drive that is protected and click configure to find out how much space has been allocated to System Restore. It is from this page that you clear all your older restore points to get some of that space back as well.

Hibernation File

This is one fat file that, quite often these day, may never see any real use.

Typically this file will be the same size as your system memory, and on a now common 4GiB memory system that means a good 4GiB of potentially wasted space. On a spinning platter disk you may have enough space that this doesn’t matter, on an SSD you may be more constrained. On a not-uncommon-for-developers machine with 16GiB of memory then that’s quite a chunk of hard drive space lost.

The Hibernation file (hiberfil.sys) can simply be removed and hibernation disabled if you never put your computer into deep sleep. Personally my computer boots fast enough that hibernation is a waste. I use the Suspend-to-Ram feature normally and so (in an administrative console) I issued the following two commands:

  1. powercfg –h off
  2. del C:hiberfil.sys

Voila, a nice wodge of hard disk space retrieved.

Windows Update

Windows Updates are, rather unintuitively, downloaded to C:WindowsSoftwareDistribution. On my machine this folder is currently sitting at around 300MiB, but I’ve seen an archaic (yet well patched) Windows XP machine where this folder grew to over 2GiB, yowza!

This folder is a good candidate for destruction if it grows too large as Windows will self-heal and re-download everything it needs to carry on, but you do need to disable the Windows Update Service in order to be able to delete the folder.

As an administrator on the machine:

  1. Click the Windows Start menu icon, enter “Services” in the search box and press Enter.
  2. Navigate to the bottom of the list, right click the “Windows Update” (or “Automatic Updates” on Vista) and select “Stop”.
  3. Now you should be able to navigate to C:Windows and delete the SoftwareDistribution folder.
  4. Restart the Windows update service by right-clicking it again and selecting “Start.” The SoftwareDistribution folder will be recreated and Windows Update will do it’s thing.

This can also be a good way to repair Windows Update in the event that its database has become corrupt.

A set of folders that are related to Windows update are the dreaded $NtUninstall folders that littered the C:Windows directory, these seem to have gone the way of the Dodo in Windows 7, but if you see them in either Windows XP or Vista and you believe you system to be stable enough the you don’t need to roll back the latest updates or service packs then these directories are good deletion fodder.

The Recycle Bin

This is an oft overlooked way to free up space and potentiall one of the quickest and easiest to do on any system. A quick right-click on the Recycle Bin on your desktop then a click of the Empty Recycle Bin and several gigabytes of information you forgot you even deleted disappears in a cloud of smoke…

Well, not quite smoke, but it’s surprising how often I wonder about freeing up some space and forget about that folder. Remember to check that there’s nothing you were looking for before emptying it though, it is another little safety net and there’s always the horror story of people using it to store all their documents in…

In my next post I’ll go into some of the things which may save you some space, but have potential consequences besides an abundance of free space.

Filed under Filesystems

6 Comments

Subscribe to comments with RSS.

  • Paul Morriss says:

    One thing I find annoying is the way Chrome installs a copy per user (which is good if you’re a user and you don’t have admin rights). It also seems to keep a copy of the previous installation, which isn’t tiny.

  • arun says:

    is it good to turn on windows automatic update????wil it aquire any space?????

  • tony velez says:

    many thanks for the tips, it fixed the problems, thanks again !!

  • Foreever says:

    This is regarding the Hibernation file. In windows 7 ultimate,powercfg –h off may not work .It shows an error invalid parameters. You need to use powercfg /h off instead. Also, the second comment is not needed as the first command itself deletes the file.

  • I installed windows 7 many months ago on my laptop, and I don’t exactly remember, which method I followed for installation : whether clean Install or startup repair. I find memory shortage and when I searched for items to delete, I found a folder named “windows.old”, which is 44 GB fat. Can I delete this folder, if it is of no use for current windows ?

  • Comments have been closed for this post