Resize a Windows Dev Drive (VHDX-backed, ReFS) by recreating it with a larger size while preserving all data.
Dev Drive D: (50 GB) is full. git fetch and other operations fail with no space left.
This script:
- Backs up all data from D: to C:\DevDriveBackup\
- Dismounts and deletes the old 50 GB VHDX
- Creates a new 100 GB VHDX with identical config (ReFS Dev Drive, same drive letter, same junction)
- Restores all data
- Cleans up
The easiest path is the setup helper — give it the drive letter and target size; it auto-detects everything, writes the config, and can run the resize:
# Detect + write config only (safe, no admin needed):
C:\tools\resize-devdrive\Setup-Resize.ps1 D 200
# Detect, write config, and run the resize (elevated PowerShell required):
C:\tools\resize-devdrive\Setup-Resize.ps1 D 200 -RunOr run the resize directly (close VS Code and anything using the drive first, elevated):
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
C:\tools\resize-devdrive\Resize-DevDrive.ps1 -DriveLetter D -NewSizeGB 200Only which drive and the target size are required — everything else (the backing VHDX, the volume label, any junction pointing to the drive, and the backup/state/log locations) is auto-detected from the drive or defaulted. Settings come from parameters or a nested JSON config file. Precedence: command-line parameters > config file > auto/defaults.
{
"drive": {
"letter": "D",
"targetSizeGB": 100
}
}That is the whole config for the normal case (resize-devdrive.config.json, git-ignored).
A resize-devdrive.config.json next to the script is picked up automatically.
If the script fails mid-way (defaults shown; <letter> is the drive letter):
- State file:
state\DevDriveResize-<letter>.jsonnext to the script (shows last completed phase) - Backup:
%TEMP%\DevDriveBackup-<letter>\(complete copy of the old Dev Drive data) - Logs:
logs\Resize-<letter>-Backup.log,logs\Resize-<letter>-Restore.lognext to the script
Re-running the script resumes from the last completed phase. If a backup already exists at the target path, the script warns and lets you either recreate a fresh backup (recommended) or reuse the existing one.
| Item | Value |
|---|---|
| VHDX | C:\DevDrive.vhdx (49.41 GB, dynamic) |
| Volume | D: 50 GB ReFS, Label "Development" |
| Junction | C:\Development -> D:\ |
| Windows | Build 10.0.26100.0 |
| C: free | ~385 GB |
| Target size | 100 GB |