Articles

On one of my SQL Servers I got a disk warning that only 4gb of space was free. I assessed it a bit more and I had only about 4gb of sql backup files residing on the disk. Where did the rest of the space go?

After searching on Google I found that it was probably the Windows Shadow Copy Storage that had taken the space. So I logged onto the server and ran cmd.exe as administrator (see below for instructions):

C:\Windows\system32>vssadmin list shadowstorage
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2012 Microsoft Corp.

Shadow Copy Storage association
For volume: (C:)\\?\Volume{ba212b61-a0d9-11e4-9406-806e6f6e6963}\
Shadow Copy Storage volume: (M:)\\?\Volume{8df97384-0efa-450e-a661-9f20390d5a08}\
Used Shadow Copy Storage space: 142 GB (94%)
Allocated Shadow Copy Storage space: 142 GB (94%)
Maximum Shadow Copy Storage space: UNBOUNDED (100%)

Ok - so now I know where my disk space was going. So in order to free up space I ran the following command:


C:\Windows\system32>vssadmin resize shadowstorage /on=M: /For=M: /MaxSize=50GB
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2012 Microsoft Corp.

Error: The specified volume shadow copy storage association was not found.

So - the error says that there isn't any volume shadow copy here? Well - if we look closer on the first output is says that for shadow copies of C: - these are stored on M: volume. So altering the resize shadow storage command made it successfull. I set 50GB as storage as MaxSize as this was convenient for me - you should adjust this to your own needs. 


C:\Windows\system32>vssadmin resize shadowstorage /on=M: /For=C: /MaxSize=50GB
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2012 Microsoft Corp.

Successfully resized the shadow copy storage association

This sets 50gb of shadow copy size to max 50gb on this volume. As it turned out I didn't use as much as I had expected on this system I can allow for 50GB until the windows admins can get a grip of why this is enabled in the first place.

How to run cmd.exe as administrator

On Windows Server 2012 - take the mouse to the bottom right corner and press the search sign. Under Apps - press cmd.exe. Mark cmd.exe and select "Run as administrator" in the bottom menu. There are numerous ways of running cmd.exe as administrator so this is just an example so you don't have to look any further.