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

12 min read 2 views 0
On this page

After you add SSD space to a JUSTG Windows VPS through the upgrade options in the client area, or attach an extra disk, 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 not upgraded with custom configurations. To get more storage, move to a higher plan by contacting Billing or Sales. On a VPS you can add SSD space from the upgrade options in the client area.

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?

Related Tutorials

Windows PowerShell PS> Test-NetConnection -ComputerName 203.0.113.10…PS> nc -vz 203.0.113.10 3389PS> Get-Service -Name TermService Windows Server Remote Desktop Can't Connect to Windows Server VPS: RDP Troubleshooting Guide Fix Remote Desktop (RDP) connection failures on a Windows Server VPS: port 3389 test, firewall, NLA/CredSSP errors and the VNC console. 13 min read 2 Read tutorial Windows PowerShell PS> Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentC…PS> Get-NetTCPConnection -LocalPort 40125 -ErrorA…PS> $port = 40125 Windows Server How to Change the Remote Desktop (RDP) Port on Windows Server Change the Windows Server RDP port from 3389 with PowerShell: registry PortNumber, firewall rules, TermService restart and safe rollback. 12 min read 2 Read tutorial Windows PowerShell PS> Get-WinSystemLocalePS> Get-WinUILanguageOverridePS> Get-WinUserLanguageList Windows Server Change Windows Server Display Language, System Locale and Time Zone (2016/2019/2022) Change the Windows Server display language with Install-Language or a language pack, then set system locale, user languages and time zone. 12 min read 2 Read tutorial Windows PowerShell PS> Get-NetAdapterPS> Get-NetIPConfiguration -InterfaceAlias "Ether…PS> Get-NetIPInterface -InterfaceAlias "Ethernet"… Windows Server Add an Additional IPv4 Address and Configure IPv6 on Windows Server Add an extra IPv4 and configure IPv6 on Windows Server via GUI, PowerShell or netsh, with SkipAsSource, gateway, DNS and connectivity tests. 14 min read 2 Read tutorial