The plan is to create a shadow copy of a quite large, I/O-heavy volume. It's 350GB, containing a filesystem-based fulltext index organized in hundreds of folders and hundred-thousands of tiny files that need to be in a consistent state for a successful restore.
Currently the indexer is stopped, the backup task runs, and then the indexer is restarted. This results in the index being unavailable for hours during the backup. I'd like to make consistent backups via shadow copy, ideally without ever having to stop the indexer at all.
So, I've switched on Shadow Copy for that volume and configured it to make a snapshot once every night, to a different volume.
Now I'm a bit at a loss – how can I access the shadow copy as a whole, so that I can make a backup? I envision a read-only drive that contains the files as they were at the time of the last snapshot, but maybe things work entirely different.
OS is Windows Server 2003 SP2, backup software is CommVault Galaxy 7.0.
EDIT: Note that – in the meantime – two answers have been created that implement the necessary functionality in form of a script:
- VBScript (by myself)
- PowerShell (by John Homer)
Best Answer
So in the spirit of reinventing the wheel, I present to you Tomalak's excellent script (see above) but completely rewritten in Powershell!!! The main reason I did this was to evangelise the awesome powers of Powershell, but also because I despise vbscript with my entire being.
It's mostly feature to feature identical, but I did implement some things a little differently for various reasons. The debugging output is definitely more verbose.
One very important thing to note is that this version detects the OS version and bitness and calls the appropriate version of vshadow.exe. I've included a chart below to show which versions of vshadow.exe to use, where to get them, and what to name them.
Here's the usage info:
Here's the script:
Here are the vshadow.exe versions to use: