Monday, 1 August 2011

Extend virtual machine partition and create single vmdk file from multiple files

Hello Frnz,

As most of you are using VmWare for your day-today testing.
Sometimes you may have face the following issues and may be get angry.

1.  You have vmdk files spitted into 2GB files
     (suppose your HDD is of 40GB then you will 20 Vmdk files)
2.  You have created 10GB Vmdk file and afterward you require more HDD space.

Today in this blog I will just share with you few techniques to fix the above issues. 

                          How To create one vmdk file from multiple files

Please follow the following steps to create one Vmdk file from multiple files.

Step1.  Copy the vmware-vdiskmanager from vmware server/workstation edition to          
             %systemroot%\system32.you can get this by
             
           Going into C:\Program Files\VMware\VMware Server>
             or
            Going into C:\Program Files\VMware\VMware Workstation>  
            or
          You can also search for vmware-vdiskmanager from the Vmware installation folder

Step2:  After copying the exe file just run the following command.

C:\>vmware-vdiskmanager -r G:\VmS\2003_server\Windows_Server_2003-000001.vmdk –t 2 H:\mysinglefile.vmdk


{G:\ is the source drive folder where you have all the splitted 2Gb vmdk files.
H:\mysinglefile.vmdk is the location where it will create a single vmdk file.}


Step 3: After that run the Vm machine, if it gave some error message then try to 
            browse that single Vm disk.If still the error comes then  just create a new
            VM machine and after creating the new machine just replace the HDD of
            the newly created machine with the HDD (single vmdk file that you have  
            created).It will work.




                                   How To increase space of single vmdk file

There are two ways to do this 


1. Command based
2  GUI based

Command Based:

Step1:- Turn off the virtual machine;
Steps2:-Commit/remove all the snapshots if any. 
Step3:-Open a Command Prompt and go to:  

C:\Program Files\VMWare\VMWare Server or C:\Program Files\VMware\VMware Workstation

or if you have already copied this file to system32 folder then simply run the below command. 

Step4:-Run this command to expand the virtual disk:

vmware- vdiskmanager -x 12GB "My harddisk.vmdk"

Step5:-This only expands the disk and not the partition, you'll need to resize the partition
           table as well. This can be done by 3rd party tools like 'Partition Magic, but also
           with Diskpart.exe, a tool of Windows.
  
Step6:- Type the following commands to extend the partition.
             Power on the Virtual machine
       
1.      Open a Command Prompt and type:
diskpart
2.      Type:
list volume
Remember the volume number of your volume
3.      Type:
select volume <volume number>
4.      Type:
extend 

GUI Based

To extend the disk using GUI interface

Step1:- Power off the machine
Step2:-Goto the "Edit virtual machine setting" option on the main page.
Step3:- Click on the Hard Disk
Step4:- On the right hand side click on Utilities as shown below

Step5:- Click on expand and mention how much total space you require.Click OK
             It will start extending the disk

Step6:- Use the diskpart.exe utility to extend the partition.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.