Problem
I want to find the VolumeId that my file is on using the file path.
The Best Solution That I Can Think Of
The best way that I can think of accomplishing this is to query out via WMI/CIM all of the disk partition access paths for all of the LUN Disks, and then seeing which access path has the longest access path.
Background
I am working with Windows Virtual Hard Drives (VHD) multiple LUN disks from a storage array with mount points and want to keep track of what VHD is on what storage array LUN Disk. All of the filesystems of the disks involved are Windows NTFS.
However, I don't see a quick and easy way to do so. I've looked at using CIM_DataFile, but it doesn't have VolumeId, and I don't see it in Win32_Directory either.
I'm guessing that there isn't a simple way to fix this problem, but I'm hoping that someone knows an easy way to solve the problem.