Thursday, January 3, 2013

Phantom space used in Windows 7, Windows Server 2008, Windows Server 2008 R2, and Windows Vista

A common issue that has baffled a lot of administrators is where a large amount of disk space is showed as in use, but they can’t find the files that are using it. For example, ff you go to the root of the C: drive, select all of the files, right-click, and click properties. The amount of space shown as used on that properties window isn’t nearly what it should be if you deduct it from the size of the drive and compare your results to the free space that Windows explorer, or my computer shows.

There are a couple things that most often contribute to this. The first is a bloated, oversized $TOPS file. You can set your system to specify that the Transaction Resource Manager will clean the transactional metadata on the next mount, or reboot.

To do this, start and elevated or administrative command prompt and run the following command
fsutil resource setautoreset true c:\

The second thing is shadow copies, which can use up a lot of disk space. This option can be used on Windows XP and Windows Server 2003/2003 R2 as well. To see how much space is being used by shadow copies, you can run the following command from an elevated command prompt
vssadmin list shadowstorage
For each volume that has shadow copies enabled, it will display the:
1.       Used Shadow Copy Storage space
2.       Allocated Shadow Copy Storage space
3.       Maximum Shadow Copy Storage space
You can delete the shadow copies using the “vssadmin delete shadows /all” command from the command prompt, but they will probably accumulate rather quickly if you don’t set a new max limit on the shadow copy storage.  There are a few parts to this command. The /For flag specifies the drive that’s using the shadow storage. The /On flag specifies the drive where the shadow storage exists. Finally, the /MaxSize flag specifies the new limit for shadow copy storage, which can be specified in KB, MB, GB, TB, PB, EB or a percentage. Below are a couple examples.
vssadmin Resize ShadowStorage /For=C: /On=D: /MaxSize=2GB
vssadmin Resize ShadowStorage /For=C: /On=C: /MaxSize=10%