DiskShadow examples

This post is a simple example of using DiskShadow provided for reference when using a VSS hardware provider. In this example, we assume that a single virtual disk is served to a host and contains data. The volume is given a drive letter F:

diskshadow is a tool that exposes the functionality offered by the Volume Shadow Copy Service (VSS). By default, DiskShadow uses an interactive command interpreter similar to that of DiskRAID or DiskPart. DiskShadow also includes a scriptable mode.

The commands in this example will create a non-transportable shadow copy that will be automatically imported to the originating host.

These commands are performed on the host from a command prompt with elevated privileges (Run as Administrator):

  1. For interactive mode, type the following at the command prompt to start the diskshadow command interpreter:
    C:\> diskshadow
  2. Set a persisent shadow copy that will remain after the diskshadow exit command and survives the server restart:
    DISKSHADOW> set context persistent nowriters
  3. Alias gives a name to the shadow ID:
    DISKSHADOW> add volume f: alias newsnap
  4. Create a snapshot virtual disk on the server and serves the virtual disk to the same host:
    DISKSHADOW> create
  5. Explose shadow ID to the OS and assign the specified drive letter Z:
    DISKSHADOW> expose %newsnap% z:
  6. Delete the shadow copy and unserves and deletes the snapshot on the server:
    DISKSHADOW> delete shadows all
  7. Clear all shadow ID aliases and reset diskshadow to default state:
    DISKSHADOW> reset
  8. Exit diskshadow prompt and return to command prompt:
    DISKSHADOW> exit