Enumeration of Volumes with VDS API and Recovery Partition

Himanshu Pareek 1 Reputation point
2022-04-19T05:27:52.447+00:00

I am trying to use VDS API to enumerate volumes in the Windows Server 2022. But it is not able to enumerate/discover the recovery partition. With Storage Management API, it is able to enumerate it but GUID field is unavailable in storage management API. please help... either way 1) enumerate recovery partition with VDS OR 2) get volume id (or guid) with storage mgmt API.

Windows for business | Windows Server | User experience | Other
{count} votes

3 answers

Sort by: Most helpful
  1. Limitless Technology 39,931 Reputation points
    2022-04-21T07:31:47.623+00:00

    i there,

    To help you troubleshoot any problems with the VDS, you must first capture the VDS trace to converge on steps.

    To capture a VDS trace, follow these steps:

    -Open an elevated command prompt, and then run the following commands:
    md %systemroot%\system32\LogFiles\VDS
    Logman start vds -o %systemroot%\system32\LogFiles\VDS\VdsTrace.etl -ets -p {012F855E-CC34-4da0-895F-07AF2826C03E} 0xffff 0xff
    -Reproduce the problem.
    -After repro, go back to the command prompt from step 1 and run the following command to stop the VDS trace:
    Logman stop vds -etsTrace file Vds

    Use TraceView.exe to browse the file or send the VdsTrace.etl file to Microsoft customer support to troubleshoot further.


    --If the reply is helpful, please Upvote and Accept it as an answer–

    1 person found this answer helpful.

  2. Jeanine Zhang-MSFT 11,356 Reputation points Microsoft External Staff
    2022-04-20T07:41:40.273+00:00

    Hi,

    Welcome to Microsoft Q&A!

    According to the Doc:

    Beginning with Windows 8 and Windows Server 2012, the Virtual Disk Service COM interface is superseded by the Windows Storage Management API.

    As far as I'm concerned, VDS is being deprecated and the Windows Storage Management API is replacing it.

    get volume id (or guid)

    For more details about how to enumerate volumes,I suggest you could try to start a search for volumes with FindFirstVolume. And then use FindNextVolume in a loop to locate and process each subsequent volume.When the supply of volumes is exhausted, close the search with FindVolumeClose.

    enumerate recovery partition

    You could try to call DeviceIOControl with the control code of IOCTL_DISK_GET_PARTITION_INFO_EX.

    And I suggest you could refer to the following links:
    1,https://learn.microsoft.com/en-gb/windows/win32/fileio/enumerating-volumes?redirectedfrom=MSDN
    2,https://stackoverflow.com/questions/29212597/how-to-enumerate-disk-volume-names
    3,https://stackoverflow.com/questions/30988603/how-to-access-hidden-partitions-volumes
    4,https://social.technet.microsoft.com/Forums/en-US/e7b2ddd6-f245-49ed-8fec-3b6e08e75369/how-do-i-find-the-partition-guid?forum=winservergen

    Best Regards,

    Jeanine


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  3. RLWA32 49,636 Reputation points
    2022-04-20T08:46:48.977+00:00

    I don't have Server 2022 but on my Win 10 system the MSFT_Volume instance provide volume guids in the Path property. The same value is also contained in the UniqueId property.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.