Windows – How does VSS (Volume Shadow Copy) handle locked files

backupvolume-shadow-copywindows

Take this (certainly simplified) description from the HoboCopy tool:

HoboCopy is a backup/copy tool. (…)
It uses the Volume
Shadow Service (VSS) to "snapshot" the
disk before copying. It then copies
from the snapshot rather than the
"live" disk.

Since Windows allows applications to fully lock files for read+write access I was wondering how Volume Shadow Copy Service handles locked files. (Locked as in an application does not share any access to a file it has opened, thereby essentially preventing any xcopy style backup of said file.)

Since Windows apps do their fair amount of locking, is there any chance to ever get a consistent backup this way?

Best Answer

Volume Snapshot Service (VSS) relies on application cooperation in order to get a data-consistent snapshot. "Providers" register with the service and are called at the time of snapshot creation in order to create consistent disk images. Since this is a bit of work, the typical set of providers includes the registry and a number of databases.

Typical desktop applications don't participate.

So the answer to your question is something like: VSS creates copies of locked files and the writers of those files are responsible for making them consistent.

YMMV.

Related Question