Sept. 13, 2011, 9:56 a.m.
IT

VSS errors on Windows SBS 2003 R2

I recently tried setting up a TrueCrypt encrypted USB drive and a script that calls ntbackup to perform a full VSS based backup of the local server to that encrypted drive. However ntbackup kept on saying "Retrying VSS snapshot". Looking at the EventLog I saw these:

Event Type: Error
Event Source: VSS
Event Category: None
Event ID: 12293
Date: 9/13/2011
Time: 9:22:03 AM
User: N/A
Computer: SERVER
Description:Volume Shadow Copy Service error: Error calling a routine on the Shadow Copy Provider {b5946137-7b9f-4925-af80-51abd60b20d5}. Routine details IVssSnapshotProvider::QueryVolumesSupportedForSnapshots(ProviderId,29,...) [hr = 0x8000ffff].

Event Type: Warning
Event Source: VSS
Event Category: None
Event ID: 12290
Date: 9/13/2011
Time: 9:22:03 AM
User: N/A
Computer: SERVER
Description:Volume Shadow Copy Service warning: GetVolumeInformationW(\?Volume{f59cbf71-d9a1-1110-a86c-000423dec22f},NULL,0,NULL,NULL,[0x00000000], , 260) == 0x00000057.  hr = 0x00000000.

Event Type: Error
Event Source: VolSnap
Event Category: None
Event ID: 22
Date: 9/13/2011
Time: 9:09:23 AM
User: N/A
Computer: SERVER
Description:The shadow copy storage volume specified for shadow copies on volume C: could not be added.

I ran

vssadmin list writers

and

vssadmin list providers

and saw no errors.

Next step was

vssadmin list volumes

and I got this:

C:\backup>vssadmin list volumes
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001 Microsoft Corp.

Error: The shadow copy provider had an unexpected error while trying to process the specified command.

Right clicking on drive C: and D: in My Computer, Properties, Shadow Copies yielded this error:

error 0x8004230f: the shadow copy provider had an unexpected error while trying to process the specified operation

I tried all the usual fixes such as:

cd /d %windir%\system32
Net stop vss
Net stop swprv
regsvr32 ole32.dll
regsvr32 oleaut32.dll
regsvr32 vss_ps.dll
vssvc /register
regsvr32 /i swprv.dll
regsvr32 /i eventcls.dll
regsvr32 es.dll
regsvr32 stdprov.dll
regsvr32 vssui.dll
regsvr32 msxml.dll
regsvr32 msxml3.dll
regsvr32 msxml4.dll
Net start vss
Net start swprv

to no avail. Everything completed successfully but it did not fix the error.

Microsoft Software Shadow Copy Provider and Volume Shadow Copy services were set to Manual and were running.

Turns out, the moment I dismount the TrueCrypt volume VSS started working again. Look:

C:\backup>vssadmin list volumes
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001 Microsoft Corp.

Volume path: C:\
Volume name: \\?\Volume{f4bc28f8-f192-11db-1a23-802e6f6e6963}\
Volume path: D:\
Volume name: \\?\Volume{f4bc28f9-f192-11db-1a23-802e6f6e6963}\

Working flawlessly. Eventually I found this post, which basically states you need to have TrueCrypt mount the USB drive's partition with the removable media option turned on, like so:

truecrypt.exe … /m rm

And once done, the device mounted as a Removable Device and VSS still worked. Ntbackup now runs successfully.