Volume Shadow Copy Service
Volume Shadow Copy Service
Applies To: Windows 7, Windows Server 2003, Windows Server 2008, Windows Server 2008 R2, Windows Vista
Backing up and restoring critical business data can be very complex due to the following issues:
The data usually needs to be backed up while the applications that produce the data are still running. This
means that some of the data les might be open or they might be in an inconsistent state.
If the data set is large, it can be dicult to back up all of it at one time.
Correctly performing backup and restore operations requires close coordination between the backup applications,
the lineofbusiness applications that are being backed up, and the storage management hardware and software.
The Volume Shadow Copy Service (VSS), which was introduced in Windows Server2003, facilitates the conversation
between these components to allow them to work better together. When all the components support VSS, you can
use them to back up your application data without taking the applications oine.
VSS coordinates the actions that are required to create a consistent shadow copy (also known as a snapshot or a
pointintime copy) of the data that is to be backed up. The shadow copy can be used asis, or it can be used in
scenarios such as the following:
You want to back up application data and system state information, including archiving data to another hard
disk drive, to tape, or to other removable media.
You need a fast recovery from data loss by restoring data to the original LUN or to an entirely new LUN that
replaces an original LUN that failed.
Windows features and applications that use VSS include the following:
https://technet.microsoft.com/en-us/library/ee923636(d=printer,v=ws.10).aspx 1/19
3/17/2017 Volume Shadow Copy Service
VSS servicePart of the Windows operating system that ensures the other components can communicate with
each other properly and work together.
VSS requesterThe software that requests the actual creation of shadow copies (or other highlevel operations
like importing or deleting them). Typically, this is the backup application. The Windows Server Backup utility and
the System Center Data Protection Manager application are VSS requesters. NonMicrosoft VSS requesters
include nearly all backup software that runs on Windows.
VSS writerThe component that guarantees we have a consistent data set to back up. This is typically provided as
part of a lineofbusiness application, such as SQL Server or Exchange Server. VSS writers for various Windows
components, such as the registry, are included with the Windows operating system. NonMicrosoft VSS writers are
included with many applications for Windows that need to guarantee data consistency during back up.
VSS providerThe component that creates and maintains the shadow copies. This can occur in the software or in
the hardware. The Windows operating system includes a VSS provider that uses copyonwrite. If you use a
storage area network (SAN), it is important that you install the VSS hardware provider for the SAN, if one is
provided. A hardware provider ooads the task of creating and maintaining a shadow copy from the host
operating system.
The following diagram illustrates how the VSS service coordinates with requesters, writers, and providers to create
a shadow copy of a volume.
https://technet.microsoft.com/en-us/library/ee923636(d=printer,v=ws.10).aspx 2/19
3/17/2017 Volume Shadow Copy Service
To create a shadow copy, the requester, writer, and provider perform the following actions:
1. The requester asks the Volume Shadow Copy Service to enumerate the writers, gather the writer metadata,
and prepare for shadow copy creation.
2. Each writer creates an XML description of the components and data stores that need to be backed up and
provides it to the Volume Shadow Copy Service. The writer also denes a restore method, which is used for
all components. The Volume Shadow Copy Service provides the writer's description to the requester, which
selects the components that will be backed up.
3. The Volume Shadow Copy Service noties all the writers to prepare their data for making a shadow copy.
4. Each writer prepares the data as appropriate, such as completing all open transactions, rolling transaction
logs, and ushing caches. When the data is ready to be shadowcopied, the writer noties the Volume
Shadow Copy Service.
5. The Volume Shadow Copy Service tells the writers to temporarily freeze application write I/O requests (read
I/O requests are still possible) for the few seconds that are required to create the shadow copy of the
volume or volumes. The application freeze is not allowed to take longer than 60 seconds. The Volume
Shadow Copy Service ushes the le system buers and then freezes the le system, which ensures that the
le system metadata is recorded correctly and the data to be shadowcopied is written in a consistent order.
6. The Volume Shadow Copy Service tells the provider to create the shadow copy. The shadow copy creation
period lasts no more than 10 seconds, during which all write I/O requests to the le system remain frozen.
7. The Volume Shadow Copy Service releases le system write I/O requests.
8. VSS tells the writers to thaw application write I/O requests. At this point applications are free to resume
writing data to the disk that is being shadowcopied.
https://technet.microsoft.com/en-us/library/ee923636(d=printer,v=ws.10).aspx 3/19
3/17/2017 Volume Shadow Copy Service
Note
The shadow copy creation can be aborted if the writers are kept in the freeze state for longer than 60
seconds or if the providers take longer than 10 seconds to commit the shadow copy.
9. The requester can retry the process (go back to step 1) or notify the administrator to retry at a later time.
10. If the shadow copy is successfully created, the Volume Shadow Copy Service returns the location information
for the shadow copy to the requester. In some cases, the shadow copy can be temporarily made available as
a readwrite volume so that VSS and one or more applications can alter the contents of the shadow copy
before the shadow copy is nished. After VSS and the applications make their alterations, the shadow copy
is made readonly. This phase is called Autorecovery, and it is used to undo any lesystem or application
transactions on the shadow copy volume that were not completed before the shadow copy was created.
Complete copyThis method makes a complete copy (called a "full copy" or "clone") of the original volume at a
given point in time. This copy is readonly.
CopyonwriteThis method does not copy the original volume. Instead, it makes a dierential copy by copying
all changes (completed write I/O requests) that are made to the volume after a given point in time.
RedirectonwriteThis method does not copy the original volume, and it does not make any changes to the
original volume after a given point in time. Instead, it makes a dierential copy by redirecting all changes to a
dierent volume.
Complete copy
A complete copy is usually created by making a "split mirror" as follows:
1. The original volume and the shadow copy volume are a mirrored volume set.
2. The shadow copy volume is separated from the original volume. This breaks the mirror connection.
After the mirror connection is broken, the original volume and the shadow copy volume are independent. The
original volume continues to accept all changes (write I/O requests), while the shadow copy volume remains an
exact readonly copy of the original data at the time of the break.
Copyonwrite method
In the copyonwrite method, when a change to the original volume occurs (but before the write I/O request is
completed), each block to be modied is read and then written to the volume's shadow copy storage area (also
called its "di area"). The shadow copy storage area can be on the same volume or a dierent volume. This
preserves a copy of the data block on the original volume before the change overwrites it.
https://technet.microsoft.com/en-us/library/ee923636(d=printer,v=ws.10).aspx 4/19
3/17/2017 Volume Shadow Copy Service
Time Source data (status and data) Shadow copy (status and data)
The copyonwrite method is a quick method for creating a shadow copy, because it copies only data that is
changed. The copied blocks in the di area can be combined with the changed data on the original volume to
restore the volume to its state before any of the changes were made. If there are many changes, the copyon
write method can become expensive.
Redirectonwrite method
In the redirectonwrite method, whenever the original volume receives a change (write I/O request), the change
is not applied to the original volume. Instead, the change is written to another volume's shadow copy storage
area.
Time Source data (status and data) Shadow copy (status and data)
Like the copyonwrite method, the redirectonwrite method is a quick method for creating a shadow copy,
because it copies only changes to the data. The copied blocks in the di area can be combined with the
unchanged data on the original volume to create a complete, uptodate copy of the data. If there are many
read I/O requests, the redirectonwrite method can become expensive.
https://technet.microsoft.com/en-us/library/ee923636(d=printer,v=ws.10).aspx 5/19
3/17/2017 Volume Shadow Copy Service
Hardwarebased providers
Hardwarebased shadow copy providers act as an interface between the Volume Shadow Copy Service and the
hardware level by working in conjunction with a hardware storage adapter or controller. The work of creating
and maintaining the shadow copy is performed by the storage array.
Hardware providers always take the shadow copy of an entire LUN, but the Volume Shadow Copy Service only
exposes the shadow copy of the volume or volumes that were requested.
A hardwarebased shadow copy provider makes use of the Volume Shadow Copy Service functionality that
denes the point in time, allows data synchronization, manages the shadow copy, and provides a common
interface with backup applications. However, the Volume Shadow Copy Service does not specify the underlying
mechanism by which the hardwarebased provider produces and maintains shadow copies.
Softwarebased providers
Softwarebased shadow copy providers typically intercept and process read and write I/O requests in a software
layer between the le system and the volume manager software.
These providers are implemented as a usermode DLL component and at least one kernelmode device driver,
typically a storage lter driver. Unlike hardwarebased providers, softwarebased providers create shadow
copies at the software level, not the hardware level.
A softwarebased shadow copy provider must maintain a "pointintime" view of a volume by having access to a
data set that can be used to recreate volume status before the shadow copy creation time. An example is the
copyonwrite technique of the system provider. However, the Volume Shadow Copy Service places no
restrictions on what technique the softwarebased providers use to create and maintain shadow copies.
A software provider is applicable to a wider range of storage platforms than a hardwarebased provider, and it
should work with basic disks or logical volumes equally well. (A logical volume is a volume that is created by
combining free space from two or more disks.) In contrast to hardware shadow copies, software providers
consume operating system resources to maintain the shadow copy.
For more information about basic disks, see What Are Basic Disks and Volumes?
(http://go.microsoft.com/fwlink/?LinkId=180894) on TechNet.
System provider
One shadow copy provider, the system provider, is supplied in the Windows operating system. Although a
default provider is supplied in Windows, other vendors are free to supply implementations that are optimized
for their storage hardware and software applications.
To maintain the "pointintime" view of a volume that is contained in a shadow copy, the system provider uses a
copyonwrite technique. Copies of the blocks on volume that have been modied since the beginning of the
shadow copy creation are stored in a shadow copy storage area.
The system provider can expose the production volume, which can be written to and read from normally. When
the shadow copy is needed, it logically applies the dierences to data on the production volume to expose the
complete shadow copy.
For the system provider, the shadow copy storage area must be on an NTFS volume. The volume to be shadow
copied does not need to be an NTFS volume, but at least one volume mounted on the system must be an NTFS
volume.
https://technet.microsoft.com/en-us/library/ee923636(d=printer,v=ws.10).aspx 6/19
3/17/2017 Volume Shadow Copy Service
The component les that make up the system provider are swprv.dll and volsnap.sys.
For more information about these writers, see the following Microsoft Web sites:
New InBox VSS Writers for Windows Server2008 and Windows Vista SP1 (http://go.microsoft.com/fwlink/?
LinkId=180896)
New InBox VSS Writers for Windows Server2008R2 and Windows7 (http://go.microsoft.com/fwlink/?
LinkId=180897)
The shadow copy can be a full clone or a dierential shadow copy. In either case, at the end of the resync
operation, the destination LUN will have the same contents as the shadow copy LUN. During the resync
operation, the array performs a blocklevel copy from the shadow copy to the destination LUN.
Note
https://technet.microsoft.com/en-us/library/ee923636(d=printer,v=ws.10).aspx 7/19
3/17/2017 Volume Shadow Copy Service
Most arrays allow production I/O operations to resume shortly after the resync operation begins. While the
resync operation is in progress, read requests are redirected to the shadow copy LUN, and write requests to the
destination LUN. This allows arrays to recover very large data sets and resume normal operations in several
seconds.
LUN resynchronization is dierent from LUN swapping. A LUN swap is a fast recovery scenario that VSS has
supported since Windows Server2003 SP1. In a LUN swap, the shadow copy is imported and then converted into
a readwrite volume. The conversion is an irreversible operation, and the volume and underlying LUN cannot be
controlled with the VSS APIs after that. The following list describes how LUN resynchronization compares with
LUN swapping:
In LUN resynchronization, the shadow copy is not altered, so it can be used several times. In LUN
swapping, the shadow copy can be used only once for a recovery. For the most safetyconscious
administrators, this is important. When LUN resynchronization is used, the requester can retry the entire
restore operation if something goes wrong the rst time.
At the end of a LUN swap, the shadow copy LUN is used for production I/O requests. For this reason, the
shadow copy LUN must use the same quality of storage as the original production LUN to ensure that
performance is not impacted after the recovery operation. If LUN resynchronization is used instead, the
hardware provider can maintain the shadow copy on storage that is less expensive than production
quality storage.
If the destination LUN is unusable and needs to be recreated, LUN swapping may be more economical
because it doesn't require a destination LUN.
Caution
All of the operations listed are LUNlevel operations. If you attempt to recover a specic volume by using LUN
resynchronization, you are unwittingly going to revert all the other volumes that are sharing the LUN.
For more information about Shadow Copies for Shared Folders, see Shadow Copies for Shared Folders
(http://go.microsoft.com/fwlink/?LinkId=180898) on TechNet.
https://technet.microsoft.com/en-us/library/ee923636(d=printer,v=ws.10).aspx 8/19
3/17/2017 Volume Shadow Copy Service
With the Volume Shadow Copy Service and a storage array with a hardware provider that is designed for use
with the Volume Shadow Copy Service, it is possible to create a shadow copy of the source data volume on one
server, and then import the shadow copy onto another server (or back to the same server). This process is
accomplished in a few minutes, regardless of the size of the data. The transport process is accomplished
through a series of steps that use a shadow copy requester (a storagemanagement application) that supports
transportable shadow copies.
2. Import the shadow copy to a server that is connected to the SAN (you can import to a dierent server or
the same server).
https://technet.microsoft.com/en-us/library/ee923636(d=printer,v=ws.10).aspx 9/19
3/17/2017 Volume Shadow Copy Service
Note
A transportable shadow copy that is created on Windows Server2003 cannot be imported onto a server that
is running Windows Server2008 or Windows Server2008R2. A transportable shadow copy that was created
on Windows Server2008 or Windows Server2008R2 cannot be imported onto a server that is running
Windows Server2003. However, a shadow copy that is created on Windows Server2008 can be imported
onto a server that is running Windows Server2008R2 and vice versa.
https://technet.microsoft.com/en-us/library/ee923636(d=printer,v=ws.10).aspx 10/19
3/17/2017 Volume Shadow Copy Service
Shadow copies are readonly. If you want to convert a shadow copy to a read/write LUN, you can use a Virtual
Disk Servicebased storagemanagement application (including some requesters) in addition to the Volume
Shadow Copy Service. By using this application, you can remove the shadow copy from Volume Shadow Copy
Service management and convert it to a read/write LUN.
Volume Shadow Copy Service transport is an advanced solution on computers running Windows Server2003
Enterprise Edition, Windows Server2003 Datacenter Edition, Windows Server2008, or Windows Server2008R2.
It works only if there is a hardware provider on the storage array. Shadow copy transport can be used for a
number of purposes, including tape backups, data mining, and testing.
When was Volume Shadow Copy Service introduced? On which Windows operating system versions is it
available?
VSS was introduced in WindowsXP. It is available on WindowsXP, Windows Server2003, Windows Vista,
Windows Server2008, Windows7, and Windows Server2008R2.
When data is copied from the shadow copy to tape or other removable media, the content that is stored on the
media constitutes the backup. The shadow copy itself can be deleted after the data is copied from it.
What is the largest size volume that Volume Shadow Copy Service supports?
Volume Shadow Copy Service supports a volume size of up to 64 TB.
Shadow copies that are created on either of these versions of Windows can be used on the other.
https://technet.microsoft.com/en-us/library/ee923636(d=printer,v=ws.10).aspx 11/19
3/17/2017 Volume Shadow Copy Service
It depends on the backup software you used. If you create a shadow copy on Windows Server2003, you cannot
use it on Windows Server2008. Also, if you create a shadow copy on Windows Server2008, you cannot restore
it on Windows Server2003.
For more information, see the following Microsoft TechNet Web sites:
To exclude specic les from shadow copies, use the following registry key: FilesNotToSnapshot.
Note
The FilesNotToSnapshot registry key is intended to be used only by applications. Users who attempt to use
it will encounter limitations such as the following:
It cannot delete les from a shadow copy that was created on a Windows Server by using the Previous
Versions feature.
It can delete les from a shadow copy that was created by using the Diskshadow utility, but it cannot
delete les from a shadow copy that was created by using the Vssadmin utility.
Files are deleted from a shadow copy on a besteort basis. This means that they are not guaranteed
to be deleted.
For more information, see Excluding Files from Shadow Copies (http://go.microsoft.com/fwlink/?
LinkId=180904) on MSDN.
My nonMicrosoft backup program failed with a VSS error. What can I do?
https://technet.microsoft.com/en-us/library/ee923636(d=printer,v=ws.10).aspx 12/19
3/17/2017 Volume Shadow Copy Service
Check the product support section of the Web site of the company that created the backup program. There may
be a product update that you can download and install to x the problem. If not, contact the company's product
support department.
System administrators can use the VSS troubleshooting information on the following Microsoft TechNet Library
Web site to gather diagnostic information about VSSrelated issues.
If there is a precongured manual association between the original volume and the shadow copy volume
location, then that location is used.
If the previous two criteria do not provide a location, the shadow copy service chooses a location based
on available free space. If more than one volume is being shadow copied, the shadow copy service creates
a list of possible snapshot locations based on the size of free space, in descending order. The number of
locations provided is equal to the number of volumes being shadow copied.
If the volume being shadow copied is one of the possible locations, then a local association is created.
Otherwise an association with the volume with the most available space is created.
What's the maximum number of shadow copies I can create at one time?
The maximum number of shadow copied volumes in a single shadow copy set is 64. Note that this is not the
same as the number of shadow copies.
https://technet.microsoft.com/en-us/library/ee923636(d=printer,v=ws.10).aspx 13/19
3/17/2017 Volume Shadow Copy Service
What's the maximum number of software shadow copies created by the system provider that I can
maintain for a volume?
The max number is of software shadow copies for each volume is 512. However, by default you can only
maintain 64 shadow copies that are used by the Shadow Copies of Shared Folders feature. To change the limit
for the Shadow Copies of Shared Folders feature, use the following registry key: MaxShadowCopies.
How can I control the space that is used for shadow copy storage space?
Type the vssadmin resize shadowstorage command.
DiskShadow (http://go.microsoft.com/fwlink/?LinkId=180907)
VssAdmin (http://go.microsoft.com/fwlink/?LinkId=84008)
DiskShadow
DiskShadow is a VSS requester that you can use to manage all the hardware and software snapshots that you
can have on a system. DiskShadow includes commands such as the following:
expose: Exposes a persistent shadow copy (as a drive letter, for example)
This tool is intended for use by IT professionals, but developers might also nd it useful when testing a VSS
writer or VSS provider.
https://technet.microsoft.com/en-us/library/ee923636(d=printer,v=ws.10).aspx 14/19
3/17/2017 Volume Shadow Copy Service
DiskShadow is available only on Windows Server operating systems. It is not available on Windows client
operating systems.
VssAdmin
VssAdmin is used to create, delete, and list information about shadow copies. It can also be used to resize the
shadow copy storage area ("di area").
resize shadowstorage: Changes the maximum size of the shadow copy storage area
VssAdmin can only be used to administer shadow copies that are created by the system software provider.
VssAdmin is available on Windows client and Windows Server operating system versions.
VssAccessControl
MaxShadowCopies
MinDiAreaFileSize
VssAccessControl
This key is used to specify which users have access to shadow copies.
For more information, see the following entries on the MSDN Web site:
https://technet.microsoft.com/en-us/library/ee923636(d=printer,v=ws.10).aspx 15/19
3/17/2017 Volume Shadow Copy Service
MaxShadowCopies
This key species the maximum number of clientaccessible shadow copies that can be stored on each volume
of the computer. Clientaccessible shadow copies are used by Shadow Copies for Shared Folders.
For more information, see the following entry on the MSDN Web site:
MinDiAreaFileSize
This key species the minimum initial size, in MB, of the shadow copy storage area.
For more information, see the following entry on the MSDN Web site:
Minimum Minimum
VSS feature supported supported
client server
Note
This is the ability to import a shadow copy more than once. Only one
import operation can be performed at a time.
Community Additions
1) CopyVSSVC.exe to system32
C:\Windows\system32>copy c:\WINDOWS\WinSxS\amd64_microsoftwindows
vssservice_31bf3856ad364e35_6.3.9600.17467_none_4ba3ba55ebbba526/vssvc.exe c:\windows\system32\
c:\WINDOWS\WinSxS\amd64_microsoftwindows
vssservice_31bf3856ad364e35_6.3.9600.17467_none_4ba3ba55ebbba526\VSSVC.exe
https://technet.microsoft.com/en-us/library/ee923636(d=printer,v=ws.10).aspx 17/19
3/17/2017 Volume Shadow Copy Service
cd /d %windir%\system32
net stopvss
net stop swprv
regsvr32 /s ole32.dll
regsvr32 /s oleaut32.dll
regsvr32 /s vss_ps.dll
vssvc /register
regsvr32 /s /i swprv.dll
regsvr32 /s /i eventcls.dll
regsvr32 /s es.dll
regsvr32 /s stdprov.dll
regsvr32 /s vssui.dll
regsvr32 /s msxml.dll
regsvr32 /s msxml3.dll
regsvr32 /s msxml4.dll
vssvc /register
net start swprv
net start
vss
Junior Mayhe
1/25/2016
RedirectonWrite method
Under the RoW method example, shouldn't it say 'Original data unchanged'instead of the same as CoW's 'Original data
overwritten'?
sunnysheth
3/1/2013
nokuthulam
1/29/2013
New InBox VSS Writers for Windows Server2008 and Windows Vista SP1 (http://go.microsoft.com/fwlink/?LinkId=180896)
New InBox VSS Writers for Windows Server2008R2 and Windows7 (http://go.microsoft.com/fwlink/?LinkId=180897)
[email protected]
https://technet.microsoft.com/en-us/library/ee923636(d=printer,v=ws.10).aspx 18/19
3/17/2017 Volume Shadow Copy Service
Trekrod
9/24/2012
2017 Microsoft
https://technet.microsoft.com/en-us/library/ee923636(d=printer,v=ws.10).aspx 19/19