Networknet archive Blog

VMware ESX: Extend a full virtual hard disk

Originally published Last updated 2 comments

I was recently preparing to move a virtual machine from a test network into production. Before doing so, I wanted to install the latest updates, but the virtual hard disk became full during that process. I had initially configured it with 6GB of disk space.

image

VMware ESX lets you increase the virtual disk size while a VM is running.

Increase the virtual disk size

Right-click the VM in the VI client, choose settings, open “Hard Disk 1” and enter the new size. Click OK.

image

This is the new configuration in “Disk Management”. The next step is to extend the volume with diskpart.

image

I opened Command Prompt, started diskpart, selected the volume and ran extend. It returned:

The volume you selected may not be extended. Please select another volume and try again.

image

The disk was full, and I could not extend the basic volume into the additional 2GB. I found two solutions.

Solution 1: Attach the disk to another VM

A post by Kalpesh Prajapati helped me find a solution. Follow these steps:

  1. Shut down the virtual machine.
  2. Increase the virtual disk size.
  3. Attach the hard disk to another VM and start that second VM.
  4. Open Command Prompt and start diskpart.exe.
  5. List the volumes and select the one with the disk-space problem.
  6. Extend the disk.

image

Make sure the volume has a drive letter; otherwise, the same warning is returned. The original VM started again without problems, with an additional 2GB of disk space.

Solution 2: Use ExtPart.exe

Arne Fokkema posted another solution for extending a basic disk. It should be easier with Dell’s ExtPart.exe tool: Extend the OS disk the easy way (ExtPart.exe).

ExtPart - Utility to extend basic disks (Build 1.0.4)
(c) Dell Computer Corporation 2003

Usage: extpart.exe [volume size]
volume - volume to expand. eg. f:, g: etc. (only basic volumes)
size - size in megabytes to expand the volume

Code1 line
1
ExtPart.exe C: 2048

Both solutions worked and solved my virtual machine’s disk-space problem.

2 comments

Comments from the original WordPress site, kept read-only.

  1. jean-jacques

    Excellent article, the limitation with this is system partition/drive : we can not use diskpart in this case; I saw alot of articles, and I found one in www.ntsysv.com with a video which was very helpful.
    thank you again, I'll be back for further reading.

  2. Heero

    ExtPart doesn't work on Server 2003 64bit...so fail on extending primary C drive basic partition...