VMware Virtual Disk Manager Usage: vmware-vdiskmanager.exe OPTIONS <disk-name> | <mount-point> Offline disk manipulation utility Options: -c : create disk; need to specify other create options -d : defragment the specified virtual disk -k : shrink the specified virtual disk -n <source-disk> : rename the specified virtual disk; need to specify destination disk-name -p : prepare the mounted virtual disk specified by the drive-letter for shrinking -q : do not log messages -r <source-disk> : convert the specified disk; need to specify destination disk-type -x <new-capacity> : expand the disk to the specified capacity
Additional options for create and convert: -a <adapter> : (for use with -c only) adapter type (ide, buslogic o r lsilogic) -s <size> : capacity of the virtual disk -t <disk-type> : disk type id
Disk types: 0 : single growable virtual disk 1 : growable virtual disk split in 2Gb files 2 : preallocated virtual disk 3 : preallocated virtual disk split in 2Gb files
The capacity can be specified in sectors, Kb, Mb or Gb. The acceptable ranges: ide adapter : [100.0Mb, 950.0Gb] scsi adapter: [100.0Mb, 950.0Gb] ex 1: vmware-vdiskmanager.exe -c -s 850Mb -a ide -t 0 myIdeDisk.vmdk ex 2: vmware-vdiskmanager.exe -d myDisk.vmdk ex 3: vmware-vdiskmanager.exe -r sourceDisk.vmdk -t 0 destinationDisk.vm dk ex 4: vmware-vdiskmanager.exe -x 36Gb myDisk.vmdk ex 5: vmware-vdiskmanager.exe -n sourceName.vmdk destinationName.vmdk ex 6: vmware-vdiskmanager.exe -k myDisk.vmdk ex 7: vmware-vdiskmanager.exe -p <mount-point> (A virtual disk first needs to be mounted at <mount-point>)
创建虚拟磁盘 命令:vmware-vdiskmanager -c -t 0 -s 40GB -a ide myDisk.vmdk 这个命令将创建一个40GB大小IDE接口的名字为myDisk的虚拟硬盘。虚拟磁盘包含在一个单一文件中。这个虚拟磁盘没有被预分配磁盘空间。 实际命令输入: D:\Big Program Files\VMware\VMware Workstation>vmware-vdiskmanager -c -s 40Gb –a ide -t 0 E:\myDisk.vmdk 执行结果显示: Using log file C:\DOCUME~1\AnEgg\LOCALS~1\Temp\vmware-AnEgg\vdiskmanager.log Creating a monolithic growable disk 'E:\myDisk.vmdk' Virtual disk creation successful.
转换一个虚拟磁盘 转换一个预分配虚拟磁盘为可增长虚拟磁盘,用以下这个命令: vmware-vdiskmanager -r sourceDisk.vmdk -t 0 targetDisk.vmdk 这个命令将转换磁盘从它的原始的预分配模式转变为包含在单一文件中的可增长虚拟磁盘。这个虚拟磁盘空间将不会被预先分配,虚拟磁盘工具将收回虚拟磁盘中的一些磁盘空间,而仅仅让里面的数据占用虚拟磁盘空间。 实际命令输入: C:\Program Files\VMware\VMware Workstation>vmware-vdiskmanager -r "D:\WinXP SP2 V2.5\Windows XP Professional.vmdk" -t 0 "L:\Windows XP Professional.vmdk" 执行结果显示: Using log file C:\DOCUME~1\xujun\LOCALS~1\Temp\vmware-AnEgg\vdiskmanager.log Creating a monolithic growable disk 'L:\Windows XP Professional.vmdk' Convert: 100% done. Virtual disk conversion successful.
增大存在的虚拟磁盘的大小 命令:vmware-vdiskmanager -x 40GB myDisk.vmdk 这条命令将把虚拟磁盘myDisk.vmdk大小增大到40GB 实际命令输入: C:\Program Files\VMware\VMware Workstation>vmware-vdiskmanager -x 40GB "D:\WinXP SP2 V2.5\Windows XP Professional S.vmdk" 执行结果显示: Using log file C:\DOCUME~1\xujun\LOCALS~1\Temp\vmware-AnEgg\vdiskmanager.log Grow: 100% done. The old geometry C/H/S of the disk is: 8322/16/63 The new geometry C/H/S of the disk is: 16383/16/63 Disk expansion completed successfully. WARNING: If the virtual disk is partitioned, you must use a third-party utility in the virtual machine to expand the size of the partitions. For more information, see: http://www.vmware.com/support/kb/enduser/std_adp.php?p_faqid=1647 创建好后,可以在磁盘管理中,看到未指派的空间。如果你想扩大磁盘分区的大小,可以用其他第三方软件来做。
VMware Virtual Disk ManagerUsage: vmware-vdiskmanager.exe OPTIONS | Offline disk manipulation utility Options: -c : create disk; need to specify other create options