News

Windows Sysvol getting too big

It's not uncommon to find that C$ is getting low on space after a few years and often this is due to a mixture of junk files but also Sysvol. Sysvol keeps all sorts of stuff in it, much essential to the well being of the server, but it can also hide large files that are no longer needed, such as old Shadowcopies.

We recently had to provide first aid to an Exchange box which was loosing about 7GB per day, which turned out to be Shadowcopies.

The first thing to do is check this theory out by running vssadmin in an elevated shell.

 PS C:Windowssystem32> 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: (\?Volume{ec03102b-c165-11e6-93e7-806e6f6e6963})\?Volume{ec03102b-c165-11e6-93e7-806e6f6e6963}
   Shadow Copy Storage volume: (\?Volume{ec03102b-c165-11e6-93e7-806e6f6e6963})\?Volume{ec03102b-c165-11e6-93e7-806
e6f6e6963}
   Used Shadow Copy Storage space: 3.05 MB (0%)
   Allocated Shadow Copy Storage space: 34.8 MB (9%)
   Maximum Shadow Copy Storage space: 35.0 MB (10%)

Shadow Copy Storage association
   For volume: (C:)\?Volume{ec03102c-c165-11e6-93e7-806e6f6e6963}
   Shadow Copy Storage volume: (C:)\?Volume{ec03102c-c165-11e6-93e7-806e6f6e6963}
   Used Shadow Copy Storage space: 76.2 GB (6%)
   Allocated Shadow Copy Storage space: 77.6 GB (6%)
   Maximum Shadow Copy Storage space: 80.0 GB (6%)

So that's 77.6GB used with 80GB being the maximum allowed space. Perhaps unnecessarily large. Let's reduce it to 20GB

PS C:Windowssystem32> vssadmin resize shadowstorage /on=c: /for=c: /maxsize=20GB
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2012 Microsoft Corp.

Successfully resized the shadow copy storage association

and we can check it's worked...

Shadow Copy Storage association
   For volume: (C:)\?Volume{ec03102c-c165-11e6-93e7-806e6f6e6963}
   Shadow Copy Storage volume: (C:)\?Volume{ec03102c-c165-11e6-93e7-806e6f6e6963}
   Used Shadow Copy Storage space: 18.1 GB (1%)
   Allocated Shadow Copy Storage space: 19.5 GB (1%)
   Maximum Shadow Copy Storage space: 20.0 GB (1%)

If we wanted to delete old Shadowcopies by hand, we could use this:

PS C:Windowssystem32> DiskShadow
Microsoft DiskShadow version 1.0
Copyright (C) 2012 Microsoft Corporation
On computer:  MSI-MSX2010,  03/03/2023 16:10:26

DISKSHADOW> Delete shadows OLDEST c:
Deleting shadow copy {cb5bcff8-a1dd-4120-bc55-814034177f7d} on volume \?Volume{ec03102c-c165-11e6-93e7-806e6f6e6963}
from provider {b5946137-7b9f-4925-af80-51abd60b20d5} [Attributes: 0x0002001d]...

1 shadow copy deleted.


But having reduced the allocated space older copies will be auto deleted in less than 60 minutes.

 

 

 

 

 

 

<< Go back to the previous page