[Windows] 如何通过 mount point 找到对应的 VHD 文件
假设有一个 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
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步