Asked by:
Volume Shadow Copy Service

Question
-
Hello
I have a question on VSS component mode. When a component is added with a relevant writer (like VSWriter) and a backup is attempted (with BETest) I see that the shadow copy is still that of the volume and not the folder alone. (using vssadmin List Shadows and then mklink) The folder is a copy of the files on the shadow volume I assume. I tried writing a requestor as well with the same results. I was curious if it is possible to have a shadow volume (or hidden volume) of a directory alone?
(In the BETest code I see it looks like the files are then copied for backing up.)
Thanks,
Sonia
SS
Thursday, February 4, 2016 11:10 PM
All replies
-
Hello
I have a question on VSS component mode. When a component is added with a relevant writer (like VSWriter) and a backup is attempted (with BETest) I see that the shadow copy is still that of the volume and not the folder alone. (using vssadmin List Shadows and then mklink) The folder is a copy of the files on the shadow volume I assume. I tried writing a requestor as well with the same results. I was curious if it is possible to have a shadow volume (or hidden volume) of a directory alone?
(In the BETest code I see it looks like the files are then copied for backing up.)
Thanks,
Sonia.
SS
- Merged by Leo Han Friday, February 5, 2016 6:03 AM duplicated
Thursday, February 4, 2016 10:14 PM -
Hi Sonia,
Thanks for posting here.
> I was curious if it is possible to have a shadow volume (or hidden volume) of a directory alone?
According to your description, I think you may want to set the original volume with your directory. You may check the AddToSnapshotSet method for your reference.
The AddToSnapshotSet method adds an original volume or original remote file share to the shadow copy set. The parameter pwszVolumeName [in] you can set with following:
Null-terminated wide character string containing the name of the volume or the UNC path of the remote file share to be shadow copied. The name or UNC path must be in one of the following formats and must include a trailing backslash (\):
- The path of a mounted folder, for example, Y:\MountX\
- A drive letter, for example, D:\
- A volume GUID path of the form \\?\Volume{GUID}\ (where GUID identifies the volume)
- A UNC path that specifies a remote file share, for example, \\Clusterx\Share1\
If you are using C++ with VSS development, the sample in link below may be useful for you.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Friday, February 5, 2016 3:43 AM -
Hi May,
Thanks for your reply.
I tried adding a path and I get
Status: VSS_E_OBJECT_NOT_FOUND (0x80042308) -- pBackupComponents->AddToSnapshotS
et( (VSS_PWSZ)(L"C:\\TestPath\\"), GUID_NULL, &snapshotId ) in CreateComponentSn
apshots:1674.
Aborting...I believe this is only for volume name. I have the example you are referring to, thanks. That also deals with full volumes.
For directories I think component mode is used with a writer responsible for the set of files. I used a test writer from MSDN and BETest.
Per https://msdn.microsoft.com/en-us/library/aa384593(v=vs.85).aspx
Otherwise, for the components in the Writer Metadata Document that were already added to the Backup Components Document (by calling AddComponent), the requester must also call IVssBackupComponents::AddToSnapshotSet for each affected volume
Which I did and the shadow copy is that of the volume.
BETest and VSWriter are described in
https://msdn.microsoft.com/en-us/library/windows/desktop/bb530721(v=vs.85).aspx
This also creates a shadow volume of the entire c: and then copies the required folder to the destination path.
I want to avoid the copy step and see if I can just have a shadow copy of the c:\testpath as a hidden volume. Is that possible?
SS
- Proposed as answer by Hart Wang Wednesday, February 24, 2016 6:38 AM
Friday, February 5, 2016 4:48 AM -
I think the description also says only drive letter and not driveletter\path or volume\path.
But perhaps there is something I am missing.
SS
Friday, February 5, 2016 4:52 AM -
Hi Sonia,
>> I was curious if it is possible to have a shadow volume (or hidden volume) of a directory alone?
As far as I know, I'm afraid it could not be achieved.
VSS could only operate on a whole volume.
Best Regards,
Leo
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.
Friday, February 5, 2016 5:30 AM -
Thanks for your reply!
SS
Friday, February 5, 2016 5:37 AM -
Hi,
Thanks for your reply. If that is the case why do we have a component mode? Could I check what that achieves if VSS operates on volumes only. As far as I can tell it looks like some files are copied by the requestor to the backup location. I was wondering, besides time stamp information and the backup document, what the advantages are over a user just copying anyway.
Thanks,
Sonia.
SS
Friday, February 5, 2016 5:42 AM