The VSS (Volume Shadow Copy) SDK is available for download


This is the link:
http://www.microsoft.com/downloads/details.aspx?FamilyID=0B4F56E4-0CCC-4626-826A-ED2C4C95C871&displaylang=en


You can use this SDK to develop VSS requestors, writers and providers. For example, you can write code that define and use shadow copies on Windows XP and Server 2003. Note that this SDK contains only the headers/libraries for developing VSS applications, plus sample and test code. It does not contain the VSS documentation, which is already available on MSDN here.


After you download the SDK, I would suggest you to start start with the VSHADOW sample application. You can use this application to exercise most of the VSS infrastructure, like creating shadow copies, or assigning drive letters to them. VSHADOW also has the ability to import hardware shadows, or selecting VSS components for backup/restore.


VSHADOW is a console application. The set of VSHADOW command-line options depends on the operating system. Note also that there are two versions of VSHADOW, one compiled for XP and another one for server:

1) For Windows XP you can:
– create, delete, query non-persistent shadow copies
– enumerate writers and their components
– select components for backup/restore, notify writers.
– executing a backup/restore CMD script

2) For Windows Server 2003, all of the above plus:
– Assigning a drive letter, a mount point or a share name to a shadow copy.
– Creating persistent vs. non-persistent shadow copies
– Creating shadow copies without involving writers.
– Hardware shadow copies – creation, import, break, deletion. (only for Advanced Server or Datacenter SKUs)

Finally, VSHADOW allows you to use the VSS infrastructure for a fully automated backup/restore. In this SDK, you can find a set of sample CMD scripts that use VSHADOW to backup & restore of a SQL database.

Comments (7)

  1. Anonymous says:

    Hi,

    I wish to dismount the volume on which shadow copy is enabled.But i never get a handle to it because there is always an IO pending on the volume.

    Could you please tell me how to do that ?

    regards

    Subodh

    subodhonnet@yahoo.com

  2. Anonymous says:

    Programatically, you should use FSCTL_LOCK_VOLUME, FSCTL_DISMOUNT_VOLUME and then FSCTL_UNLOCK_VOLUME to perform a regular dismount. See the link below for more details:

    http://msdn.microsoft.com/library/en-us/fileio/base/fsctl_dismount_volume.asp

    If you want to perform a forced dismount (i.e. force dismount even if somebody else has a handle opened to the volume) then you should use only FSCTL_DISMOUNT_VOLUME since the lock will fail anyway.

    BTW, if you want only a dismount from the command line, then you can use the "FSUTIL VOLUME DISMOUNT C:" command.

  3. Anonymous says:

    Adi,

    My Problem is that i am trying to do this in Clustered Environment.When i dismount a volume (to imitate a fail) forcibaly,it becomes unusable during the failover (attching to a different machine).

    My volumes are on SCSI disks and VSS is enabled on them.Some how the data gets incosistent and the volume becomes unrecognizable.

    Any Pointers ??

    Regards

    Subodh

    subodhonnet@yahoo.com