Changes

Configuring Volume Shadow Copy on Windows Server 2008

6,387 bytes added, 16:07, 25 August 2008
no edit summary
To restore an entire volume, access the Shadow Copy property panel either from ''Computer Management'' as outline above, or by running '''vssuirun''' from a command prompt with elevated privileges. Once loaded, select the desired volume followed by a snapshot from which to restore from the ''Shadow copies of selected volume'' list and click on the ''Revert Now...'' button. This will revert all shared folders on the selected volume to their state at the point that the selected shadow copy was made.
 
It is important to note that restoration of entire volumes is not possible on system volumes since this would, in all probability, severevly disrupt the current system state and stability.
== Configuring and Enabling Shadow Copy from the Command Line ==
 
A significant amount of Shadow Copy functionaility can be access from the command line using the '''vssadmin''' tool, which is the focus of this section.
 
In order to obtain information about shadow copie configured on a system, use ''vssadmin list shadows'':
 
<pre>
C:\Windows\system32>vssadmin list shadows
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2005 Microsoft Corp.
 
Contents of shadow copy set ID: {67f25a62-12f1-4e34-b14a-3b57cb03f4f8}
Contained 1 shadow copies at creation time: 8/22/2008 12:29:56 PM
Shadow Copy ID: {bee54c7f-22a4-4bd0-b6c4-20bc51a8cded}
Original Volume: (E:)\\?\Volume{9fa5f191-6554-11dd-9ce6-000c295707db}\
Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy2
Originating Machine: winserver-2
Service Machine: winserver-2
Provider: 'Microsoft Software Shadow Copy provider 1.0'
Type: ClientAccessible
Attributes: Persistent, Client-accessible, No auto release, No writers,
Differential
 
Contents of shadow copy set ID: {24c56736-d082-4fa5-ac97-961bd708b4d2}
Contained 1 shadow copies at creation time: 8/22/2008 1:00:04 PM
Shadow Copy ID: {e5a5d032-5449-4375-b4c2-5adf12fedc5d}
Original Volume: (E:)\\?\Volume{9fa5f191-6554-11dd-9ce6-000c295707db}\
Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy3
Originating Machine: winserver-2
Service Machine: winserver-2
Provider: 'Microsoft Software Shadow Copy provider 1.0'
Type: ClientAccessible
Attributes: Persistent, Client-accessible, No auto release, No writers,
Differential
 
Contents of shadow copy set ID: {95618a5e-b9f2-4d5c-9654-7fcab5be2c5d}
Contained 1 shadow copies at creation time: 8/23/2008 7:00:03 AM
Shadow Copy ID: {012d8105-ab39-4b17-89c9-bb7dfbeeb1f8}
Original Volume: (E:)\\?\Volume{9fa5f191-6554-11dd-9ce6-000c295707db}\
Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy4
Originating Machine: winserver-2
Service Machine: winserver-2
Provider: 'Microsoft Software Shadow Copy provider 1.0'
Type: ClientAccessible
Attributes: Persistent, Client-accessible, No auto release, No writers,
Differential
</pre>
 
To obtain information about how shadow copy storage is allocated to shadow copies, use the ''vssadmin list shadowstorage'':
 
<pre>
C:\Windows\system32>vssadmin list shadowstorage
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2005 Microsoft Corp.
 
Shadow Copy Storage association
For volume: (E:)\\?\Volume{9fa5f191-6554-11dd-9ce6-000c295707db}\
Shadow Copy Storage volume: (C:)\\?\Volume{f0c004b0-58c1-11dd-a1fe-000c295707
db}\
Used Shadow Copy Storage space: 1.344 MB
Allocated Shadow Copy Storage space: 301.078 MB
Maximum Shadow Copy Storage space: 818 MB
</pre>
 
The above command is particularly useful for comparing used and available space for shadow copy storage.
 
Shadow Copy for a volume may also be enabled from the command-line using ''vssadmin'', the syntax for which is:
 
vssadmin add shadowstorage /for=''volume'' /on=''storevolume''
 
where ''volume'' represents the volume on which shadowe copy is to be enabled and ''storevolume'' is the volume on which the shadow copies are to be stored, for example:
 
<pre>
vssadmin add shadowstorage /for=d: /on=e:
</pre>
 
The maximum storage size may also be specified using the ''/maxsize='' command-line option:
 
<pre>
vssadmin add shadowstorage /for=d: /on=e: /maxsize=8GB
</pre>
 
A manual shadow copy of an enabled volume may be triggered from the command prompt at any time by running vssadmin as follows:
 
<pre>
 
C:\Windows\system32>vssadmin create shadow /for=e:
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2005 Microsoft Corp.
 
Successfully created shadow copy for 'e:\'
Shadow Copy ID: {c9235d96-4ea3-4bc2-b2ee-77397a124914}
Shadow Copy Volume Name: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy7
</pre>
 
Specific shadow copies may also be deleted from the command line either by specifying that the oldest snapshot is to be deleted, or by referencing the specific snapshot by its ''Shadow Copy Id'' (which can be obtained from the ''vssadmin list shadows'' command). For example, to delete the oldest shadow snapshot:
 
<pre>
C:\Windows\system32>vssadmin delete shadows /for=e: /oldest
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2005 Microsoft Corp.
 
Do you really want to delete 1 shadow copies (Y/N): [N]? y
 
Successfully deleted 1 shadow copies.
</pre>
 
Similarly, to delete a specific snapshot from a volume:
 
<pre>
C:\Windows\system32>vssadmin delete shadows /shadow={879318ea-2f28-4d0c-b58b-5df5cd761984}
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2005 Microsoft Corp.
 
Do you really want to delete 1 shadow copies (Y/N): [N]? y
 
Successfully deleted 1 shadow copies.
</pre>
 
The restoration of a shadow from a specific snapshot can be achieved from the command line using the ''vssadmin revert'' command combined with the Shadow Copy ID of the required snapshot. Note that the revert cannot be perfomed if open file handles exist on the volume (the ''/ForceDismount'' parameter is available but its use is not recommended since it can result in lost data:
 
<pre>
C:\Windows\system32>vssadmin revert shadow /shadow={bf7e3df8-b4f9-4068-b208-3c67
8bc85053}
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2005 Microsoft Corp.
 
Do you really want to revert to this shadow copy (Y/N): [N]? y
</pre>
 
Finally, Shadow Copying on a volume may be disabled via the command prompt using the ''vssadmin delete shadowstorage'' command, although the command will only work once all snapshots associated with the volume have been deleted from the shadow storage. Assuming there are no existing shapshots, the following example will disable shadow copy on the volume represented as the e: drive:
 
<pre>
vssadmin delete shadowstorage /for=e:
</pre>