網頁

2018年1月14日 星期日

VMware Workstation 14.0.0 --- How to convert a virtual disk from growable to preallocated on Lubuntu 16.04

In general, we create a virtual disk with growable type for saving the disk space on vmware environment. For performance thought, maybe need to change the disk type for reducing the count of the defrage/compact disk.
By the virtual machine settings, we can know whether the disk is preallocated or not in the disk information.

Once decide to do this, we have to shut down the virtual machine because the disk can’t be converted if it’s powered on or suspended.
To convert the virtual disk by using the following command
$ vmware-vdiskmanager -r < original disk > -t < type > < target disk >
Note:
1). The location is the sames as one.
2). In using the -t flag, VMware virtual disk (vmdk) types has the following choice.
  • 0 : single growable virtual disk (single .vmdk file)
  • 1 : growable virtual disk split in 2Gb files (multiple 2GB files)
  • 2 : single preallocated virtual disk (single file)
  • 3 : preallocated virtual disk split in 2Gb files (multiple 2GB files)
  • 4 : preallocated ESX
  • 5 : compressed for streaming


When successfully finish the convert, we need to replace the original Disk file with the new disk. The action flow is as follows:
AS-IS
TO-BE
Now we can boot it normally.
Since 2010 Design by Davidwa
©Copyright Davidwa Inc. All rights reserved.