How to find matching mount points and volume guids ?

In this case I was experiencing VSS error events in application event log on one of the file servers. The related logged events were containing error information with associated Volume GUID instead of mount point (drive letter). Here is the example of the error event:
Volume Shadow Copy Service error: The shadow copy could not be committed - operation timed out. Error context: DeviceIoControl(\\?\Volume{GUID}

Since this error event was generated on file server with bunch of disk drives, I was wondering which mount point (drive letter) was associated with this Volume Guid.
One way to achieve this task was to run mountvol.exe without any switches. The output from this command looks like this:

Also, from Run dialog:

I could browse the contents of the drive, and figure out the drive letter.
Browsing the contents using Volume Guids from command prompt using dir requires additional backslash "\" at the end:

Another way is by comparing values in Registry in HKLM\System\MountedDevices for DosDevices and Volume Guids (picture contents are cropped):

At last, and I guess the best option is to use PowerShell and wmi. Win32_Volume class (not applicable for XP) will provide the necessary data by using DriveLetter an DeviceID properties. All filtering capabilities for filtering data using powershell are available, including querying the remote machines. For example, the following singleliner will return VolumeGuids and DriveLetters associated:

I guess all these methods will help you to find the matching pair :) If you have another way for matching volume guids and mount points, feel free to comment.


Popular posts from this blog

How to convert string to Base64 and vice versa using Powershell

Machine domain group policy failed to apply

Install Windows Server 2012 on HP DL 380 G5