Thursday, September 25, 2014

Destroy all VSS Snapshots

OK, so we all know about VSSAdmin for configuring VSS, but did you know about 'DiskShadow'?

http://technet.microsoft.com/en-us/library/cc772172.aspx

You can use this to perform an emergency delete of all snapshots on a given platform. Consider the following output of VSSAdmin (I have truncated it)

C:\Users\putleym>vssadmin list shadows
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2005 Microsoft Corp.

Contents of shadow copy set ID: {fcd10773-6df9-48e1-abf9-08915b767e47}
   Contained 1 shadow copies at creation time: 1/11/2014 6:09:35 AM
      Shadow Copy ID: {ef15ddef-5deb-4cb4-b8bb-d589eda5e494}
         Original Volume: (O:)\\?\Volume{94695b4d-ea8e-11e1-87dc-001cc4dd04da}\
         Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy2
         Originating Machine: FSH02.DOMAIN.ORG
         Service Machine: FSH02.DOMAIN.ORG
         Provider: 'Microsoft Software Shadow Copy provider 1.0'
         Type: DataVolumeRollback
         Attributes: Persistent, No auto release, No writers, Differential

Contents of shadow copy set ID: {b445352f-252b-4b20-965e-4685fa6038c7}
   Contained 1 shadow copies at creation time: 1/12/2014 6:03:09 AM
      Shadow Copy ID: {adea4e22-05a3-485c-9075-df20b4cbf11b}
         Original Volume: (O:)\\?\Volume{94695b4d-ea8e-11e1-87dc-001cc4dd04da}\
         Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy3
         Originating Machine: FSH02.DOMAIN.ORG
         Service Machine: FSH02.DOMAIN.ORG
         Provider: 'Microsoft Software Shadow Copy provider 1.0'
         Type: DataVolumeRollback
         Attributes: Persistent, No auto release, No writers, Differential

You can see there are two snapshots, if we run DiskShadow we will be given a DiskShadow prompt and we can execute Delete Shadows All. Here is the screen output (I have truncated it)

DISKSHADOW> delete shadows all
Deleting shadow copy {9fe1172d-6158-455e-ba11-5ea5065b94bc} on volume \\?\Volume
{94695b4d-ea8e-11e1-87dc-001cc4dd04da}\ from provider {b5946137-7b9f-4925-af80-5
1abd60b20d5} [Attributes: 0x00020019]...
Deleting shadow copy {ef15ddef-5deb-4cb4-b8bb-d589eda5e494} on volume \\?\Volume
{94695b4d-ea8e-11e1-87dc-001cc4dd04da}\ from provider {b5946137-7b9f-4925-af80-5
1abd60b20d5} [Attributes: 0x00020019]...
Deleting shadow copy {adea4e22-05a3-485c-9075-df20b4cbf11b} on volume \\?\Volume
{94695b4d-ea8e-11e1-87dc-001cc4dd04da}\ from provider {b5946137-7b9f-4925-af80-5
1abd60b20d5} [Attributes: 0x00020019]...

Number of shadow copies deleted: 2

Cheers!

No comments:

Post a Comment