This project is read-only.

Restore a whole volume to e.g. a mounted USB Disk

Oct 9, 2009 at 2:01 PM

Hey,

guess I have a ShadowCopy of my C: Drive.
How would I restore this whole volume to my mounted USB Disk (e.g. H: Drive)?

Is there a way to do this with AlphaVSS?


Ciao Ephraim

Oct 11, 2009 at 8:50 PM

I haven't personally worked with the restore features of VSS, but the functionality should be there. All I can do is to refer you to the MSDN documentation on VSS, or leave someone else with more experience in this area to answer your question.

Oct 12, 2009 at 8:03 AM

Thx for the reply. Now I know that there should be a way to do this.
I'll try to find the way and when succeeded I'll leave a comment here.

But anyway, further help would be definitely usefull :).

Ciao Ephraim

Apr 21, 2010 at 2:59 PM
Edited Apr 21, 2010 at 3:00 PM

If you have a snapshot created, you are able to read directly from the SnapshotDeviceObject (you get this from a VssSnapshotProperties Instance) with the AlphaFS Library.
e.g. with Alphaleonis.Win32.Filesystem.Directory.GetDirectories(SnapshotDeviceObject + @"\") you will get the directories of the root of the snapshot.

Ciao Ephraim

Dec 9, 2013 at 7:38 PM
Hi Ephraim,

I am new to vss. I am able to do a volume snap, but when trying to restore, I get that vss is in an inconsistent state and the event viewer:
Volume Shadow Copy Service error: Unexpected error querying for the IVssWriterCallback interface.  hr = 0x80070005, Access is denied.
. This is often caused by incorrect security settings in either the writer or requestor process. 
sure i am running as admin.

here is the code:
            vss = Alphaleonis.Win32.Vss.VssUtils.LoadImplementation();  // load the correct version of alphavss
            bk = vss.CreateVssBackupComponents();  // Alphaleonis.Win32.Vss.IVssBackupComponents
            bk.InitializeForRestore( strdoc );   // strDoc is from IVssBackupComponents::SaveAsXml
            bk.GatherWriterMetadata();
            Alphaleonis.Win32.Vss.VssSnapshotProperties prop = bk.GetSnapshotProperties( a_gidSnapshotId );
            bk.RevertToSnapshot( prop.SnapshotId, true );

do you have an example that is able to restore?
thanks