‘The volume you have selected may not be extended’ error when attempting a volume extension using Diskpart


I encountered this problem trying to resize the system drive of a virtual machine. Normally I add the extra space using the vSphere client then power down the VM before adding the virtual disk as a secondary disk on another Windows 2003 VM. There I can usually run Diskpart and safely extend it, detach as a secondary drive and power up the original VM with it’s now extended system drive.

In this instance I received the error:
The volume you have selected may not be extended.
Please select another volume and try again.

After a liitle research and reading I found this which pointed me in the right direction:

http://www.edwardsd.co.uk/work/2010/05/fsextend-exe-diskpart/

I downloaded fsextend and saved into C:WindowsSystem32 and then whilst still using the Diskpart utility, ran the command:
extend filesystem

But I still received the error. I was about to run the fsextend utility directly as the only syntax it requires is fsextend (drive letter) when I realised that I would need a drive letter for the volume I was attempting to extend (I don’t normally assign a letter – the volume usually extends without)

I assigned a drive letter and whilst still in the same session of Diskpart ran extend filesystem again but this time it was successful..

I’m not sure whether simply assigning a drive letter resolved the issue or whether fsextend helped in some way.

I later found out that from Windows 2003 SP2 the Diskpart utility has the extra and originally undocumented filesystem command included natively within the utility. In theory you should not need the fsextend utility above if running the latest Windows 2003 SP2 and it may be worth assigning a drive letter temporarily to see if this resolves the extending issue in the first instance.

Advertisements

How to extend a boot or system volume on a Windows 2003 Server VMware Virtual Machine


You may have had a requirement to increase the space on the system drive of a Windows Server only to find that even though there is unallocated space to extend into you cannot extend the partition.

There is a neat workaround that I have tried a few times that works very well.

  • Power down the Virtual Machine
  • Make a backup copy of the Virtual Machine. Depending upon your flavour of VMware this can be done a number of ways. I like to browse the datastore using the VI client and take a full copy of the VM.
  • In the VI client edit the settings of the VM and increase the system partitions’ virtual hard disk to the desired setting and apply
  • Next you will need a second VM that is also running Windows 2003 Server. Power it down. In the VI client edit the settings of the second VM and Add a Hard Disk.
  • Select Use an existing virtual disk and Browse to the actual location of the first VM’s system disk
  • After you have added the disk and applied it, power up the second VM
  • Open Computer Management > Disk Management and you should see the system disk from the first VM with the accompanying Unallocated space
  • Run the Diskpart utility from Start > Run > Diskpart
  • Type list volume which displays all available volumes. Locate the volume to increase and type select volume x (where x is the volume number)
  • Finally type extend. If it has worked the message Diskpart successfully extended the volume should appear
  • Shutdown the second VM and in the VI client remove the hard disk from its configuration
  • Power on the first VM and voila, your system partition should now be fully utilising the allocated space