PHPKB Knowledge Base Software Logo  
Guru Corner
Online Knowledgebase System  
Knowledge Base Home Knowledge Base Home
Home > All Categories > VMware > Administrative > Extending partitions in Windows using DiskPart
Question Title Extending partitions in Windows using DiskPart
Caution: VMware strongly recommends that you have backups in place before any performing any disk partition operation. Also make sure there are no snapshots existing for the virtual machine before extending the VMDK.
 
To expand VMDK and extend a partition:
  1. Verify that the virtual machine does not have any snapshots by going into the virtual machine's directory and looking for Delta files. Run the following command:

    #ls -lah /vmfs/volumes/datastore_name/vm_name/*delta*
    -rw------- 1 root root 1.8G Oct 10 10:58 vm_name-000001-delta.vmdk

  2. If the virtual machine does have snapshots, commit them using these commands:

    #vmware-cmd -l /vmfs/volumes/datastore_name/vm_name/vm_name.vmx

    #vmware-cmd /vmfs/volumes/datastore_name/vm_name/vm_name.vmx removesnapshots removesnapshots() = 1

  3. Power off the virtual machine.

  4. To expand the VMDK using the VI Client (if the option exists), e dit the settings of the virtual machine and click the hard disk you want to expand.

  5. En ter a new value in the New Size field:



    To expand the VMDK using the vmkfstools -X command, run the command:

    #vmkfstools -X <New Disk Size> <VMDK to extend>

    #vmkfstools -X 30G /vmfs/volumes/datastore_name/vm_name/vm_name.vmdk

    Note: Ensure that you point to the <vm_name>.vmdk, and not to the <vm_name>-flat.vmdk. Using vmkfstools -X is the only option to expand an IDE virtual disk .

  6. Find a helper virtual machine and attach the disk from the first virtual machine to the helper.

    To add an existing virtual disk to the helper virtual machine:

    1. Go to the Edit Settings menu of the virtual machine.

    2. Click Add > Hard Disk > Use Existing Virtual Disk.
    3. Navigate to the location of the disk and select to add it into the virtual machine.

      Note: A helper virtual machine is a virtual machine that has the same operating system to which you attach the disk.

  7. Start the virtual machine.

  8. Verify the volume in question has been mounted and has been assigned a drive letter. This can be set in Windows Disk Management or by selecting the volume and typing assign from within the DiskPart command.

    In versions of Windows prior to 2008, open a command prompt and run the DiskPart command:

    C:\Documents and Settings\username>diskpart

    Microsoft DiskPart version 5.1.3565
    Copyright (C) 1999-2003 Microsoft Corporation.
    On computer: USERNAME-HELPER-VM
    DISKPART> list volume

    Volume ### Ltr Label Fs Type Size Status Info
    ---------- --- ----------- ----- ---------- ------- --------- --------
    Volume 0 D CD-ROM 0 B
    Volume 1 C NTFS Partition 30 GB Healthy System
    Volume 2 E NTFS Partition 10 GB Healthy

    DISKPART> select Volume 2

    Volume 2 is the selected volume.

    DISKPART> extend
    DiskPart successfully extended the volume.
    DISKPART> exit
    Leaving DiskPart...

    Note: Ensure to choose the correct volume. The Size is the old value.

    Note: If you are in Windows 2003, and you see the error The volume you have selected may not be extended. Please select another volume and try again, see the Microsoft Knowledge Base article 841650.

  9. In Windows 2008, click Start > Computer Management > Disk Manager, right-click on the partition and select Extend Volume. For more information, see the Microsoft Knowledge Base article 325590. 

  10. Power off and detach the disk from the helper virtual machine. Keep all default settings and do not delete the VMDK from the disk.

  11. Power on the first virtual machine and verify the disk size change.

Authored by: Guru Corner
Click Here to View all the questions in Administrative category.
File Attachments File Attachments
There are no attachment file(s) related to this question.
Article Information Additional Information
Article Number: 175
Created: 2011-06-19 9:55 PM
Rating: No Rating
 
Article Options Article Options
Print Question Print this Question
Export to Adobe PDF Export to PDF File
Export to MS Word Export to MS Word
 
Search Knowledge Base Search Knowledge Base
 
 

Powered by Guru Corner