Link to home
Start Free TrialLog in
Avatar of LesterClayton
LesterClaytonFlag for Norway

asked on

Unable to delete Volume Shadow Copies

I have a Shadow Copy which has been created by a backup, but it wasn't deleted.  The volume is shown as follows:

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

Contents of shadow copy set ID: {88ac6df1-6ef9-464b-9586-afe02ba5a84b}
   Contained 2 shadow copies at creation time: 20.08.2015 19:35:32
      Shadow Copy ID: {1343a989-cc26-4d6c-bebf-a1ad15bddd5f}
         Original Volume: (?)\\?\GLOBALROOT\Device\HarddiskVolume170\
         Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy2480
         Originating Machine: mgmt44.mgmt.local
         Service Machine: mgmt44.mgmt.local
         Provider: 'Microsoft Software Shadow Copy provider 1.0'
         Type: ClientAccessible
         Attributes: Persistent, Client-accessible, No auto release, No writers, Differential

When I try to delete the shadows, using the command "vssadmin delete shadows /all", I get the following error:

C:\Users\lclayton>vssadmin delete shadows /all
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2013 Microsoft Corp.

Do you really want to delete 1 shadow copies (Y/N): [N]? y

Error: Either the specified volume was not found or it is not a local volume.

I get the same error when specifying the Shadow Copy ID, like this:

C:\Users\lclayton>vssadmin delete shadows /shadow={1343a989-cc26-4d6c-bebf-a1ad15bddd5f}
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2013 Microsoft Corp.

Do you really want to delete 1 shadow copies (Y/N): [N]? y

Error: Either the specified volume was not found or it is not a local volume.

I have done a "vssadmin list writers" and every writer in the system is State: [1] Stable and Last error shows as "No Error"

How can I go about deleting these shadow copies?
Avatar of Cliff Galiher
Cliff Galiher
Flag of United States of America image

VSS keeps a lost of shadow copies if has created. Shadow copies can be in the list, but stored on volumes not actually currently attached to the machine. If a copy was made onto a USB disk, for example. So the list command will show that VSS is aware the shadow copy exists, but delete will fail because the volume is bot present. That is the error you are seeing.
Avatar of LesterClayton

ASKER

While your response seems quite logical, and pretty much similar to what other Google searches return, it's not something I can accept.

I have another server which has got a snapshot listed from yesterday, which I am unable to delete.

Contents of shadow copy set ID: {77d37092-106a-4017-87d1-2193ea12fedc}
   Contained 3 shadow copies at creation time: 27.08.2015 18:57:01
      Shadow Copy ID: {74bf0a10-e310-49af-b1bb-ac0c99de1da8}
         Original Volume: (?)\\?\GLOBALROOT\Device\HarddiskVolume272\
         Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy4332
         Originating Machine: mgmt41.mgmt.local
         Service Machine: mgmt41.mgmt.local
         Provider: 'Microsoft Software Shadow Copy provider 1.0'
         Type: ClientAccessible
         Attributes: Persistent, Client-accessible, No auto release, No writers,
 Differential

      Shadow Copy ID: {a1aee319-002a-4428-ad1c-f3ea6e3d479f}
         Original Volume: (?)\\?\GLOBALROOT\Device\HarddiskVolume274\
         Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy4333
         Originating Machine: mgmt41.mgmt.local
         Service Machine: mgmt41.mgmt.local
         Provider: 'Microsoft Software Shadow Copy provider 1.0'
         Type: ClientAccessible
         Attributes: Persistent, Client-accessible, No auto release, No writers,
 Differential


C:\Users\lclayton>vssadmin delete shadows /all
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2013 Microsoft Corp.

Do you really want to delete 2 shadow copies (Y/N): [N]? y

Error: Either the specified volume was not found or it is not a local volume.

This snapshot is not even 24 hours old.

These servers are running Hyper-V and a ton of virtual machines - they're inside a datacenter, and they do not get USB disks plugged into them.  They have regular volumes and Cluster Shared Volumes, but they remain pretty static throughout.  No volumes have been added or removed in the last 24 hours, yet the command to delete the snapshot fails.
Additional information: I've found an error!

I've seen an Event in my Applicaiton log - Event ID 12289 logged 27.08.2015 18:57:01 (same time as the last shadow copy I posted)

Volume Shadow Copy Service error: Unexpected error DeviceIoControl(\\?\GLOBALROOT\Device\Harddisk10\ClusterPartition2 - 0000000000000258,0x0053c014,000000B0E943B960,0,000000B0E943A950,4096,[0]).  hr = 0x80070057, The parameter is incorrect.
.

Operation:
   Processing PostCommitSnapshots

Context:
   Execution Context: System Provider

OK, at least we know why the volume shadow is not actually there - since its creation failed - and would also explain why we cannot remove it.  But how do we get it removed from the volume shadow list?  Restarting the Volume Shadow Copy service is not a solution since the service only runs when it is needed - right now it's not running.
You don't.
For anybody else who's going to attempt suggestions, let it be known that I have also attempted to use diskshadow to purge these orphaned disk shadows from the system.

DISKSHADOW> list shadows all

Querying all shadow copies on the computer ...

        * Shadow copy ID = {1343a989-cc26-4d6c-bebf-a1ad15bddd5f}               <No Alias>
                - Shadow copy set: {88ac6df1-6ef9-464b-9586-afe02ba5a84b}       <No Alias>
                - Original count of shadow copies = 2
                - Original volume name: \\?\GLOBALROOT\Device\HarddiskVolume170\ [volume not on this machine]
                - Creation time: 20.08.2015 19:35:32
                - Shadow copy device name: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy2480
                - Originating machine: mgmt44.mgmt.local
                - Service machine: mgmt44.mgmt.local
                - Not exposed
                - Provider ID: {b5946137-7b9f-4925-af80-51abd60b20d5}
                - Attributes:  No_Auto_Release Persistent Client_accessible No_Writers Differential

Number of shadow copies listed: 1

DISKSHADOW> delete shadows all
Deleting shadow copy {1343a989-cc26-4d6c-bebf-a1ad15bddd5f} on volume \\?\GLOBALROOT\Device\HarddiskVolume170\ from provider {b5946137-7b9f-4925-af80-51abd60b20d5} [Attributes: 0x0
002001d]...
Shadow copy not found.

Number of shadow copies deleted: 0

And I've also tried WMI:

C:\Users\lclayton>wmic
wmic:root\cli>shadowcopy
Caption  ClientAccessible  Count  Description  DeviceObject                                        Differential  ExposedLocally  ExposedName  ExposedPath  ExposedRemotely  HardwareAssisted  ID                                      Imported  InstallDate                Name  NoAutoRelease  NotSurfaced  NoWriters  OriginatingMachine  Persistent  Plex   ProviderID                              ServiceMachine     SetID                                   State  Status  Transportable  VolumeName
         TRUE              2                   \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy2480  TRUE          FALSE                                     FALSE            FALSE             {1343A989-CC26-4D6C-BEBF-A1AD15BDDD5F}  FALSE     20150820193532.637194+120        TRUE           FALSE        TRUE       mgmt44.mgmt.local   TRUE        FALSE  {B5946137-7B9F-4925-AF80-51ABD60B20D5}  mgmt44.mgmt.local  {88AC6DF1-6EF9-464B-9586-AFE02BA5A84B}  12             FALSE          \\?\GLOBALROOT\Device\HarddiskVolume170\

wmic:root\cli>shadowcopy delete
Delete '\\MGMT44\ROOT\CIMV2:Win32_ShadowCopy.ID="{1343A989-CC26-4D6C-BEBF-A1AD15BDDD5F}"' (Y/N/?)? Y
Deleting instance \\MGMT44\ROOT\CIMV2:Win32_ShadowCopy.ID="{1343A989-CC26-4D6C-BEBF-A1AD15BDDD5F}"
ERROR:
Description = Not found
As I said, you don't. The list is simply an audit trail and is not meant to be deleted.
https://technet.microsoft.com/en-us/library/cc788116.aspx

Vssadmin list shadows

"Lists all existing shadow copies of a specified volume. If you use this command without parameters, it displays all volume shadow copies on the computer, in the order dictated by Shadow Copy Set."

What you claim is contrary to what is documented at Technet.  Please cite your sources.
ASKER CERTIFIED SOLUTION
Avatar of LesterClayton
LesterClayton
Flag of Norway image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
While there has been some feedback from members of the community, no useful suggestions were made to aid me in resolving the matter.  From all the Googling I have done, it seems that the issue I've encountered is a rare situation and could even be a bug, but I did not have the time nor energy to log a ticket with Microsoft.