VPS · Question & answer

How do I expand a Windows Server VPS data volume with PowerShell?

Increasing a VPS virtual disk does not automatically enlarge every Windows volume. After the provider completes the disk change, Windows must recognise the extra capacity and the target partition must support extension.

AdvancedWindows Server VPS with the PowerShell Storage moduleA healthy, unencrypted NTFS data partition on a basic disk
Go to the answer

Before you start

  • A completed provider disk increase, administrator access and a usable existing recovery path.

Instructions

1. Identify the actual disk and data volume

Run elevated PowerShell inside the Windows VPS. D: is only an example: substitute the verified data volume throughout. Confirm that the reported disk size includes the provider increase and that the volume is healthy NTFS. This walkthrough is limited to an ordinary basic data partition.

Remote Windows PowerShell
$TargetPartition = Get-Partition -DriveLetter D
Get-Disk -Number $TargetPartition.DiskNumber | Select-Object Number, FriendlyName, PartitionStyle, OperationalStatus, Size
Get-Partition -DiskNumber $TargetPartition.DiskNumber | Sort-Object Offset | Select-Object PartitionNumber, DriveLetter, Type, Offset, Size
Get-Volume -DriveLetter D | Select-Object DriveLetter, FileSystemType, HealthStatus, Size, SizeRemaining

These commands inspect the target and all neighbouring partitions without resizing anything. Compare the disk identity with the service allocation.

2. Check the available extension and preview it

Unallocated space must immediately follow the target on the same disk. Review partition offsets and sizes, or confirm the layout in Disk Management. A recovery partition between D: and the free space blocks this simple extension. Continue only if SizeMax exceeds the current partition size.

Remote Windows PowerShell
$SizeRange = Get-PartitionSupportedSize -DriveLetter D
$SizeRange | Select-Object SizeMin, SizeMax
$TargetPartition | Select-Object DiskNumber, PartitionNumber, DriveLetter, Size
Resize-Partition -DriveLetter D -Size $SizeRange.SizeMax -WhatIf

SizeMax is the supported final size, not an amount to add. WhatIf previews the requested operation; it does not guarantee that the subsequent write will succeed.

3. Apply the approved expansion

Use this separate block only after reviewing the target, capacity and maintenance impact. If the disk layout or session changed, repeat the inspection and preview first.

Remote Windows PowerShell
Resize-Partition -DriveLetter D -Size $SizeRange.SizeMax

This changes both the selected partition and its supported filesystem to the approved maximum size.

4. Verify capacity and application access

Confirm the new partition and volume sizes, then check that existing data and the application remain accessible.

Remote Windows PowerShell
Get-Partition -DriveLetter D | Select-Object DiskNumber, PartitionNumber, DriveLetter, Size
Get-Volume -DriveLetter D | Select-Object DriveLetter, FileSystemType, HealthStatus, Size, SizeRemaining

Filesystem overhead means reported usable capacity can differ slightly from partition size.

Check the result

  • The intended data partition has expanded and its filesystem remains healthy.
  • Existing application data is accessible and the additional capacity is visible.

Troubleshooting

SizeMax is unchanged or the operation is unsupported
Check provider completion, guest disk recognition and adjacent free space. Do not delete intervening recovery partitions or force the layout.
The volume is encrypted, clustered, dynamic or uses Storage Spaces
Stop and use the documented procedure for that storage configuration. ReFS also requires its own confirmed support and layout checks.

Official references

Use the documentation for your installed version when a flag, service name or platform feature differs.