Help Center

Step-by-step guides for servers, networks and your account.

Windows Server

Extend C: Drive on Windows Server After a Disk Upgrade and Initialize a New Data Disk

Extend C: Drive on Windows Server After a Disk Upgrade and Initialize a New Data Disk

After you upgrade a JUSTG Windows VPS to a plan with a larger SSD from the service page in the client area, or a new disk is added to your server, Windows does not use the new capacity automatically: it appears as unallocated space at the end of the disk or as a brand-new raw disk. This guide shows how to extend the C: drive on Windows Server 2016, 2019 and 2022 with Disk Management and PowerShell, what to do when a recovery partition blocks "Extend Volume", and how to initialize and format a new data disk.

Partition changes are low-risk when done correctly, but a wrong disk or partition number can destroy data. Back up important files first and double-check every number before you press Enter.

Step 1: Rescan disks and confirm the new size

Open PowerShell as Administrator and refresh the storage cache, then list the disks and the partitions on disk 0 (the system disk):

Update-HostStorageCache
Get-Disk | Select-Object Number, FriendlyName, PartitionStyle, OperationalStatus, @{n='SizeGB';e={[math]::Round($_.Size/1GB,1)}}
Get-Partition -DiskNumber 0 | Select-Object PartitionNumber, DriveLetter, Type, @{n='SizeGB';e={[math]::Round($_.Size/1GB,1)}}

Disk 0 should now show the upgraded size. If it still reports the old size, restart the server once from Windows or from the client area and run the commands again. In the GUI, the equivalent is diskmgmt.msc → Action → Rescan Disks.

Step 2: Extend the C: drive in Disk Management (GUI)

In Disk Management, right-click the C: partition and choose Extend Volume. The wizard proposes all adjacent unallocated space; accept the default and click Finish. The change is online, so there is no reboot and no downtime. If Extend Volume is greyed out, the free space is not directly behind C:; see Step 4.

Step 3: Extend C: with PowerShell (Resize-Partition)

On Server Core or for scripted maintenance, ask Windows for the largest size C: can reach and resize to it:

$max = (Get-PartitionSupportedSize -DriveLetter C).SizeMax
Resize-Partition -DriveLetter C -Size $max
Get-Volume -DriveLetter C

Get-PartitionSupportedSize returns a minimum and maximum in bytes. If SizeMax equals the current size, the unallocated space is not adjacent to C:.

Step 4: When the recovery partition blocks the extension

Some Windows Server installations place a small recovery partition (about 500 MB to 1 GB) right after C:. Because a partition can only grow into space immediately behind it, the new capacity at the end of the disk cannot be used. The usual fix is to disable Windows RE, remove that recovery partition, extend C:, and re-enable Windows RE, which then lives inside C:\Windows. Confirm the partition number from Step 1: its Type is Recovery. The example uses partition 4:

reagentc /info
reagentc /disable

diskpart
DISKPART> list disk
DISKPART> select disk 0
DISKPART> list partition
DISKPART> select partition 4
DISKPART> delete partition override
DISKPART> exit

# Extend C: (Step 3), then re-enable WinRE
reagentc /enable
The delete partition override command cannot be undone. Make sure the selected partition is the Recovery partition on disk 0, not C: or a data partition.

Step 5: Initialize and format a new data disk

A newly attached disk appears as Not Initialized (RAW). Disk Management usually pops up the Initialize Disk dialog; choose GPT, then right-click the unallocated area and select New Simple Volume. In PowerShell, use the disk number shown for the RAW disk:

Get-Disk | Where-Object PartitionStyle -eq 'RAW'

# If the disk is offline or read-only
Set-Disk -Number 1 -IsOffline $false
Set-Disk -Number 1 -IsReadOnly $false

Initialize-Disk -Number 1 -PartitionStyle GPT
New-Partition -DiskNumber 1 -UseMaximumSize -DriveLetter E
Format-Volume -DriveLetter E -FileSystem NTFS -NewFileSystemLabel "Data" -Confirm:$false

Use GPT for anything larger than 2 TB; MBR cannot address more. We use letter E because D: is often taken by the virtual CD-ROM drive.

Step 6: Verify the result

Get-Volume | Where-Object DriveLetter | Format-Table DriveLetter, FileSystemLabel, FileSystem, @{n='SizeGB';e={[math]::Round($_.Size/1GB,1)}}, @{n='FreeGB';e={[math]::Round($_.SizeRemaining/1GB,1)}}

C: should now show the full size, and the new disk should appear with its label and free space. Move data, databases or website files to the new volume as needed.

FAQ

Do I need to shut down the server to extend C:?

No. NTFS volumes can be extended while Windows is running. A restart is only needed if Windows does not detect the new disk size after a rescan.

Can I upgrade the disk on a JUSTG dedicated server the same way?

Dedicated servers are set up by the JUSTG team. To add storage, submit a ticket to Sales/Inquiries, which handles custom builds. On a cloud VPS, upgrade to a plan with a larger SSD from the service page.

Is it safe to delete the recovery partition?

On a server you manage remotely, Windows RE is rarely used, and re-enabling it with reagentc /enable stores it inside the C: drive. Keep a backup before changing partitions in any case.

If the new space does not appear or the extension fails, submit a ticket to JUSTG technical support with the output of Step 1, and we will check the disk on our side.

Was this answer helpful?
Help Center
AlipayUnionPayVISAMastercardPayPalUSDTstripe