操作步骤如下:
进入命令行提示符(start - run - enter "cmd")
比如我的vm放在d:"vm下,那么命令是(最关键的就是粗体字):
D:"Program Files"VMware"VMware Workstation>vmware-vdiskmanager -x 20GB "D:"VM"Windows 2003 R2(weijie)s-vmd6](s)"Windows Server 2003 Standard Edition.vmdk"
如果一切顺利,就会出现:
Disk expansion completed successfully.
那么恭喜,你可以进vm,用Acronis PartitionExpert来增加磁盘空间了。
不过今天遇到些问题,首先,因为以前做过一个snapshot,不能增加磁盘:
The selected operation can only be executed on a disk with no snapshots.
这时候,一定要去把以前建的snapshot删掉,而且这会花很长的时间,千万要等它完毕,不然,如果强行关掉删除snapshot的进程的话,再次尝试增加磁盘的命令,会成功,但会使vm不能启动!会出现下面的错误当你尝试启动vm的时候:
The parent virtual disk has been modified since the child was created
不过还是可以解决的,如下:
1.用文本编辑器 打开 .vmdk文件,比如我的是Windows Server 2003 Standard Edition.vmdk内容可能如下:
- # Disk DescriptorFile
- version=1
- CID=5bae3106
- parentCID=ffffffff
- createType="twoGbMaxExtentSparse"
- # Extent description
- RW 4192256 SPARSE "Windows Server 2003 Standard Edition-s001.vmdk"
- RW 2099200 SPARSE "Windows Server 2003 Standard Edition-s002.vmdk"
- RW 4192256 SPARSE "Windows Server 2003 Standard Edition-s003.vmdk"
- RW 4192256 SPARSE "Windows Server 2003 Standard Edition-s004.vmdk"
- RW 4192256 SPARSE "Windows Server 2003 Standard Edition-s005.vmdk"
- RW 4192256 SPARSE "Windows Server 2003 Standard Edition-s006.vmdk"
- RW 4192256 SPARSE "Windows Server 2003 Standard Edition-s007.vmdk"
- RW 4192256 SPARSE "Windows Server 2003 Standard Edition-s008.vmdk"
- RW 12288 SPARSE "Windows Server 2003 Standard Edition-s009.vmdk"
- RW 4192256 SPARSE "Windows Server 2003 Standard Edition-s010.vmdk"
- RW 4192256 SPARSE "Windows Server 2003 Standard Edition-s011.vmdk"
- RW 2101248 SPARSE "Windows Server 2003 Standard Edition-s012.vmdk"
- # The Disk Data Base
- #DDB
- ddb.toolsVersion = "7428"
- ddb.adapterType = "lsilogic"
- ddb.geometry.sectors = "63"
- ddb.geometry.heads = "255"
- ddb.geometry.cylinders = "1958"
- ddb.virtualHWVersion = "4"
- ddb.encoding = "GBK"
之后,vm应该可以顺利启动了,这时,需要建一个新的snapshot,然后按照正常的流程删之,然后再运行增加磁盘空间命令,方可顺利扩大vm空间。
ps: blog搬家,欢迎访问新地址:www.jinweijie.com