我有一个固定大小的虚拟硬盘,空间不足。有什么好办法可以增加容量吗?
此 VHD 由 Microsoft Virtual PC 和/或 Microsoft Virtual Server 创建。
答案1
答案2
您可以使用 Microsoft 的 /extend 开关VHD 工具。
VHD 工具是一个非托管代码命令行工具,它提供了有用的 VHD 操作功能,包括即时创建大型固定大小的 VHD。包含源代码。
用法:
VhdTool.exe /create <FileName> <Size> [/quiet]
VhdTool.exe /convert <FileName> [/quiet]
VhdTool.exe /extend <FileName> <NewSize> [/quiet]
Create: Creates a new fixed format VHD of size <Size>.
WARNING - this function is admin only and bypasses
file system security. The resulting VHD file will
contain data which currently exists on the physical disk.
Convert: Converts an existing RAW disk image file to a fixed-format VHD.
The existing file length, rounded up, will contain block data
A VHD footer is appended to the current end of file.
Extend: Extends an existing fixed format VHD to a larger size <Size>.
WARNING - this function is admin only and bypasses
file system security. The resulting VHD file will
contain data which currently exists on the physical disk.