Vssadmin and Volume Shadow Copies

This article is intended for Windows advanced users that would like to know more about the Vssadmin command-line tool. With vssadmin you can set and view Volume Shadow Copy parameters from a single location. In addition, the list options in vssadmin are a source of valuable info that is not available elsewhere in the Windows GUI. I have prepared a small application called Volume Shadow Copy that displays the basic stuff. Remember to run this utility with elevated administrator privileges.

Invoke the vssadmin command-line tool from an elevated command prompt. Vssadmin have the following options:

vssadmin list providers – lists registered volume shadow copy providers. Your system should have Microsoft Software Shadow Copy Provider 1.0:

Provider name: ‘Microsoft Software Shadow Copy provider 1.0′
   Provider type: System
   Provider Id: {b5946137-7b9f-4925-af80-51abd60b20d5}
   Version: 1.0.0.7

vssadmin list Shadows – lists existing volume shadow copies, the time the shadow copy was created and its location. The following sample shows two shadow copies that occurred on the 01/06/2010 for 3 volumes that are E:, C: and D:

Contents of shadow copy set ID: {ce7197b8-f525-4060-8d9e-2348881c0c0d}
   Contained 3 shadow copies at creation time: 01/06/2010 08:03:09
      Shadow Copy ID: {4652b00a-7601-4d23-adcb-5ab806e611d3}
         Original Volume: (E:)\\?\Volume{b689b3f6-5526-11df-9641-6cf049e44110}\
         Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy63
         Originating Machine: george
         Service Machine: george
         Provider: ‘Microsoft Software Shadow Copy provider 1.0′
         Type: ClientAccessibleWriters
         Attributes: Persistent, Client-accessible, No auto release, Differential, Auto recovered

      Shadow Copy ID: {c7ed0406-d157-4bf5-af3c-29223db987a5}
         Original Volume: (C:)\\?\Volume{52c07bc4-4e7e-11df-b3fe-806e6f6e6963}\
         Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy9
         Originating Machine: george
         Service Machine: george
         Provider: ‘Microsoft Software Shadow Copy provider 1.0′
         Type: ClientAccessibleWriters
         Attributes: Persistent, Client-accessible, No auto release, Differential, Auto recovered

      Shadow Copy ID: {bcc2b469-c8b3-4fd7-9dd3-6456d9527f2e}
         Original Volume: (D:)\\?\Volume{71f706bc-508f-11df-af8a-6cf049e44110}\
         Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy36
         Originating Machine: george
         Service Machine: george
         Provider: ‘Microsoft Software Shadow Copy provider 1.0′
         Type: ClientAccessibleWriters
         Attributes: Persistent, Client-accessible, No auto release, Differential, Auto recovered

vssadmin list shadowstorage – lists the volume shadow storage space in use, the allocated space while a shadow copy is active and the maximum space that can be used. The following sample shows the space used for 3 different volumes with percentages inside the brackets:

vssadmin 1.1 – Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2005 Microsoft Corp.

Shadow Copy Storage association
   For volume: (E:)\\?\Volume{b689b3f6-5526-11df-9641-6cf049e44110}\
   Shadow Copy Storage volume: (E:)\\?\Volume{b689b3f6-5526-11df-9641-6cf049e44110}\
   Used Shadow Copy Storage space: 3.243 GB (4%)
   Allocated Shadow Copy Storage space: 3.616 GB (4%)
   Maximum Shadow Copy Storage space: 7.812 GB (10%)

Shadow Copy Storage association
   For volume: (C:)\\?\Volume{52c07bc4-4e7e-11df-b3fe-806e6f6e6963}\
   Shadow Copy Storage volume: (C:)\\?\Volume{52c07bc4-4e7e-11df-b3fe-806e6f6e6963}\
   Used Shadow Copy Storage space: 7.577 GB (1%)
   Allocated Shadow Copy Storage space: 7.878 GB (1%)
   Maximum Shadow Copy Storage space: 8.863 GB (2%)

Shadow Copy Storage association
   For volume: (D:)\\?\Volume{71f706bc-508f-11df-af8a-6cf049e44110}\
   Shadow Copy Storage volume: (D:)\\?\Volume{71f706bc-508f-11df-af8a-6cf049e44110}\
   Used Shadow Copy Storage space: 11.883 GB (2%)
   Allocated Shadow Copy Storage space: 13.361 GB (2%)
   Maximum Shadow Copy Storage space: 48.828 GB (10%)

vssadmin list volumes – list available volumes that can have shadow copies:

vssadmin 1.1 – Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2005 Microsoft Corp.

Volume path: \\?\Volume{52c07bc3-4e7e-11df-b3fe-806e6f6e6963}\
    Volume name: \\?\Volume{52c07bc3-4e7e-11df-b3fe-806e6f6e6963}\
Volume path: E:\
    Volume name: \\?\Volume{b689b3f6-5526-11df-9641-6cf049e44110}\
Volume path: C:\
    Volume name: \\?\Volume{52c07bc4-4e7e-11df-b3fe-806e6f6e6963}\
Volume path: D:\
    Volume name: \\?\Volume{71f706bc-508f-11df-af8a-6cf049e44110}\

vssadmin list writers – lists shadow copy writers. Writers communicate with the Volume Shadow Copy service to ensure that files are consistent. The system has default writers such as, operating system, registry, task scheduler, etc…

vssadmin 1.1 – Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2005 Microsoft Corp.
Writer name: ‘Task Scheduler Writer’
   Writer Id: {d61d61c8-d73a-4eee-8cdd-f6f9786b7124}
   Writer Instance Id: {1bddd48e-5052-49db-9b07-b96f96727e6b}
   State: [1] Stable
   Last error: No error
Writer name: ‘Performance Counters Writer’
   Writer Id: {0bada1de-01a9-4625-8278-69e735f39dd2}
   Writer Instance Id: {f0086dda-9efc-47c5-8eb6-a944c3d09381}
   State: [1] Stable
   Last error: No error
Writer name: ‘System Writer’
   Writer Id: {e8132975-6f93-4464-a53e-1050253ae220}
   Writer Instance Id: {daec26db-5dcc-4116-8e5e-08d3da598a63}
   State: [1] Stable
   Last error: No error
Writer name: ‘Registry Writer’
   Writer Id: {afbab4a2-367d-4d15-a586-71dbb18f8485}
   Writer Instance Id: {c113607e-7bf6-46b9-8bf8-eecf5ca5bd4a}
   State: [1] Stable
   Last error: No error

vssadmin resize shadowstorage -  resizes volume shadow copy storage. That is, increase the maximum space used by the volume shadow copy. If the current used space is equal to the maximum then data backups may fail and you might need to increase this maximum size to resolve the problem -     Attention: Resizing the storage association may cause shadow copies to disappear. When certain shadow copies are deleted, the shadow copy storage space will reduce in size. If MaxSizeSpec is set to the value UNBOUNDED, the shadow copy storage space will be unlimited.

 The following command will increase the volume shadow copy storage capacity to 4% on the c: drive

vssadmin resize shadowstorage /for=c: /on=c: /maxsize=4%

vssadmin 1.1 – Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2005 Microsoft Corp.
Successfully resized the shadow copy storage association

vsssadmin  delete shadows – delete volume shadow copies. For the given ForVolumeSpec deletes all matching shadow copies. If /Oldest is given, the oldest shadow copy on the volume is deleted. If /All is given, then all shadow copies on all volumes that can be deleted will be deleted.  If /Shadow=ShadowId is given, the shadow copy with that Shadow Copy ID will be deleted.

The following command will delete the oldest shadow copy from volume c:  while prompt the user to confirm deletion:

vssadmin Delete Shadows /For=C: /Oldest

C:\Users\user>vssadmin Delete Shadows /For=C: /Oldest
vssadmin 1.1 – Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2005 Microsoft Corp.
Do you really want to delete 1 shadow copies (Y/N): [N]? y
Successfully deleted 1 shadow copies.

Running the Volume Shadow Copy application with administrative privileges:

Finally, I recommend you to Compress and Decompress your most popular archives with WinTar application!

Share