Loading

×Sorry to interrupt
CSS Error

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

Skip to main content

My Subscriptions

Loading

Knowledge Base

Extending partitions in Windows using DiskPart (1007266)

Last Updated: 6/19/2020Categories: How toTotal Views: 437144Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglish

9 like this article

Subscribe to get an email
newsletter with new updates

9 people found this helpful Please provide article feedback:

Purpose

This article provides steps to expand a virtual disk (VMDK) and then extend a partition using DiskPart in Microsoft Windows.

Resolution

Caution: VMware strongly recommends that you have backups in place before performing any disk partition operation. Also ensure that virtual machine has no snapshots, before starting to extend the VMDK. If the virtual machine has snapshots use "Delete all" from the Snapshot Manager to commit them. Verify again in the Snapshot Manager, in the Edit Settings and the virtual machine datastore that the snapshots were committed.

To expand VMDK and extend a partition:

Log in to the VMware ESX/ESXi host as the root user. Verify that the virtual machine does not have any snapshots in the virtual machine's directory and look for Delta files. Run the 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

Note: For more information on:

VMware ESX Service Console, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807).

VMware ESXi Technical Support Mode, see Tech Support Mode for Emergency Support (1003677).

VMware ESXi 4.1 and ESXi 5.0 Technical Support Mode, see Using Tech Support Mode in ESXi 4.1 and ESXi 5.x (1017910).

If the virtual machine have snapshots, commit them by running 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

Note: For committing snapshots on an ESXi 5.1 or later host, see Committing snapshots on ESXi host from command line (1026380).

Power off the virtual machine.

Note: The virtual machine can be powered on to increase the vmdk size in steps 4 and 5. However ensure to power off the virtual machine after increasing VMDK size.

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

Enter a new value in the New Size field:

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

#vmkfstools -X
#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.

To extend the C: partition, 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:

Go to the Edit Settings menu of the virtual machine.

Click Add > Hard Disk > Use Existing Virtual Disk.

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.

Start the helper virtual machine.

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 disk=2
DiskPart successfully extended the volume.
DISKPART> exit
Leaving DiskPart...

Note: Where 2 above is the disk volume number of the volume to extend.

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

In Windows 2008, click Start > Computer Management > Disk Manager, right-click on the partition and select Extend Volume.

Note: The preceding links were correct as of March 14, 2013. If you find a link is broken, provide feedback and a VMware employee will update the link.

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

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

To expand VMDK and extend a partition using the vSphere Web Client:

Log in to the VMware ESX/ESXi host through the console or SSH as the user root . Verify that the virtual machine does not have any snapshots in the virtual machine's directory and look for Delta files. Run the 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

Note: For more information on:

VMware ESX Service Console, Unable to connect to an ESX host using Secure Shell (SSH) (1003807).

VMware ESXi Technical Support Mode, Tech Support Mode for Emergency Support (1003677).

VMware ESXi 4.1 and ESXi 5.0 Technical Support Mode, Using Tech Support Mode in ESXi 4.1 and ESXi 5.x (1017910).

If the virtual machine does have snapshots, commit them by running these commands:

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

Note: For committing snapshots on an ESXi 5.1 or later host, see Committing snapshots on ESXi host from command line (1026380).

Power off the virtual machine.

Note: The virtual machine can be powered on to increase the vmdk size in steps 4 and 5. However ensure to power off the virtual machine after increasing VMDK size.

Log in to the vSphere Web Client and navigate to Virtual Machines and Templates.

Right-click on the virtual machine with the hard disk you want expand the hard disk and select Edit Settings....

To extend the C: partition, 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:

Right-click on the helper virtual machine and select Edit Settings....

Select Existing Hard Disk from the New Device menu and click Add.

Navigate to the location of the disk and select it.

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

Click OK to add the disk to the helper virtual machine

Start the virtual machine.

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 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 disk=2
DiskPart successfully extended the volume.
DISKPART> exit
Leaving DiskPart...

Note: Where 2 above is the disk volume number of the volume to extend.

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

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

In Windows 2008, click Start > Computer Management > Disk Manager, right-click on the partition and select Extend Volume.

Note: The preceding links were correct as of March 14, 2013. If you find a link is broken, provide feedback and a VMware employee will update the link.

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

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

Related Information

Note: The links in this article were correct as of August 9, 2013. If you find a broken link, provide feedback to this article and a VMware employee will update the link.

For more information, see Increasing the size of a disk partition (1004071).
Tech Support Mode for Emergency Support
Unable to connect to an ESX host using Secure Shell (SSH)
Increasing the size of a virtual disk
Using Tech Support Mode in ESXi 4.1, ESXi 5.x, and ESXi 6.x
Snapshot Manager fails to detect snapshots of VMs
Extender las particiones en Windows mediante DiskPart
Como estender partições no Windows usando DiskPart
在 Windows 中使用 DiskPart 扩展分区
DiskPart を使用した Windows でのパーティションの拡張

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglish

Attachments

Additional Resources

KB
•
End Of General Availability of the Free vSphere Hypervisor (ESXi 7.x and 8.x) (2107518)

KB
•
Download and Install VMware Fusion (2014097)

Results 1-2 of 2

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware vSphere ESXi

VMware ESX Server

Related Versions:

VMware vSphere ESXi 6.0

VMware vSphere ESXi 5.5

VMware vSphere ESXi 5.1

VMware vSphere ESXi 5.0

VMware ESXi 4.1.x Installable

VMware ESXi 4.1.x Embedded

VMware ESXi 4.0.x Installable

VMware ESXi 4.0.x Embedded

VMware ESXi 3.5.x Installable

VMware ESXi 3.5.x Embedded

VMware ESX Server 3.5.x

VMware ESX Server 3.0.x

VMware ESX 4.1.x

VMware ESX 4.0.x

view all

Take Our Survey

Was this article helpful?

YES

NO

Copyright © 2005-2024 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.

Terms of Use

Your California Privacy Rights

Privacy

Accessibility

Cookie Settings

Support Assistant