假设有一个 Virtual Disk(VHD) 文件。已经 online --> attach --> mount。
知道 mount 的文件夹,要找到 .vhd 文件。可以用如下方法:
1. 通过文件夹路径找到 Volume
DISKPART> list volume
Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
Volume 0 System Rese NTFS Partition 500 MB Healthy System
Volume 1 C NTFS Partition 232 GB Healthy Boot
Volume 2 M New Volume NTFS Partition 698 GB Healthy
Volume 3 D LocalM NTFS Partition 1374 GB Healthy
Volume 4 New Volume NTFS Partition 488 GB Healthy
Volume 5 NTFS Partition 9 GB Healthy
C:\ProgramData\testVHD\
DISKPART> select volume 5
Volume 5 is the selected volume.
2. 通过 Volume Name 找到 对应的 Disk
DISKPART> detail volume 5
The arguments specified for this command are not valid.
For more information on the command type: HELP DETAIL VOLUME
DISKPART> detail volume
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
* Disk 2 Online 10 GB 0 B
Read-only : No
Hidden : No
No Default Drive Letter: No
Shadow Copy : No
Offline : No
BitLocker Encrypted : No
Installable : Yes
Volume Capacity : 9 GB
Volume Free Space : 9 GB
3. 枚举 vdisk, 通过查看 Disk 列,找到对应的 .vhd 文件
DISKPART> list vdisk
VDisk ### Disk ### State Type File
--------- -------- -------------------- --------- ----
VDisk 0 Disk --- Added Unknown c:\test.vhd
VDisk 1 Disk --- Added Unknown M:\test1571276605.vhd
VDisk 2 Disk 2 Attached not open Fixed D:\test1571276821.vhd
VDisk 3 Disk --- Added Unknown M:\test1571275991.vhd
VDisk 4 Disk --- Added Unknown D:\test1571276821.vhd
VDisk 5 Disk --- Added Unknown M:\test1571276419.vhd
VDisk 6 Disk --- Added Unknown M:\test1571275991.vhd
VDisk 7 Disk --- Added Unknown M:\test1571275015.vhd
VDisk 8 Disk --- Added Unknown M:\test1571276419.vhd