For those of you who have done shadowcopy based backups of servers, you know good and well that sometimes the mere space required for the VSS (Volume Shadowcopy Service) can make things pretty difficult when you come down to the wire on disk space. VSSAdmin is a great tool to see where your servers stand with the volumes used by the shadowcopy service, what shadows are available, and what’s in use. Here are the commands for VSSAdmin.
Remember: Use an elevated command prompt for all of the VSSAdmin commands.
Link to VSSAdmin Documentation: http://technet.microsoft.com/en-us/library/cc754968.aspx
|Vssadmin add shadowstorage||Adds a volume shadow copy storage association.|
|Vssadmin create shadow||Creates a new volume shadow copy.|
|Vssadmin delete shadows||Deletes volume shadow copies.|
|Vssadmin delete shadowstorage||Deletes volume shadow copy storage associations.|
|Vssadmin list providers||Lists registered volume shadow copy providers.|
|Vssadmin list shadows||Lists existing volume shadow copies.|
|Vssadmin list shadowstorage||Lists all shadow copy storage associations on the system.|
|Vssadmin list volumes||Lists volumes that are eligible for shadow copies.|
|Vssadmin list writers||Lists all subscribed volume shadow copy writers on the system.|
|Vssadmin resize shadowstorage||Resizes the maximum size for a shadow copy storage association.|
When VSSAdmin falls short
While VSSAdmin has commands which will allow you to delete shadows, deleting shadows will most likely need to be done from the application that created the shadow copy originally. VSSAdmin doesn’t like to step on toes. Examples can be Symantec Backup Exec, which has documentation on how to delete the Shadow Copies in their GUI when VSSAdmin tells you the shadow copy is in use. Other times, you’ll find errors like:
Error: Snapshots were found, but they were outside of your allowed context. Try removing them with the backup application which created them.
Again, VSSAdmin doesn’t want to step on toes and won’t let you bother snapshots (shadows) taken by other programs. But what if your application isn’t doing what its supposed to or you have orphaned shadow copies sitting out there. You need a tool to get rid of them. Enter, Diskshadow.
If VSSAdmin were the mobster responsible for keeping shadow copies at bay, Diskshadow would be the guy VSSAdmin calls to take care of the dirty work
There are a ton of great features Diskshadow offers. It’s a took, much like diskpart, that can be run with commands. It cares less about who is responsible for what and just manages the shadow copies and their volumes directly.
Here’s a link to Diskshadow: http://technet.microsoft.com/en-us/library/cc772172.aspx
|Set||Sets the context, options, verbose mode, and metadata file for creating shadow copies.|
|Simulate restore||Tests writer involvement in restore sessions on the computer without issuing PreRestore or PostRestore events to writers.|
|Load metadata||Loads a metadata .cab file prior to importing a transportable shadow copy or loads the writer metadata in the case of a restore.|
|Writer||Verifies that a writer or component is included or excludes a writer or component from the backup or restore procedure.|
|Add||Adds volumes to the set of volumes that are to be shadow copied, or adds aliases to the alias environment.|
|Create||Starts the shadow copy creation process, using the current context and option settings.|
|Exec||Executes a file on the local computer.|
|Begin backup||Starts a full backup session.|
|End backup||Ends a full backup session and issues a BackupComplete event with the appropriate writer state, if needed.|
|Begin restore||Starts a restore session and issues a PreRestore event to involved writers.|
|End restore||Ends a restore session and issues a PostRestore event to involved writers.|
|Reset||Resets DiskShadow to the default state.|
|List||Lists writers, shadow copies, or currently registered shadow copy providers that are on the system.|
|Delete shadows||Deletes shadow copies.|
|Import||Imports a transportable shadow copy from a loaded metadata file into the system.|
|Mask||Removes hardware shadow copies that were imported by using the import command.|
|Expose||Exposes a persistent shadow copy as a drive letter, share, or mount point.|
|Unexpose||Unexposes a shadow copy that was exposed by using the expose command.|
|Break||Disassociates a shadow copy volume from VSS.|
|Revert||Reverts a volume back to a specified shadow copy.|
To delete all shadow copies using disk shadow:
Run the following:
delete shadows all
That will remove all of the shadow copies. If you’d like to delete specified copies, you can list them first, then put their ID where “all” is.
I hope this helps some of you.