How to get the Physical path of a mounted VHD in Windows Server 2008 R2
I have 2 VHD mounted on my server. I know where one of the actual VHDs is stored. But I have no clue as to where the second one is physically located.
I have googled a lot and did not find any easy method to get this data...
There must be way to find the actual location of a VHD on the local computer or network using the standard Windows GUI, powershell, cmd or Registry.
Does anybody know how to get this value?
Thanks!
Solution 1:
I couldn't find any easy way to do it; even the Disk Management console will not show you the physical path of the VHD when checking its properties.
However, if you select the disk and click on "Detach VHD", you will at last be able to see it:
Solution 2:
The diskpart command can show the path of mounted VHDs. Run the following commands in a command prompt or PowerShell.
diskpart
list vdisk
Example output:
VDisk ### Disk ### State Type File
--------- -------- -------------------- --------- ----
VDisk 0 Disk 2 Attached not open Expandable F:\Test.vhd
Solution 3:
Old question, but this is possible with PowerShell too:
> Get-Disk | Select-Object FriendlyName,Location
FriendlyName Location
------------ --------
Msft Virtual Disk C:\test.vhdx
Tested with PowerShell 5.1 on Windows 10 and Windows Server 2016.