Volume Shadow Copy Service. By default, DiskShadow uses an interactive command interpreter similar to that of DiskRAID or DiskPart. DiskShadow also includes a scriptable mode.
Syntax Start interactive mode: diskshadow Execute a script: diskshadow -s script.txt Commands to run interactively or through a script file: add add volume Volume [provider ProviderID] add alias AliasName AliasValue begin backup begin restore break break [writable] SetID create delete shadows [all | volume Volume | oldest Volume | set SetID | id ShadowID | exposed {Drive | MountPoint}] end backup end restore exec ScriptFile.cmd exit expose{Drive: | Share | MountPoint} import list list writers [metadata | detailed | status] list shadows {all | set SetID | id ShadowID} list providers load metadata load metadata [Drive:][Path]MetaData.cab mask ShadowSetID reset revert revert ShadowCopyID set set context {clientaccessible | persistent [nowriters] | volatile [nowriters]} set option {[differential | plex] [transportable] [ [rollbackrecover] [txfrecover] | [noautorecover] ]} set verbose {on|off} set metadata MetaData.cab simulate restore unexpose {ShadowID | Drive: | Share | MountPoint} writer verify [Writer | Component] writer exclude [Writer | Component] Key See hover text above.
DiskShadow.exe replaces vshadow in Windows Server 2008 onwards (vshadow is still available for backwards compatibility). DiskShadow is not supported on Windows Server 2003 or Vista.
A shadow copy allows you to take manual or automatic backup copies or snapshots of data at a specific point in time over regular intervals. Using a shadow copy avoids problems with file locking, by creating a read-only copy of the volume, backup programs are able to access every file with no other programs able to lock those same files, this simplifies the creation of consistent backup.
A shadow copy is not created every time a file is changed; backup copies are created automatically once per day, or manually when triggered by a backup or installer application.
Persistent shadow copies can only be made for NTFS volumes.
Nonpersistent (volatile) shadow copies can be made for NTFS and non-NTFS volumes.
In Windows 8 the ability to create persistent shadow copies (Previous Versions) will be removed. The Shadow Copy service will only be able to create volatile shadow copies for backup purposes.
Shadow copies on an NTFS volume will be deleted if the NTFS volume is subsequently mounted on an older operating system, either by dual booting or by moving the hard drive.
Use DiskShadow to:
Examples:
List all shadows, including their aliases:
C:\> diskshadow.exe list shadows all
Remove the imported shadow copy %Import_1%:
C:\> diskshadow.exe mask %Import_1%
Create a VSS snapshop of drive D: and expose it as Read-Only drive S:
C:\> diskshadow.exe
Set context persistent
ADD volume D: alias ddrive
Set verbose on
CREATE
expose %ddrive% S:
Now backup the contents of S: (with copy or robocopy)
When no longer needed, delete the snapshop and remove S:
DELETE shadows volume D:
unexpose S:
Create a VSS snapshop of drive D:
C:\> diskshadow.exe
Set context persistent
Set option TRANSPORTABLE
Set metadata C:\docs\ss64.cab
ADD VOLUME D:
CREATE
END BACKUP
#The (transportable) shadow copy is not in the system yet.
#You can reset or exit now if you wish.
# Import the diskshadow
Load metadata C:\docs\ss64.cab
IMPORT
#The shadow copy will now be loaded into the system.
“I don't need a friend who changes when I change and who nods when I nod; my shadow does that much better” ~ Plutarch
Related:
DISKPART - Disk Administration.
VSSADMIN - Volume Shadow Copy.
Where’s my disk space - Jeff Hughes [MSFT]