This article is intended for administrators wishing to increase the capacity of virtual disks on their virtual machines.
Expand a Virtual Disk
Follow these steps to increase the capacity of a virtual disk and, where applicable, extend the operating system partition.
Expanding a virtual disk is straightforward provided the VM snapshot feature is not enabled. If snapshots are enabled, the extend operation will fail until they have been removed.
When expanding the C: drive of a Windows Server/Desktop VM, the Windows Recovery partition may need to be moved or recreated before the operating system partition can be extended.
Step 1 - Increase the Virtual Disk Size
From the left navigation pane, select Virtual Machines on the node where the VM is running.
Open the Virtual Machines page
Select the required virtual machine, then browse to the virtual disk that requires expansion.
Select the virtual disk
Selecting the virtual disk opens the associated Targets page.
Virtual disk target details
From the left-hand Actions menu, select Extend.
Snapshot prevents disk extension
In this case, cancel the operation and disable snapshots before attempting the disk extension again.
Browse to Virtual Machines, select the VM, then choose Actions > Disable Snapshot.
Disable VM snapshots
Complete the Virtual Disk Expansion
Disabling snapshots removes all snapshots for the virtual machine and allows the virtual disk to be extended.
Return to the Targets page, ensure the correct virtual disk is selected, then choose Extend.
Enter a value larger than the current virtual disk size and select EXTEND.
Extend the virtual disk
If the virtual machine is protected, a short synchronization with the partner node will occur after the virtual disk has been extended.
Virtual disk resynchronization
Step 2 - Windows Server/Desktop Virtual Machines
If the expanded virtual disk does not contain the operating system (C:), simply extend the partition using Windows Disk Management.
If the expanded virtual disk does contain the C: drive, the Windows Recovery partition will usually prevent the partition from being extended.
The Recovery partition can either be moved using third-party partition management software (such as MiniTool Partition Wizard or EaseUS Partition Master) or removed and recreated using the native Windows command-line tools described below.
Before proceeding, refer to the snapshot documentation:
Enable VM Snapshots
Take a VM Snapshot
Create a snapshot before modifying partitions
The remaining procedure demonstrates the native Windows method for recreating the Recovery partition after the virtual disk has been expanded.
Recovery partition blocks disk extension
Complete the Virtual Disk Expansion
Disabling snapshots removes all snapshots for the virtual machine and allows the virtual disk to be extended.
Return to the Targets page, ensure the correct virtual disk is selected, then choose Extend.
Enter a value larger than the current virtual disk size and select EXTEND.
Extend the virtual disk
If the virtual machine is protected, a short synchronization with the partner node will occur after the virtual disk has been extended.
Virtual disk resynchronization
Step 2 - Windows Server/Desktop Virtual Machines
If the expanded virtual disk does not contain the operating system (C:), simply extend the partition using Windows Disk Management.
If the expanded virtual disk does contain the C: drive, the Windows Recovery partition will usually prevent the partition from being extended.
The Recovery partition can either be moved using third-party partition management software (such as MiniTool Partition Wizard or EaseUS Partition Master) or removed and recreated using the native Windows command-line tools described below.
Before proceeding, refer to the snapshot documentation:
Enable VM Snapshots
Take a VM Snapshot
Create a snapshot before modifying partitions
The remaining procedure demonstrates the native Windows method for recreating the Recovery partition after the virtual disk has been expanded.
Recovery partition blocks disk extension
Workaround for GPT Boot Volumes
Launch a Windows Command Prompt as an administrator and disable the Windows Recovery Environment.
C:\Windows\System32>reagentc /disable
REAGENTC.EXE: Operation Succesful.
If this command fails, verify that there is sufficient free space on the C: drive.
If required, remove old Windows Update files located in:
C:\Windows\SoftwareDistribution\Download
Once the command completes successfully, launch DiskPart.
C:\Windows\System32>diskpart
Display the available disks.
C:\Windows\System32>diskpart
Microsoft DiskPart version 10.0.26100.1150
Copyright (C) Microsoft Corporation.
On computer: DESKTOP-IFBJ988
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 37 GB 1025 MB *
Select the appropriate disk.
DISKPART> select disk 0
Disk 0 is now the selected disk.
List the partitions.
DISKPART> list partition
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 System 200 MB 1024 KB
Partition 2 Reserved 16 MB 201 MB
Partition 3 Primary 34 GB 217 MB
Partition 4 Recovery 1024 MB 34 GB
Select the partition identified as Recovery.
DISKPART> select partition 4
Partition 4 is now the selected partition.
DISKPART> list partition
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 System 200 MB 1024 KB
Partition 2 Reserved 16 MB 201 MB
Partition 3 Primary 34 GB 217 MB
* Partition 4 Recovery 1024 MB 34 GB
Display the partition details.
DISKPART> detail partition
Partition 4
Type : de94bba4-06d1-4d40-a16a-bfd50179d6ac
Hidden : Yes
Required: Yes
Attrib : 0X8000000000000001
Offset in Bytes: 37578866688
Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
* Volume 4 Recovery NTFS Partition 1024 MB Healthy Hidden
Record the values for Type and Attrib, then delete the Recovery partition.
DISKPART> delete partition override
DiskPart successfully deleted the selected partition.
The Recovery partition has now been removed and the primary partition can be extended using the Windows Extend Volume wizard.
Extend the Windows volume
Recreate and Enable the Recovery Partition
Leave space for the Recovery partition
Once the operating system partition has been extended, create a new NTFS partition in the remaining unallocated space without assigning a drive letter.
Create a new NTFS partition
Configure the new partition
Recovery partition created
Return to DiskPart and display the partitions.
DISKPART> list partition
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 System 200 MB 1024 KB
Partition 2 Reserved 16 MB 201 MB
Partition 3 Primary 35 GB 217 MB
Partition 4 Primary 1024 MB 35 GB
Select the newly created partition.
DISKPART> select partition 4
Partition 4 is now the selected partition.
Using the values recorded from the original Recovery partition, restore the partition ID and GPT attributes.
DISKPART> set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
DiskPart successfully set the partition ID.
DISKPART> gpt attributes=0X8000000000000001
DiskPart successfully assigned the attributes to the selected GPT partition.
Verify the partition type has changed back to Recovery.
DISKPART> list partition
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 System 200 MB 1024 KB
Partition 2 Reserved 16 MB 201 MB
Partition 3 Primary 35 GB 217 MB
* Partition 4 Recovery 1024 MB 35 GB
Exit DiskPart and re-enable the Windows Recovery Environment.
C:\Windows\System32>reagentc /enable
REAGENTC.EXE: Operation Succesful.
Comments
0 comments
Article is closed for comments.