7

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!

philips
  • 205
  • 1
  • 2
  • 6

3 Answers3

11

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:

Detach VHD

Massimo
  • 68,714
  • 56
  • 196
  • 319
  • Thank you! This solution is totally fine and workable in my scenario. – philips Sep 04 '14 at 07:04
  • 2
    Good job on figuring this out -- although it gave me a big scare having to click on 'deatch VHD' on a volume without intending to do so – gerrytan Feb 02 '15 at 06:26
9

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
mwfearnley
  • 757
  • 9
  • 21
L-E Johansson
  • 91
  • 1
  • 1
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.

Indrek
  • 170
  • 7