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!

2
  • How are the VHD's mounted on your system?
    – Itai Ganot
    Sep 4, 2014 at 6:30
  • @ItaiGanot: Just through Windows Disk Manager. Is that what you mean? It is not connected to or used by a VM.
    – philips
    Sep 4, 2014 at 6:32

3 Answers 3

10

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

2
  • Thank you! This solution is totally fine and workable in my scenario.
    – philips
    Sep 4, 2014 at 7: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 2, 2015 at 6: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
2
  • Can you add some more details? May 13, 2016 at 8:05
  • Good option for many disks, such as listing Remote Desktop User Profile Disks. Feb 23, 2021 at 1:12
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.