Thoughts on the World

Using Volume Shadowing with Ntbackup Under Vista

The brain-dead backup function under Vista is enormously annoying, but fortunately you can easily get the trusty old ntbackup program running. See this excellent article on the Petri IT knowledgebase for details.

However, this basic solution has two major limitations:

  • You can't back up the system state
  • You can't use volume shadowing, so you can't back up files which are in use

I think I've found a solution to the latter problem, and possibly the first one as well.

To enable volume shadowing you'll need a copy of the VShadow tool, which is part of the free Microsoft VSS (Volume Shadow Copy) SDK. You'll also need a copy of the little utility dosenv.exe, which comes as part of various SDKs, or which can be downloaded directly from various utility websites. I learned about both of these from another excellent site, the Antimail Blog.

The solution is to wrap ntbackup in a pair of command scripts. The first, master script first invokes the system restore utility so you can optionally write a system restore point to disk (in lieu of a proper system state option). It then just invokes Vshadow to create the shadow copies, writes a set of environment variables describing them to a temporary script, and passes control to an inner script. The shadows only persist while this inner script is running, and are then torn down:

REM Backup script to set volume shadow copy for
REM ntbackup under Vista

REM First Create a dedicated system restore point

REM The following creates the volume shadows, and
REM passes control to BackupScript2.cmd.
REM This exits when that does.
"C:\Program Files\Microsoft\VSSSDK72\Tools\VSSReports\vshadow.exe" -script=backupenv.cmd -exec=BackupScript2.cmd C: F:

The second script first runs the temporary script to set environment variables describing the shadows. It then uses dosdev to map these to drive letters, and then passes control to ntbackup. When the backup is complete it does a bit of tidying up, then exits:

REM Backup script to use volume shadow copy with
REM ntbackup under Vista
REM Called by BackupScript.cmd, which creates the
REM shadow copy

REM This creates the environment variables with the shadow details
call backupenv.cmd

REM Now Map the DOS drives
dosdev Y: %SHADOW_DEVICE_1%
dosdev Z: %SHADOW_DEVICE_2%

REM Run the backup(s)

REM Tidy up
dosdev -r -d Y: %SHADOW_DEVICE_1%
dosdev -r -d Z: %SHADOW_DEVICE_2%

You use the volume shadows by backing up the mapped drives, not the original ones - you still need to "disable" volume shadowing in the ntbackup user interface.

There are a couple of weaknesses with this, and I'd welcome any suggestions for improvement:

  1. This works well with some files, e.g. SQL/Server databases, but not others, e.g. Google Desktop's indexes.
  2. The backup reports permission problems on some files, whereas there's no problem with the equivalent files on the master disk.
  3. You still need to manually "disable" volume shadowing in ntabckup.
  4. You can backup the "system state" by making sure you include the latest files in the System Volume Information folder on each drive. However, it's not clear whether you can then effectively restore the whole system state by restoring these from the backup.

Any ideas?


If you'd like to comment on this article, with ideas, examples, or just to praise it to the skies then I'd love to hear from you.

Comment on this article

Please share: All Addthis servicesTweet thisFacebook thisLink thisYam thisShare on Google

© Questa Computing Ltd. 2007
Page last updated 14 May, 2015 13:34

Questa Computing Ltd. is registered in England and Wales number:2889117.
Registered office: Ember House, 35-37 Creek Road, East Molesey, KT8 9BE UK
For credits, copyright details and cookie policy, see here.

Search my Sites:

Share this page:

Share |


Favourite/Major Articles
All Articles by Category
All Articles by Title
Review Index

Site Map:

Welcome / Home Page
Contact Me
Search the Site
Thoughts on the World
Consultancy Services
An introduction
Key Skills
Career Summary
Case Studies
IT Knowledge/Education
Customer Profiles
Training Courses
Previous Experience
Download Full CV
National Grid Group Plc
British Energy Power and Energy Trading
Legal Marketing Services Ltd.
Marks and Spencer Plc
Faith Footwear Ltd.
Barclays Sales Financing Ltd.
Oracle Corporation UK Ltd.
Livingston Rental Group Ltd.
National Power Plc.
Agile Development
Coding Projects & Thoughts
General Thoughts
Products and Projects
Reviews: Books, Music & Films
Website Announcements
Full Index
Publications and Papers
A Hacker's Guide to Project Management
Conference Papers
Agile Architecture
Practical Enterprise Integration
Modelling an Enterprise Data Architecture
Strategies for Flexibility
Getting Sizing Right
Muzzling the Alligators
Evolution of a Test Method
Photography Articles & Discussion
Photo Gallery
Projects and Products
RelQuest - Reliability Modelling Tool
ConQuest - Container Yard Management System
Full Index
Biography and Personal Endeavour
Construction & Civil Engineering
Human-Computer Interaction
Mathematics & Statistics
Military & 20th Century History
Modelling & Analysis
Photography & Photographers
Physics & Cosmology
Project & People Management
Psychology & Human Behaviour
Science, General

Contact Me

Email me

Feeds and Tweets

Follow me on Twitter


Thoughts on the World
(main feed)

Feedburner XML
RSS Version XML (direct)

How many subscribers?

Other Feeds

Professional Blog
Photo Blog
Photo Album
Review Pages

About my feeds

Google Blog Search

References to
References to

Sister Sites: